Javascript in codebehind problem
-
I sure hope someone can help me with this frustrationg, and seamingly simple, problem. I am trying to create a modal dialog for a user to enter a password of sorts ( a 4 digit PIN #). My attempt to create the pop up isn't working and I get the error, "Microsoft JScript runtime error: Object doesn't support this property or method" I am calling a sub in my VB.NET codebehind like this: Private Sub ValidatePIN() Dim sURL As String Dim sScript As String sURL = "http://localhost/OASIS/AppModules/PinEntry.aspx" sScript = "" sScript &= "window.ShowModalDialog(" & Chr(34) & sURL & Chr(34) & ",'window','');" sScript &= "" Response.Write(sScript) End Sub It seems to be something in my syntax as the following test works: Private Sub ValidatePIN() Dim sScript As String sScript = "" sScript &= "window.alert(" & Chr(34) & "Hello World" & Chr(34) & ");" sScript &= "" Response.Write(sScript) End Sub Thank you. Pat Reddy
-
I sure hope someone can help me with this frustrationg, and seamingly simple, problem. I am trying to create a modal dialog for a user to enter a password of sorts ( a 4 digit PIN #). My attempt to create the pop up isn't working and I get the error, "Microsoft JScript runtime error: Object doesn't support this property or method" I am calling a sub in my VB.NET codebehind like this: Private Sub ValidatePIN() Dim sURL As String Dim sScript As String sURL = "http://localhost/OASIS/AppModules/PinEntry.aspx" sScript = "" sScript &= "window.ShowModalDialog(" & Chr(34) & sURL & Chr(34) & ",'window','');" sScript &= "" Response.Write(sScript) End Sub It seems to be something in my syntax as the following test works: Private Sub ValidatePIN() Dim sScript As String sScript = "" sScript &= "window.alert(" & Chr(34) & "Hello World" & Chr(34) & ");" sScript &= "" Response.Write(sScript) End Sub Thank you. Pat Reddy
Hi, I want to solve the same problem. - I need a modal dialog for user, who must type in the username and password. - But I haven't a clue how can I get back the data from the user to my variable? Could you help me?
-
Hi, I want to solve the same problem. - I need a modal dialog for user, who must type in the username and password. - But I haven't a clue how can I get back the data from the user to my variable? Could you help me?
There is a way to call ShowModalDialog with a variable list of sorts that can be returned to teh calling page. Google "window.ShowModalDialog" and you should find an answer.
-
There is a way to call ShowModalDialog with a variable list of sorts that can be returned to teh calling page. Google "window.ShowModalDialog" and you should find an answer.
Hi, thanks for your answer, I'll try it. Meanwhile, I found ShowModalDialog method in msdn, there's a feature, which allows you to create the code automatically, maybe it could help you. http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/showmodaldialog.asp http://msdn.microsoft.com/workshop/samples/author/dhtml/refs/showModalDialog.htm