Click here to Skip to main content
15,913,610 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I am trying to comment on my html code and working with Visual Studio 2010 and asp.net 4.0. I can't seem to locate the correct syntax to comment my code, I have managed to do the CSS file fine but the same syntax wont work in the .aspx pages. I realise I am missing something blatantly obvious but after 3 days with no sleep things don't make much sense any more. :-(
Posted

Have a look here

http://htmlhelp.com/reference/wilbur/misc/comment.html[^]

So...

XML
<!-- this is some comment -->
<p>
    Put content here.
</p>
 
Share this answer
 
v2
<%-- <div>I will not rendered</div> --%>
 
Share this answer
 
HTML Comments look like this: <!-- comment --!>[^] and can span several lines.

Other types can be used, within Javascript (// coment[^], but only to end of line), or C# (similar to javascript but can be /* comment */ and span many lines) or VB (' Comment to end of line).

What types of comment is giving problems?
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Mar-11 15:48pm    
Sure, a 5.
--SA
One of the best way is to remember shortcut, Forget syntax :)

Below shortcuts work in code behind as well as in design mode for Visual Studio only.
So no need to remember different syntax, does not matter weather working with C# or VB

Comment code: Ctrl+K+C
UnComment code: Ctrl+K+U


Dont forget to Mark as Answer/Solution if it is helpful to you...
 
Share this answer
 
Comments
Pokar Satyam 9-Mar-11 6:31am    
Good one!
Let manage the syntax by studio.
Sergey Alexandrovich Kryukov 9-Mar-11 15:49pm    
Agree, makes sense, a 5 (but everyone should know the syntax well)
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900