Search code examples
asp.netparse-error

Unexpected end of file looking for </form> tag


i put a comment in my aspx page inside javascript tag which said

//add back to <form> tag

And I promptly got a .NET parser error

Unexpected end of file looking for </form> tag.

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

It's very strange that it considered a js comment as a tag... Any ideas why?


Solution

  • Don't use < or >. Use XML entities instead:

    //add back to &lt;form&gt; tag
    

    As alternative, use the asp.net comment tag:

    <!-- // comment here -->