Why does my the declaration of my string in the code result in the following error? Is there a workaround?
Code:
<script runat="server">
Protected Sub form1_Load(sender As Object, e As System.EventArgs)
Dim x As String = "</script>"
Response.Write(x)
End Sub
</script>
Error: Statement cannot appear within a method body. End of method assumed.
Note: The following page did not fix my issue and instead resulted in the string <\/script> being output in my page. ( VB.NET hates </script> tag in string literal )
try :