Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > colon or dollar

Reply
Thread Tools

colon or dollar

 
 
SP
Guest
Posts: n/a
 
      03-09-2007
I recently upgraded one of my ASPNET project from .NET Framework 1.1 to .NET
Framework 2.0

I have the following code overriding the CreateChildControls() method

Panel panel = new Panel();
panel.CssClass = "Panel1CSSClass";
Controls.Add(panel);

Table table = new Table();
table.CssClass = "Panel1Table";
panel.Controls.Add(table);

TableRow topRow = new TableRow();
topRow.CssClass = "PanelTopRow";
table.Rows.Add(topRow);
TableCell topCell = new TableCell();
topCell.CssClass = "PanelTopCell";
topRow.Cells.Add(topCell);

previously, when this code was run under .NET 1.1, the UniqueID generated
for these classes used to look something like PS1:_ctl0 for panel,
PS1:_ctl02 for the topRow, PS1:_ctl03 for topCell etc. whereas since
migrating to 2.0, the UniqueID gets generated as PS1$ctl01 for panel,
PS1$ctl02 for topRow and PS1$ctl03 for topCell

I tried searching on the internet to find where this has changed, or can it
be set somewhere.

Actually at some other place, my code uses this ID and strips individual
items based on the colon, is it safe to assume it will be $ in .NET
Framework 2.0

Any infor is appreciated,

Thanks,

--SP


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      03-10-2007
Yes it has changed and it is $ in Framework 2.0 You can get it back to be :
if you enable legacy rendering (set <xhtmlConformance mode="Legacy"/> in
web.config) or change IdSeparator on Page / Control

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net



"SP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I recently upgraded one of my ASPNET project from .NET Framework 1.1 to
>.NET Framework 2.0
>
> I have the following code overriding the CreateChildControls() method
>
> Panel panel = new Panel();
> panel.CssClass = "Panel1CSSClass";
> Controls.Add(panel);
>
> Table table = new Table();
> table.CssClass = "Panel1Table";
> panel.Controls.Add(table);
>
> TableRow topRow = new TableRow();
> topRow.CssClass = "PanelTopRow";
> table.Rows.Add(topRow);
> TableCell topCell = new TableCell();
> topCell.CssClass = "PanelTopCell";
> topRow.Cells.Add(topCell);
>
> previously, when this code was run under .NET 1.1, the UniqueID generated
> for these classes used to look something like PS1:_ctl0 for panel,
> PS1:_ctl02 for the topRow, PS1:_ctl03 for topCell etc. whereas since
> migrating to 2.0, the UniqueID gets generated as PS1$ctl01 for panel,
> PS1$ctl02 for topRow and PS1$ctl03 for topCell
>
> I tried searching on the internet to find where this has changed, or can
> it be set somewhere.
>
> Actually at some other place, my code uses this ID and strips individual
> items based on the colon, is it safe to assume it will be $ in .NET
> Framework 2.0
>
> Any infor is appreciated,
>
> Thanks,
>
> --SP
>


 
Reply With Quote
 
 
 
 
SP
Guest
Posts: n/a
 
      03-12-2007
Thanks Teemu,

Is it possible to get the DefaultIDSeparator in code somehow?
If possible then instead of doing MyFullID.SubString(s.LastIndexOf(":"))

i would like to get the separator character from the framework

TIA,

--SP

"Teemu Keiski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Yes it has changed and it is $ in Framework 2.0 You can get it back to be
> : if you enable legacy rendering (set <xhtmlConformance mode="Legacy"/> in
> web.config) or change IdSeparator on Page / Control
>
> --
> Teemu Keiski
> AspInsider, ASP.NET MVP
> http://blogs.aspadvice.com/joteke
> http://teemukeiski.net
>
>
>
> "SP" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I recently upgraded one of my ASPNET project from .NET Framework 1.1 to
>>.NET Framework 2.0
>>
>> I have the following code overriding the CreateChildControls() method
>>
>> Panel panel = new Panel();
>> panel.CssClass = "Panel1CSSClass";
>> Controls.Add(panel);
>>
>> Table table = new Table();
>> table.CssClass = "Panel1Table";
>> panel.Controls.Add(table);
>>
>> TableRow topRow = new TableRow();
>> topRow.CssClass = "PanelTopRow";
>> table.Rows.Add(topRow);
>> TableCell topCell = new TableCell();
>> topCell.CssClass = "PanelTopCell";
>> topRow.Cells.Add(topCell);
>>
>> previously, when this code was run under .NET 1.1, the UniqueID generated
>> for these classes used to look something like PS1:_ctl0 for panel,
>> PS1:_ctl02 for the topRow, PS1:_ctl03 for topCell etc. whereas since
>> migrating to 2.0, the UniqueID gets generated as PS1$ctl01 for panel,
>> PS1$ctl02 for topRow and PS1$ctl03 for topCell
>>
>> I tried searching on the internet to find where this has changed, or can
>> it be set somewhere.
>>
>> Actually at some other place, my code uses this ID and strips individual
>> items based on the colon, is it safe to assume it will be $ in .NET
>> Framework 2.0
>>
>> Any infor is appreciated,
>>
>> Thanks,
>>
>> --SP
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
ASP.NET: dollar sign ($) changed to undisplayable characters Norman Yuan ASP .Net 0 12-08-2005 11:17 PM
The Power Of One Dollar... Javier Sandobal ASP .Net 0 12-10-2004 05:50 PM
CISCO VPN3000 - Million Dollar Question Matthew Cisco 1 10-01-2004 04:56 AM
Division of Dollar value zzyzx Java 12 07-23-2004 08:35 AM
Euro Dollar Frustration - XSLT, ASP Iain Toft XML 2 07-20-2003 05:22 AM



Advertisments