Web.conf debug attribute creates different control naming conventions .NET 1.1

R

Roy Assaly

I had initially this question on Reporting Server, but I started to
think this has to do with ASP.NET.

I'm calling a web server on another server and passing parameters back
to it. When debug="true" in Web.config, everything works fine. If
debug="false", I can't pass that info back to the web service.

I then wrote a function that recusively goes through the control tree
and dumps all the control IDs, their type, and their value and I was
shocked to see the following!

When debug="true", my user control name is:

ASP.DatePicker_ascx

When debug="false", my user control name is:

_ASP.DatePicker_ascx

Note the additional underscore. I was generating dynamic controls and
so I needed to know if they are a DatePicker or a DropDownList, etc, in
order to properly access their data. Like this:

If c.ToString().Equals("ASP.DatePicker_ascx") Then
....

So I changed that line to


If c.ToString().EndsWith("ASP.DatePicker_ascx") Then
....

And everything worked in both Release and Debug mode. Weird. Is it
normal to have different names for control when using different debug
modes?!? Anyone?
 

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,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top