Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Commenting in .aspx

What is the correct way to comment inside an .aspx file?

The HTML syntax for a comment:

<!-- [COMMENT] --> 

This doesn't work, I get the following: "ASP.NET runtime error:Only Content controls are allowed directly in a content page that contains Content controls."

I have also tried ', //, #, and --

like image 399
Jaiesh_bhai Avatar asked Sep 16 '13 19:09

Jaiesh_bhai


People also ask

How do I comment in asp net visual studio?

FYI | ctrl + K , C is the comment shortcut in Visual Studio.

How do I comment in ASCX?

-- and -->.

How do you comment out in asp net HTML?

aspx page, and then clicking the “comment” command button that is on HTML Source Editor Toolbar: This will automatically wrap the selected content with a <%-- --%> block. You can likewise move the cursor within it and click the uncomment command to remove the comment.


1 Answers

Direct entry:

  • <%-- your comment --%>

Visual Studio:

  • comment & un-comment buttons on the toolbar
  • CTRL+KC (comment)
  • CTRL+KU (un-comment)
like image 93
Chains Avatar answered Oct 04 '22 08:10

Chains