colon or dollar

Discussion in 'ASP .Net Web Controls' started by SP, Mar 9, 2007.

  1. SP

    SP Guest

    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
    SP, Mar 9, 2007
    #1
    1. Advertising

  2. SP

    Teemu Keiski Guest

    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" <> wrote in message
    news:...
    >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
    >
    Teemu Keiski, Mar 10, 2007
    #2
    1. Advertising

  3. SP

    SP Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    >>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
    >>

    >
    SP, Mar 12, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Javier Sandobal

    The Power Of One Dollar...

    Javier Sandobal, Dec 10, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    728
    Javier Sandobal
    Dec 10, 2004
  2. Norman Yuan
    Replies:
    0
    Views:
    858
    Norman Yuan
    Dec 8, 2005
  3. zzyzx

    Division of Dollar value

    zzyzx, Jul 22, 2004, in forum: Java
    Replies:
    12
    Views:
    1,402
    Michael Borgwardt
    Jul 23, 2004
  4. Iain Toft
    Replies:
    2
    Views:
    4,191
    Chris Lovett
    Jul 20, 2003
  5. Iain Toft
    Replies:
    4
    Views:
    1,703
    Mark Preston
    Jul 20, 2003
Loading...

Share This Page