473,794 Members | 2,754 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "ControlToValid ate". 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 1110
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*******@nosp am.com> wrote in message
news:Xn******** *************** **********@207. 46.248.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 "ControlToValid ate". 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
2621
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 (that part's not here -- spotlighting the problem code): --------BEGIN CODE PAGE------------ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
24
2291
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 structure when something hit me and I wrote: // Function returns the greater or lesser numbers of two given numbers, // specified by a flag: 1 for greater (default), 0 for lesser
3
1685
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 below, the code works okay. Otherwise, it will goes to seg fault. I am puzzled on this. Can anybody give me any hints?
4
1254
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
1126
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 tried removing the commented part completely but still getting an error message that there is an error at the line after the last line of the code.Can you please suggest me what could be the possible reason for this. Thanks in advance, Shara.
3
4288
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 commented out code on an event stub. The After Update stub was written but the one line piece of code was commented out.
11
4024
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 way. DateTime d = DateTime.Now; string datecodemonth = d.ToString("MM"); datecodemonth = datecodemonth + datecodemonth; string datecodeday = d.ToString("dd"); datecodeday = datecodeday + datecodeday;
2
1801
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 and only show the non-commented strings Here is an example of the data that I am working with /* select * from db2 */
3
1333
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 referenced the deleted control, so the commented function looks like this: /* function MyFunction() {
0
10433
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10212
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9035
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.