Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CsaaGuy - 19 Jul 2005 23:23 GMT
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 - 20 Jul 2005 00:09 GMT
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
[quoted text clipped - 3 lines]
> this to tell the viewstate which version of the control's property is
> being save/retrieved. Thanks.
CsaaGuy - 20 Jul 2005 05:18 GMT
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.

> 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
[quoted text clipped - 11 lines]
> > this to tell the viewstate which version of the control's property is
> > being save/retrieved. Thanks.
Brock Allen - 20 Jul 2005 15:05 GMT
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
[quoted text clipped - 18 lines]
>>> need this to tell the viewstate which version of the control's
>>> property is being save/retrieved. Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.