473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
3 1358
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark Broadbent | last post by:
In VB6 (using visual studio) it was possible to create a control array at design time by simply adding the control (e.g. textbox) and renaming it to what would become the first element e.g. ...
17
by: No One | last post by:
Is there a way to keep a control centered inside a form without having to recalculate everytime the form is resized?
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
7
by: BradC | last post by:
(VB.NET 2002, Windows app). I'm going to be provided a two-letter string like "BV" or "TP" that represents a location. I then need to perform some actions on several form controls that have...
0
by: Brian Young | last post by:
Hi all. I'm using the Property Grid control in a control to manage a windows service we have developed here. The windows service runs a set of other jobs that need to be managed. The control...
0
by: Umut Tezduyar | last post by:
I really hate working with .net framework design time attributes. I have read asp.net server controls and components (Nikhil Kothari, Vandana Datye) book, chapter 15 but still i can't handle the...
0
by: Jeremy Chapman | last post by:
I have included below virtually all the code to a control I'm trying to build. My issue is that an array list property in my control does not get persisted properly to the aspx page code in design...
11
by: Rimpinths | last post by:
I'm new at developing user controls in C#, and one thing I've noticed right off the bat is that the constructor gets called twice -- once at design time, once at run time. In short, I'm trying...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.