S
Stephen Witter
I am trying to place a very simple javascript alert in asp.net. I am
using web matrix. When I place the following code in the code view it
screws everything up:
Sub My_MsgBox()
System.Web.HttpContext.Current.Response.Write("<SCRIPT
LANGUAGE=""JavaScript"">" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("alert(""" & "hi" &
""")" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("</script>")
End Sub
The last script tag is being recognized by web matrix as a legit
script tag even though it is in a response.write statement. I have
noticed this happens when I have tried it using other prcedures
(unsuccessfully) such as a window.open call that use script tags.
What happens is the existing script tags in web matrix used to
separate the code from the html (web matrix doesn't use code behind)
get messed up because it sees the other script tag and proceeds to
hose up my code.
Any thoughts?
using web matrix. When I place the following code in the code view it
screws everything up:
Sub My_MsgBox()
System.Web.HttpContext.Current.Response.Write("<SCRIPT
LANGUAGE=""JavaScript"">" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("alert(""" & "hi" &
""")" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("</script>")
End Sub
The last script tag is being recognized by web matrix as a legit
script tag even though it is in a response.write statement. I have
noticed this happens when I have tried it using other prcedures
(unsuccessfully) such as a window.open call that use script tags.
What happens is the existing script tags in web matrix used to
separate the code from the html (web matrix doesn't use code behind)
get messed up because it sees the other script tag and proceeds to
hose up my code.
Any thoughts?