RSS 2.0 Feed
RSS 2.0


Atom 1.0 Feed
Atom 1.0

  Commenting out ASP.NET Server Controls 

I guess I don't need to do this frequent enough to remember this because I always seem to forget. To comment out a server control from your aspx page you cannot use <!-- and -->. Obviously, this is a server control, so you use server side comments:

<%-- <asp:Button runat=server id=button1></asp:Button> --%>




                   



Leave a comment below.

Comments

  1. Joe Gakenheimer 8/16/2005 5:00 AM
    Gravatar
    Same here, I forget how to do it, yet you guys were the only place on the net that I found with this info.
  2. Gray Raven 3/29/2006 9:10 AM
    Gravatar

    I'm curious, though. What if it's a complex control that has DataBinder.Eval statements in it (which use the '<%' syntax )??
  3. Aron 7/13/2006 7:34 AM
    Gravatar
    The %> does actually stop the comment. You can put a space between the % and the > and that makes it not notice the tag, but that is sorta a bummer. I think it should just keep on trucking till it sees --%> not just "%>".
    I guess "you can't always get what you want."
  4. Adam 12/6/2006 4:59 PM
    Gravatar
    Thanks for putting this up on the net. Chalk up another "duh" moment for me. Found you via Google.

Leave a comment

Please be polite and on topic. Your e-mail will never be published.

Please add 4 and 7 and type the answer here:



 

News


Also see my CRM Developer blog

Connect:            

Sponsor

Sections