Microsoft KB Archive/316174

= PRB: The  Tag Is Treated As a Closing Tag When Inside a Quoted String =

Article ID: 316174

Article Last Modified on 2/11/2004

-

APPLIES TO


 * Microsoft ASP.NET 1.1
 * Microsoft ASP.NET 1.0
 * Microsoft Active Server Pages 4.0

-



This article was previously published under Q316174



SYMPTOMS
When you use a  Hypertext Markup Language (HTML) tag inside a quoted string, the tag is treated as a closing tag rather than as a portion of the string.



RESOLUTION
To work around this behavior, do not directly use the  tag inside a script section. Instead, you can use alternatives such as the following tag: chr(60) & &quot;/SCRIPT>



STATUS
This behavior is by design.



Steps to Reproduce the Behavior
  Copy the following code to a Script.aspx page, and then save it to your Web server:  Private Sub scripTest(ByVal sender As System.Object, ByVal e As System.EventArgs)

Dim myStr as String myStr = &quot; &quot;

End Sub

  WebForm1   </asp:Button> </HTML>

</li> <li>Reference the test page in your Web browser, and the following error message appears:

Compiler Error Message:BC30648: String constants must end with a double quote

</li> <li> Modify the Script.aspx page, and then change the following line of code from: myStr = &quot; &quot; to: myStr = chr(60) & &quot;/script>&quot; Note that the Script.aspx page functions as expected when you change the code. </li></ol>

Keywords: kbwebforms kbprb KB316174

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.