Problems Writing some Javascript in my code-behind

Hyuga

Freshman
Joined
Jul 21, 2005
Messages
30
Why, when I'm trying to do that inside a sub:
Visual Basic:
            Dim MsgBoxText As String= "No eres responsable de ninguna unidad"
            Response.Write("<script language='JavaScript'>")
            Response.Write("alert('" & MsgBoxText & "');")
            Response.Write("</script>")
My asp page gets an error?

It looks like my code gets commented after I wrote that, and the interpreter doesn't read correctly the rest of my code and I get one error.

Any Idea?
 
Solved. The only change needed:
Visual Basic:
Response.Write("<" & "/script>")

I don't understand the reason, but it works.
 
Back
Top