Control's Name set at design time, retrived at runtme

Discussion in 'ASP .Net' started by CsaaGuy, Jul 19, 2005.

  1. CsaaGuy

    CsaaGuy Guest

    Hi, i created a class that i have showing up at design time and i have
    to save some of the properties to the viewstate at runtime. It all
    works fine, however the issue is if i have more that one version of the
    this control on the form (which is possible) I don't know how to get
    ahold of the name property that was set at design time. I need this to
    tell the viewstate which version of the control's property is being
    save/retrieved. Thanks.
    CsaaGuy, Jul 19, 2005
    #1
    1. Advertising

  2. CsaaGuy

    Brock Allen Guest

    I can't quite tell what situation you're talking about, but if you have a
    reference to a server-side control at runtime, you can use the ClientID property
    to determine what the ID will be rendered as in the client.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > Hi, i created a class that i have showing up at design time and i have
    > to save some of the properties to the viewstate at runtime. It all
    > works fine, however the issue is if i have more that one version of
    > the this control on the form (which is possible) I don't know how to
    > get ahold of the name property that was set at design time. I need
    > this to tell the viewstate which version of the control's property is
    > being save/retrieved. Thanks.
    >
    Brock Allen, Jul 20, 2005
    #2
    1. Advertising

  3. CsaaGuy

    CsaaGuy Guest

    I check all the ID type properties and they are all nothing. In the
    property window is the name of the control but at run time there is no
    name property. The ID and ClientID properties are set to nothing. This
    is a class i wrote myself and is not inheiring anything. Its working as
    designed except for the in ability to retrive the name at runtime.
    Thanks for you response.

    Brock Allen wrote:
    > I can't quite tell what situation you're talking about, but if you have a
    > reference to a server-side control at runtime, you can use the ClientID property
    > to determine what the ID will be rendered as in the client.
    >
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    >
    >
    > > Hi, i created a class that i have showing up at design time and i have
    > > to save some of the properties to the viewstate at runtime. It all
    > > works fine, however the issue is if i have more that one version of
    > > the this control on the form (which is possible) I don't know how to
    > > get ahold of the name property that was set at design time. I need
    > > this to tell the viewstate which version of the control's property is
    > > being save/retrieved. Thanks.
    > >
    CsaaGuy, Jul 20, 2005
    #3
  4. CsaaGuy

    Brock Allen Guest

    Maybe it's time to post a small snippet of your class' code to illustrate
    the problem.

    I just reread your post, and maybe your question could be rephrased as this:

    I have a custom control saving data in ViewState using an ID such as "Text".
    If I have 2 of these on the page, will those "Text" IDs in ViewState conflict?

    If this is your question, then the answer is "no" they won't conflict. Each
    control on the page has its own private ViewState collection to use and index
    into however it wants to.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > I check all the ID type properties and they are all nothing. In the
    > property window is the name of the control but at run time there is no
    > name property. The ID and ClientID properties are set to nothing. This
    > is a class i wrote myself and is not inheiring anything. Its working
    > as designed except for the in ability to retrive the name at runtime.
    > Thanks for you response.
    >
    > Brock Allen wrote:
    >
    >> I can't quite tell what situation you're talking about, but if you
    >> have a reference to a server-side control at runtime, you can use the
    >> ClientID property to determine what the ID will be rendered as in the
    >> client.
    >>
    >> -Brock
    >> DevelopMentor
    >> http://staff.develop.com/ballen
    >>> Hi, i created a class that i have showing up at design time and i
    >>> have to save some of the properties to the viewstate at runtime. It
    >>> all works fine, however the issue is if i have more that one version
    >>> of the this control on the form (which is possible) I don't know how
    >>> to get ahold of the name property that was set at design time. I
    >>> need this to tell the viewstate which version of the control's
    >>> property is being save/retrieved. Thanks.
    >>>
    Brock Allen, Jul 20, 2005
    #4
    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:
    0
    Views:
    716
  2. Kent Johnson

    No records retrived..?

    Kent Johnson, Oct 24, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    393
    Kent Johnson
    Oct 27, 2003
  3. =?Utf-8?B?Z3V5?=

    Runtme controls

    =?Utf-8?B?Z3V5?=, Oct 27, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    328
    Phil H
    Oct 28, 2007
  4. Replies:
    1
    Views:
    370
    Teemu Keiski
    Jul 2, 2003
  5. SupaJay

    How/Where the OldValuesParameters is retrived from?

    SupaJay, Sep 8, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    161
    SupaJay
    Sep 8, 2006
Loading...

Share This Page