PC Review


Reply
Thread Tools Rating: Thread Rating: 5 votes, 4.20 average.

control name change in asp.net 2.0 generated html

 
 
n33470
Guest
Posts: n/a
 
      8th Dec 2005
Hi all,

We have a user control that contains a DropDownList. This user
control appears on a web page. Suppose the name of the userControl on
the web page is called "ucLookup". Suppose the name of the
dropDownList within the user control is called "cboList".

On my development PC running VS2005 on WinXP Pro, the rendered HTML for
the dropDownList looks like this:

<select name="ucLookup:cboList" id="ucLookup_cboList"
class="cboBodyNormal">

Notice that the name attribute contains a ':' (colon) between the
userControl name and the dropdownlist name.

On a production server running Windows Server 2003 and the .NET
framework installed from the redistributable, rather than from VS2005
(but still running the 2.0.50727 version), the rendered HTML is this:

<select name="ucLookup$cboList" id="ucLookup_cboList"
class="cboBodyNormal">

Notice now that there is '$' character in the name of the control.
Between the two environments, the only major difference I can think is
the OS (WinXP Pro vs Windows Server 2003), and that the .NET framework
on Windows Server box was installed from the redistributable, rather
than from VS2005

Has anyone noticed this before? Is there any kind of environment
setting that controls the separater character which is used here?

--steve

 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      8th Dec 2005
Steve:
I dung into it for you using reflector (you should try it out) and came to
this:

internal char IdSeparatorFromConfig
{
get
{
if (!this.EnableLegacyRendering)
{
return '$';
}
return ':';
}
}

as part of the control class


EnableLegacyRendering goes deeper, not 100% sure, but it seems like it might
be (a) config driven (do a google search for it and you'll find a few posts
about it from the Beta 2 days), or based on some other page properties.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


"n33470" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> We have a user control that contains a DropDownList. This user
> control appears on a web page. Suppose the name of the userControl on
> the web page is called "ucLookup". Suppose the name of the
> dropDownList within the user control is called "cboList".
>
> On my development PC running VS2005 on WinXP Pro, the rendered HTML for
> the dropDownList looks like this:
>
> <select name="ucLookup:cboList" id="ucLookup_cboList"
> class="cboBodyNormal">
>
> Notice that the name attribute contains a ':' (colon) between the
> userControl name and the dropdownlist name.
>
> On a production server running Windows Server 2003 and the .NET
> framework installed from the redistributable, rather than from VS2005
> (but still running the 2.0.50727 version), the rendered HTML is this:
>
> <select name="ucLookup$cboList" id="ucLookup_cboList"
> class="cboBodyNormal">
>
> Notice now that there is '$' character in the name of the control.
> Between the two environments, the only major difference I can think is
> the OS (WinXP Pro vs Windows Server 2003), and that the .NET framework
> on Windows Server box was installed from the redistributable, rather
> than from VS2005
>
> Has anyone noticed this before? Is there any kind of environment
> setting that controls the separater character which is used here?
>
> --steve
>



 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      8th Dec 2005
Just a bit more, based on
http://www.google.com/search?sourcei...tmlConformance

the default would be Transitional. Only when it's set to Legacy would I
expect it to use :

I realize this doesn't answer questions about the difference between your
two invironment, just hoping it'll let you find it out. Perhaps it's a
difference in the machine.config.

--
MY ASP.Net tutorials
http://www.openmymind.net/


"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eDdu0aD$(E-Mail Removed)...
> Steve:
> I dung into it for you using reflector (you should try it out) and came to
> this:
>
> internal char IdSeparatorFromConfig
> {
> get
> {
> if (!this.EnableLegacyRendering)
> {
> return '$';
> }
> return ':';
> }
> }
>
> as part of the control class
>
>
> EnableLegacyRendering goes deeper, not 100% sure, but it seems like it
> might be (a) config driven (do a google search for it and you'll find a
> few posts about it from the Beta 2 days), or based on some other page
> properties.
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
>
> "n33470" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi all,
>>
>> We have a user control that contains a DropDownList. This user
>> control appears on a web page. Suppose the name of the userControl on
>> the web page is called "ucLookup". Suppose the name of the
>> dropDownList within the user control is called "cboList".
>>
>> On my development PC running VS2005 on WinXP Pro, the rendered HTML for
>> the dropDownList looks like this:
>>
>> <select name="ucLookup:cboList" id="ucLookup_cboList"
>> class="cboBodyNormal">
>>
>> Notice that the name attribute contains a ':' (colon) between the
>> userControl name and the dropdownlist name.
>>
>> On a production server running Windows Server 2003 and the .NET
>> framework installed from the redistributable, rather than from VS2005
>> (but still running the 2.0.50727 version), the rendered HTML is this:
>>
>> <select name="ucLookup$cboList" id="ucLookup_cboList"
>> class="cboBodyNormal">
>>
>> Notice now that there is '$' character in the name of the control.
>> Between the two environments, the only major difference I can think is
>> the OS (WinXP Pro vs Windows Server 2003), and that the .NET framework
>> on Windows Server box was installed from the redistributable, rather
>> than from VS2005
>>
>> Has anyone noticed this before? Is there any kind of environment
>> setting that controls the separater character which is used here?
>>
>> --steve
>>

