Placing Comments in Aspx Pages

J

Joey

How do I place comments in aspx pages that are subscribed to master
pages?

This is going to be necessary as all source code pages must have
copyrights/author information etc...

When I attempt to do this with HTML comment tags i.e. <!-- my comments
-->, it doesn't work. The compiler throws errors: "Only Content
controls are allowed directly in a content page that contains Content
controls."

Surely there has to be a way to do this.....?

TIA
 
M

Mark Rae [MVP]

Surely there has to be a way to do this.....?

<asp:Content ID="cphContent" ContentPlaceHolderID="cphContent"
runat="server">
<!--
comments
-->
</asp:Content>
 
J

Joey

<asp:Content ID="cphContent" ContentPlaceHolderID="cphContent"
runat="server">
<!--
comments
-->
</asp:Content>

Yes I know. Sorry I guess I should have been a little more clear...the
comments need to be at the TOP of the page, before the opening Content
tag.
 
M

Mark Rae [MVP]

Yes I know. Sorry I guess I should have been a little more clear...the
comments need to be at the TOP of the page, before the opening Content
tag.

??? Why?
 
J

Joey


If each page is marked with copyright/author info at the top, it's
easier to identify. That just makes good sense to me. In my opinioni
Microsoft should allow for programmers to comment at the top of each
page of code, as this is something many people prefer to do. Oh well,
it's not a catastrophe. Thanks guys.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top