client-side javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jerry Kogan

    #1

    client-side javascript

    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.EventArg s)

    Dim s As String
    s = "<script LANGUAGE=JavaSc ript>"
    s = s & " alert('Wrong Login Name or Password!');"
    s = s & " </script>"
    If Not IsStartupScript Registered("War ning") Then
    Page.RegisterSt artupScript("Wa rning", 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.EventArg s)
    Dim s As String
    s = "<scri"
    s = s & "pt language='JavaS cript'>"
    s = s & " alert('Wrong Login Name or Password!');"
    s = s & " </scr"
    s = s & "ipt>"
    If Not IsStartupScript Registered("War ning") Then
    Page.RegisterSt artupScript("Wa rning", s)
    End If
    End Sub
    </script>

    Good luck!
    Ken
    *************** *************** ***************
    plus see the link sent me by Firoz Ansari, it addresses
    the same issue:

    us;316174

Working...