>
>



 
Reply With Quote
 
n33470
Guest
Posts: n/a
 
      8th Dec 2005
Karl,

Thanks for the info! Where is the property "EnableLegacyRendering"
implemented? In your code example, what is the context of 'this' in
the line of code: if (!this.EnableLegacyRendering)

The help docs for VS2005 do not mention this property, and there is
intellisense clue in either a derived UserControl, or Page class.

Where is that property implemented?

--steve

 
Reply With Quote
 
Karl Seguin
Guest
Posts: n/a
 
      9th Dec 2005
Steve:
My original email had all the details It's an internal property of the
Control class. That's why you don't see it in the docs/intellisense and
can't access it. It's only visible through a dissassembler such as
reflector. The only way to answer these questions is to get into the guts
of stuff.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!



"n33470" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Karl,
>
> Thanks for the info! Where is the property "EnableLegacyRendering"
> implemented? In your code example, what is the context of 'this' in
> the line of code: if (!this.EnableLegacyRendering)
>
> The help docs for VS2005 do not mention this property, and there is
> intellisense clue in either a derived UserControl, or Page class.
>
> Where is that property implemented?
>
> --steve
>



 
Reply With Quote
 
Bruce Barker
Guest
Posts: n/a
 
      9th Dec 2005
the change was done to make the names legal, colon are allowed in html
identifies but dollar signs are not. a colon in a id tags specifies a
namespace so ms uses a underscore.

it a bug in your code if you used the actual names (from viewing the source)
instead of the ClientId property to get it.

to get the 2003 behaviuor, set the XhtmlConformanceSection to legacy
(produce non-compliant xhtml)


-- bruce (sqlwork.com)




"n33470" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> We have a user control that contains a DropDownList. This user
> control appears on a web page. Suppose the name of the userControl on
> the web page is called "ucLookup". Suppose the name of the
> dropDownList within the user control is called "cboList".
>
> On my development PC running VS2005 on WinXP Pro, the rendered HTML for
> the dropDownList looks like this:
>
> <select name="ucLookup:cboList" id="ucLookup_cboList"
> class="cboBodyNormal">
>
> Notice that the name attribute contains a ':' (colon) between the
> userControl name and the dropdownlist name.
>
> On a production server running Windows Server 2003 and the .NET
> framework installed from the redistributable, rather than from VS2005
> (but still running the 2.0.50727 version), the rendered HTML is this:
>
> <select name="ucLookup$cboList" id="ucLookup_cboList"
> class="cboBodyNormal">
>
> Notice now that there is '$' character in the name of the control.
> Between the two environments, the only major difference I can think is
> the OS (WinXP Pro vs Windows Server 2003), and that the .NET framework
> on Windows Server box was installed from the redistributable, rather
> than from VS2005
>
> Has anyone noticed this before? Is there any kind of environment
> setting that controls the separater character which is used here?
>
> --steve
>



 
Reply With Quote
 
n33470
Guest
Posts: n/a
 
      9th Dec 2005
Bruce/Karl,

Thanks for the all the info!

This is not an issue with the use of ClientId, the error presented
itself as an issue with the Request.Forms variables posted back from
the web browser. Because the name attribute of the html tags is formed
differently amongst the xhtmlConformance mode settings, the posted
variable collection in Request.Forms had different contents. A
secondary issue that was corrected by this is that we have a huge
library of reusable testing scripts that do automated testing. The
automated test scripts use the rendered html for verification, and
because most of the tags rendered differently, it broke some of the
test scripts.

The following web.config setting fixed up the problems.

<xhtmlConformance mode="Legacy">

This setting was present on my development server because the ASP.NET
conversion wizard added it automatically to my web.config. However,
the setting was missing on the production server. The default
conformance mode, when there is no setting in the web.config, is
"Transitional".

Thanks again!

--steve

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I reveerse name order last name, first name to first name, last name Don Smith Microsoft Excel Discussion 9 29th Nov 2006 10:55 PM
Visual Studio 2005 html-view does not recognize the generated html-tag of a custom control Rolf Welskes Microsoft ASP .NET 3 6th Oct 2006 07:49 PM
The application, C:\WINDOWS\system32\lsass.exe, generated an application error The error occurred on 05/03/2004 @ 10:50:46.755 The exception generated was c0000005 at address 00900090 () =?Utf-8?B?cmljayBj?= Windows XP General 2 5th May 2004 03:36 AM
HTML Client Control versus. HTML Server Control versus. Web Server Control Matthew Louden Microsoft VB .NET 1 11th Oct 2003 08:09 PM
HTML Client Control versus. HTML Server Control versus. Web Server Control Matthew Louden Microsoft ASP .NET 1 11th Oct 2003 08:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:20 AM.