PRB: "CS1010: Newline in Constant" Error Message When a String Contains a </SCRIPT> Tag in the Inline Code (827420)
The information in this article applies to:
- Microsoft ASP.NET (included with the .NET Framework) 1.0
- Microsoft ASP.NET (included with the .NET Framework 1.1)
SYMPTOMSWhen you try to browse an .aspx page with inline code
that contains the </SCRIPT> HTML
tag, you may receive the following error message: Server Error in '/<applicationname>'
Application.
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details and
modify your source code appropriately.
Compiler Error Message: CS1010: Newline in constant WORKAROUNDTo work around this problem, split the
</SCRIPT> tag in two or more strings such as "<" + "/SCRIPT>", and then use inside script blocks as follows:
private void Page_Load(object sender, System.EventArgs e)
{
string strValue = "Test value";
string strAll = "<SCRIPT lanquage='JScript'>window.alert('" + strValue + "');<"+"/SCRIPT>";
} STATUS This
behavior is by design.
Modification Type: | Major | Last Reviewed: | 10/3/2003 |
---|
Keywords: | kbWebForms kberrmsg kbScript kbprb KB827420 kbAudDeveloper |
---|
|