473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Comment

If I try to comment some fields with <!--:

<!--<asp:TemplateColumn>
<HeaderTemplate>
<asp:Button ID="btnNew" CommandName="newType" Text="New Type" Runat="server"></asp:Button>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton text="DELETE" Visible='<%# Container.DataItem( "brisi" ) %>' CommandName="Delete" CommandArgument='<%# Container.DataItem( "mType_id" ) %>' Runat="server" ID="Linkbutton1"/>
</ItemTemplate>
</asp:TemplateColumn>-->

i get an error message:

Literal content ('<!--') is not allowed within a 'System.Web.UI.WebControls.DataGridColumnCollectio n'.
Any solution?

thank you,
Simon
Nov 18 '05 #1
2 1252
It's important to understand the order of processing. <!--asp:TemplateColumn... is processed by the asp.net engine on the server side...and indeed <!-- is invalid asp.net code..

in normal HTML, when you do <!-- it sends it out to the browser and the browser choses not to display it (but you can still see the code via view source).

instead, try:

<asp:TemplateColumn visible="false">
....
</asp:..>

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"simon" <si*********@stud-moderna.si> wrote in message news:Os**************@TK2MSFTNGP09.phx.gbl...
If I try to comment some fields with <!--:

<!--<asp:TemplateColumn>
<HeaderTemplate>
<asp:Button ID="btnNew" CommandName="newType" Text="New Type" Runat="server"></asp:Button>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton text="DELETE" Visible='<%# Container.DataItem( "brisi" ) %>' CommandName="Delete" CommandArgument='<%# Container.DataItem( "mType_id" ) %>' Runat="server" ID="Linkbutton1"/>
</ItemTemplate>
</asp:TemplateColumn>-->

i get an error message:

Literal content ('<!--') is not allowed within a 'System.Web.UI.WebControls.DataGridColumnCollectio n'.
Any solution?

thank you,
Simon
Nov 18 '05 #2
Just saw the other day somebody suggesting using <%-- and --%> with server controls. Never tried it myself.

Greg
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:OL**************@TK2MSFTNGP09.phx.gbl...
It's important to understand the order of processing. <!--asp:TemplateColumn... is processed by the asp.net engine on the server side...and indeed <!-- is invalid asp.net code..

in normal HTML, when you do <!-- it sends it out to the browser and the browser choses not to display it (but you can still see the code via view source).

instead, try:

<asp:TemplateColumn visible="false">
...
</asp:..>

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"simon" <si*********@stud-moderna.si> wrote in message news:Os**************@TK2MSFTNGP09.phx.gbl...
If I try to comment some fields with <!--:

<!--<asp:TemplateColumn>
<HeaderTemplate>
<asp:Button ID="btnNew" CommandName="newType" Text="New Type" Runat="server"></asp:Button>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton text="DELETE" Visible='<%# Container.DataItem( "brisi" ) %>' CommandName="Delete" CommandArgument='<%# Container.DataItem( "mType_id" ) %>' Runat="server" ID="Linkbutton1"/>
</ItemTemplate>
</asp:TemplateColumn>-->

i get an error message:

Literal content ('<!--') is not allowed within a 'System.Web.UI.WebControls.DataGridColumnCollectio n'.
Any solution?

thank you,
Simon
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rob | last post by:
Hello all, If I have the following code fragment: /* comment bla bla */ ....code... With a regular expression, how do I get/extract the comment inside this multi line comment block. With...
15
by: Riko Wichmann | last post by:
Dear all, is there a way in Python to comment out blocks of code without putting a # in front of each line? Somethings like C's /* block of code here is commented out */ Thanks,
2
by: Richard | last post by:
Hi, I downloaded a sample form from formsplayer.com, extracted the source code and made some simple (I thought) mods. I added the comments before the html tag and the comments on the namespace...
0
by: dixie | last post by:
I have a form where, if a button is clicked (on), I want the current comment in a form control to remain behind when I click the New Record button. I have a retainer button called CommentRetainer...
6
by: cdrsir | last post by:
we can use 1) // my comments a 2) /* my comments b */ when we want to add some comments. I know some compilers just support the 2nd syntax, but normally both of these 2 syntaxs are supported...
0
by: karen987 | last post by:
Could someone please tell me what code to add here? I have a weblog, with daily news which readers can add comments to, which are stored in a database. The form to add the comments is on an ASP page,...
5
helimeef
by: helimeef | last post by:
I designed a little PHP/MySQL forum (just for fun), and I have commenting set up and top threads on the homepage and whatnot. I'm relatively new to PHP, and this is the biggest project I've done, but...
14
by: daskumardilip | last post by:
how to remove comment from c source code.
14
by: Siv | last post by:
Hi, Just busily coding away and removed a procedure from my code and all of a sudden an error came up miles away from the location of the piece of code I removed and it relates to the XML...
39
by: polas | last post by:
Afternoon all. I was just wondering about this point - I have (generally) used // for commenting a single line in C, but from looking at code other people have written it seems many use /* */...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.