By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,053 Members | 1,615 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,053 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.

Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.


Nov 19 '05 #2

P: n/a
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.


Nov 19 '05 #3

P: n/a
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.


Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.