Why did the name of a control changed?

Discussion in 'ASP .Net' started by Fabian, Sep 9, 2004.

  1. Fabian

    Fabian Guest

    Hi,

    I work with MasterPages in ASP.NET 2.0.
    In codebehind I create a dynamic control and with name "CatId". But after
    the creation the name is changed to "ctl00$Main$CatId".
    Therefore I can´t serach by the name of the control, but I need this.
    What I must do, that this not take place?

    Fabian
     
    Fabian, Sep 9, 2004
    #1
    1. Advertising

  2. Fabian

    Karl Guest

    This is no different than in ASP.Net 1.0, the UniqueId or ClientId of a
    control is based on the hierarchy the control is placed in.

    Your control, CatId is added to a contentplaceholder which is part of a
    master page.

    Your masterpage is ctl00
    your contentplaceholder is Main
    and your control is CatId

    However, I agree with you that CatId should be accessible from the Page as
    simply "CatId" which it doesn't appear to be.
    Have you looked through the feedback site for any similiar reports?

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


    "Fabian" <> wrote in message
    news:...
    > Hi,
    >
    > I work with MasterPages in ASP.NET 2.0.
    > In codebehind I create a dynamic control and with name "CatId". But after
    > the creation the name is changed to "ctl00$Main$CatId".
    > Therefore I can´t serach by the name of the control, but I need this.
    > What I must do, that this not take place?
    >
    > Fabian
    >
    >
     
    Karl, Sep 9, 2004
    #2
    1. Advertising

  3. Fabian

    Fabian Guest

    Thanks for Answer,

    in the same page I can access the control. But I want to access the value in
    the next page with this method: PreviousPage.FindControl ("CatId")

    What can I do?
    Or is there an other way to transfer the object?


    "Karl" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> schrieb im
    Newsbeitrag news:...
    > This is no different than in ASP.Net 1.0, the UniqueId or ClientId of a
    > control is based on the hierarchy the control is placed in.
    >
    > Your control, CatId is added to a contentplaceholder which is part of a
    > master page.
    >
    > Your masterpage is ctl00
    > your contentplaceholder is Main
    > and your control is CatId
    >
    > However, I agree with you that CatId should be accessible from the Page as
    > simply "CatId" which it doesn't appear to be.
    > Have you looked through the feedback site for any similiar reports?
    >
    > Karl
    > --
    > MY ASP.Net tutorials
    > http://www.openmymind.net/
    >
    >
    > "Fabian" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I work with MasterPages in ASP.NET 2.0.
    > > In codebehind I create a dynamic control and with name "CatId". But

    after
    > > the creation the name is changed to "ctl00$Main$CatId".
    > > Therefore I can´t serach by the name of the control, but I need this.
    > > What I must do, that this not take place?
    > >
    > > Fabian
    > >
    > >

    >
    >
     
    Fabian, Sep 9, 2004
    #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. Replies:
    1
    Views:
    734
    Rosanne
    Oct 11, 2005
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    974
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,213
    Smokey Grindel
    Dec 2, 2006
  4. Daniel Waite
    Replies:
    2
    Views:
    247
    Daniel Waite
    May 2, 2008
  5. mxbrunet
    Replies:
    1
    Views:
    242
Loading...

Share This Page