DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 14 Aug 2007 18:30:37 -0000,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    unknown
          2    Teemu Keiski
          3    unknown


including comments in ASPX code that don't render to the client? (c# 2.0)   
In .NET 2.0, is there any way to include comments in the aspx file
that do not get rendered to the client (ie no <!-- -->) ?

When I try to include C# comments in a code block in an aspx page,
like this:

	<%
	// *******************************************************
	// CHANGE HISTORY:
	// DATE             USER        CHANGE
	// 08/14/2007 Tue   ebloom      updated logo
	// *******************************************************
	%>

I am getting an error

	The Controls collection cannot be modified because the control
contains code blocks (i.e. <% ... %>).

It would seem this is because .NET doesn't like inline code (even
though it isn't really "code" we want to include, just comments).

Including these comments in the codebehind is not preferred because
the changes are specific to the ASPX page. Our site has multiple
versions of a given aspx for each language, ie

	/en/mypage.aspx
	/de/mypage.aspx
	etc.

and the codebehind is stored in

	/common/mypage.aspx.cs

Any help appreciated, thanks...
Date:Tue, 14 Aug 2007 18:30:37 -0000   Author:  

Re: including comments in ASPX code that don't render to the client? (c# 2.0)   
Hi,

<%--
Everything here is a comment
--%>

So basically in <%-- --%>

-- 
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

 wrote in message 
news:1187116237.144990.301740@o61g2000hsh.googlegroups.com...

> In .NET 2.0, is there any way to include comments in the aspx file
> that do not get rendered to the client (ie no <!-- -->) ?
>
> When I try to include C# comments in a code block in an aspx page,
> like this:
>
> <%
> // *******************************************************
> // CHANGE HISTORY:
> // DATE             USER        CHANGE
> // 08/14/2007 Tue   ebloom      updated logo
> // *******************************************************
> %>
>
> I am getting an error
>
> The Controls collection cannot be modified because the control
> contains code blocks (i.e. <% ... %>).
>
> It would seem this is because .NET doesn't like inline code (even
> though it isn't really "code" we want to include, just comments).
>
> Including these comments in the codebehind is not preferred because
> the changes are specific to the ASPX page. Our site has multiple
> versions of a given aspx for each language, ie
>
> /en/mypage.aspx
> /de/mypage.aspx
> etc.
>
> and the codebehind is stored in
>
> /common/mypage.aspx.cs
>
> Any help appreciated, thanks...
> 
Date:Tue, 14 Aug 2007 21:48:29 +0300   Author:  

Re: including comments in ASPX code that don't render to the client? (c# 2.0)   
Aha - thanks!

PS I found more info on that here:

Tip/Trick: Using Server Side Comments with ASP.NET 2.0
http://weblogs.asp.net/scottgu/archive/2006/07/09/Tip_2F00_Trick_3A00_-Using-Server-Side-Comments-with-ASP.NET-2.0-.aspx


On Aug 14, 2:48 pm, "Teemu Keiski"  wrote:

> Hi,
>
> <%--
> Everything here is a comment
> --%>
>
> So basically in <%-- --%>
>
> --
> Teemu Keiski
> AspInsider, ASP.NET MVPhttp://blogs.aspadvice.com/jotekehttp://teemukeiski.net
>
>  wrote in message
>
> news:1187116237.144990.301740@o61g2000hsh.googlegroups.com...
>
> > In .NET 2.0, is there any way to include comments in the aspx file
> > that do not get rendered to the client (ie no <!-- -->) ?
>
> > When I try to include C# comments in a code block in an aspx page,
> > like this:
>
> > <%
> > // *******************************************************
> > // CHANGE HISTORY:
> > // DATE             USER        CHANGE
> > // 08/14/2007 Tue   ebloom      updated logo
> > // *******************************************************
> > %>
>
> > I am getting an error
>
> > The Controls collection cannot be modified because the control
> > contains code blocks (i.e. <% ... %>).
>
> > It would seem this is because .NET doesn't like inline code (even
> > though it isn't really "code" we want to include, just comments).
>
> > Including these comments in the codebehind is not preferred because
> > the changes are specific to the ASPX page. Our site has multiple
> > versions of a given aspx for each language, ie
>
> > /en/mypage.aspx
> > /de/mypage.aspx
> > etc.
>
> > and the codebehind is stored in
>
> > /common/mypage.aspx.cs
>
> > Any help appreciated, thanks...
Date:Tue, 14 Aug 2007 18:58:12 -0000   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us