Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Control's Name set at design time, retrived at runtme

Reply
Thread Tools

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

 
 
CsaaGuy
Guest
Posts: n/a
 
      07-19-2005
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.

 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      07-19-2005
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.
>




 
Reply With Quote
 
 
 
 
CsaaGuy
Guest
Posts: n/a
 
      07-20-2005
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.
> >


 
Reply With Quote
 
Brock Allen
Guest
Posts: n/a
 
      07-20-2005
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.
>>>




 
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
Runtme controls =?Utf-8?B?Z3V5?= ASP .Net 3 10-28-2007 10:57 AM
How/Where the OldValuesParameters is retrived from? SupaJay ASP .Net Datagrid Control 0 09-08-2006 07:59 PM
print("my name is {name}, and {age}-year old {gender}", name, age, gender); =?iso-8859-1?B?bW9vcJk=?= Java 7 01-02-2006 04:39 PM
No records retrived..? Kent Johnson ASP .Net 5 10-27-2003 08:19 PM
Re: Urgent! how to get object name, method name and attribute name based on the strings? ding feng C++ 2 06-25-2003 01:18 PM



Advertisments