2.0 simple problem: comment is parsed by compiler

R

R.A.M.

Hello,
(Sorry for my English, it's not my native language...)
Could you explain me simple problem? I have little experience.

I commented part of .aspx page and tried to rebuild the project.
Unfortunately I receive errors in commented asp: elements, for
example:
'ASP.formularzewww_aspx' does not contain a definition for
'Calendar_Click'
Here is part of commented page:
<!--
Date of birth:
<asp:TextBox ID="BirthDate" runat="server" />
<asp:Button ID="Calendar" runat="server"
Text="Calendar"
OnClick="Kalendarz_Click" />
...
I don't understand why commented text is parsed by .NET compiler.
Could you explain me please?

Thank you very much.
/RAM/
 
T

Teemu Keiski

<! --

-->

is client-side comment syntax and therefore has no impact on server-side
processing. It's browser that understands this.

In case you want to comment server-side markup use server-side comment
syntax

<%--

--%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top