Article ID: 323487 - Last Review: February 23, 2007 - Revision: 2.6 PRB: JScript .NET Compiler Generates Unexpected Errors for Comments in an .aspx PageThis article was previously published under Q323487 On This PageSYMPTOMS
When server-side code in an .aspx page contains an at sign (@) immediately after a comment statement, the JScript .NET compiler may generate unexpected errors. The following code demonstrates this scenario:
CAUSE
This problem occurs in both scenarios because of the way that JScript .NET implements preprocessor directives. The .aspx page is transformed into a JScript class file with the preprocessor set to on so that JScript can remap line numbers. This means that the "//@" characters are significant.
RESOLUTION
To resolve this problem, make sure that you are aware of how JScript .NET implements preprocessor directives when you write code in an .aspx page. To work around this problem, you can vary the commenting style a little. However, Microsoft recommends that you not start comment statements with the "//@" characters. Only use this format for preprocessor statements. The code that follows demonstrates how to use a version of the code from the "Symptoms" section that does not cause any errors. Also, this code includes two forms of JScript .NET conditional compilation to illustrate how JScript .NET preprocessor statements can appear with different comment statement types. STATUSThis behavior is by design. MORE INFORMATIONSteps to Reproduce the Behavior
REFERENCES
For more information about JScript .NET preprocessor directives, visit the following Microsoft Web site:
Comment Statements http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/jsstmcomment.asp (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/jsstmcomment.asp)
| Article Translations
|

Back to the top
