473,406 Members | 2,894 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.

Commented Code Not Treated As Commented Code

Hello, I thought I was loosing my mind. I had a page which was working
perfectly fine until I decided to try to add a control to a footer line in
code. So I took the Validation control which was embedded in my .aspx file
and moved it to the very bottom of the page and placed the "<!--" prior to
beginning of the <asp:... and then I placed a "-->" after the closing tag
of my control. Just want to ensure that I could add it in code first prior
to completly removing the control.

Every time I ran, I would get an unhandled exception indicating that the it
could not find the control referenced in my "ControlToValidate". So I
commented out the code which was adding the control in code and ran again.
But again, I would get the same error.

Then I removed my "Commented" code and it ran just fine.

Why is ASP trying to do anything with the line which is surrounded by the
"comment" characters?

Example:

<!--
<asp:.....
-->
Nov 18 '05 #1
1 1097
That is client-side commenting, it is ignored with server side code. You
need to use server-side comments:

<%-- <asp:label runat="server" /> --%>

Hope this helps,

- Oisin

"Jim Heavey" <Ji*******@nospam.com> wrote in message
news:Xn*********************************@207.46.24 8.16...
Hello, I thought I was loosing my mind. I had a page which was working
perfectly fine until I decided to try to add a control to a footer line in
code. So I took the Validation control which was embedded in my .aspx file and moved it to the very bottom of the page and placed the "<!--" prior to
beginning of the <asp:... and then I placed a "-->" after the closing tag
of my control. Just want to ensure that I could add it in code first prior to completly removing the control.

Every time I ran, I would get an unhandled exception indicating that the it could not find the control referenced in my "ControlToValidate". So I
commented out the code which was adding the control in code and ran again.
But again, I would get the same error.

Then I removed my "Commented" code and it ran just fine.

Why is ASP trying to do anything with the line which is surrounded by the
"comment" characters?

Example:

<!--
<asp:.....
-->

Nov 18 '05 #2

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

Similar topics

14
by: Akbar | last post by:
Hey there, Big-time curiosity issue here... Here's the test code (it's not that long)... it's to display a large number of image links with captions, ideally pulled in from an external file...
24
by: Gaijinco | last post by:
I found one of that problems all of us have solve when they begin programming: given 3 numbers print the greater and the lesser one of the set. I was trying to remember the if-then-else...
3
by: Andy | last post by:
Hello, everyone, I am writing a segment of code for listing the permutation of some event sequences. I tried to use template to make the code more general. When I commented the code as shown...
4
by: John Salerno | last post by:
Here's my code, with the error following it: props = group1 = group2 = group3 = group4 = # Submitter: Michael Davies def all_perms(str):
1
by: shara | last post by:
Hello there, Can anybody please help me with this.I've a php code in which i've commneted certain part of the code .But still i'm getting a message that there is an error in that commented part.I...
3
by: christianlott1 | last post by:
I wouldn't have brought this up except that a friend had a similar problem as well. Situation: Code works fine for months, then suddenly breaks. In my case the code broke on a piece of...
11
by: Dan Holmes | last post by:
I have a need to reverse a date to show as a "date code". For example today, 090507 would be coded as 905070 (reversing the parts of the date. This is what i have but there has to be a better...
2
by: tawright915 | last post by:
Ok so here is my regex (--.*\n|/\*(.|\n)*?\*/). It finds all comments just fine. However I want it to return to me all strings that are not commented out. Is there a way to exclude the comments...
3
by: =?Utf-8?B?UmljaGFyZA==?= | last post by:
Hi, I removed some functionality from an ASP.NET 2 webpage by deleting the input ior textbox control from the page's code. Then I commented out the JavaScript function on the same page that...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.