CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Commenting

  1. #1
    Join Date
    Dec 2001
    Location
    UK
    Posts
    308

    Commenting

    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:
    Code:
    <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)%>
    Last edited by bharadwajrv; May 22nd, 2007 at 08:29 AM.
    Venu Bharadwaj
    "Dream it. U can do it!"

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Commenting

    I dont follow you...

    Anything inside "<!-- -->" in your aspx/ascx files will be treated as a comment......
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Commenting

    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
    Code:
    <%--<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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured