Click to See Complete Forum and Search --> : Commenting


bharadwajrv
May 22nd, 2007, 09:27 AM
i know it looks it is a silly question, but really i'm struggling to comment my ASP.net codes (in HTML mode) {not the code-behind syntax)...

Since it is "Runat = Server" is used, commenting using "<!-- -->" has no effect..

any idea, how to comment the ASP HTML code...

Thanks in adv..

Sample code i need to commant is below:


<asp:DataGrid id="DataGrid1" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 56px" runat="server"
Height="40px" Width="328px"></asp:DataGrid>

or

<%# (Container.DataItem)%>

TheCPUWizard
May 22nd, 2007, 09:44 AM
I dont follow you...

Anything inside "<!-- -->" in your aspx/ascx files will be treated as a comment......

Shuja Ali
May 22nd, 2007, 10:02 AM
Actually these comments won't work in ASPX files. They never did work in Classic ASP also. Although you comment, they actually get rendered on the client side.

The proper way of commenting would be <%--<asp:DataGrid id="DataGrid1" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 56px" runat="server"
Height="40px" Width="328px"></asp:DataGrid>--%>This type of commenting is known as Server Side comments.