Hello everybody,
this is the problem I encountered with working with the
client-side javascript from the .ASPX page, I believe that
info will be exremely useful:
************************************************
Hello Ken
I have read the article you placed on a Web: "Implement
Client Scripts" in the ASP.NET environment, but for some
unknown reason whatever code I use I get the same error
message:
"string constants must end with a double quote."
This is my code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs)
Dim s As String
s = "<script LANGUAGE=JavaScript>"
s = s & " alert('Wrong Login Name or Password!');"
s = s & " </script>"
If Not IsStartupScriptRegistered("Warning") Then
Page.RegisterStartupScript("Warning", s)
End If
End Sub
************************************************** *
This is Ken's Cox response that solved that mistery:
************************************************** *
I've seen this before where the ASP.NET parser gets
excited when it sees a <script> tag and doesn't understand
that the context is client-side.
It will work if you disguise it by splitting it up:
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs)
Dim s As String
s = "<scri"
s = s & "pt language='JavaScript'>"
s = s & " alert('Wrong Login Name or Password!');"
s = s & " </scr"
s = s & "ipt>"
If Not IsStartupScriptRegistered("Warning") Then
Page.RegisterStartupScript("Warning", s)
End If
End Sub
</script>
Good luck!
Ken
*********************************************
plus see the link sent me by Firoz Ansari, it addresses
the same issue:
http://support.microsoft.com/default.aspx?scid=kb;en-
us;316174