473,503 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing dynamically created controls from code-behind

Hello,

I am dynamically creating checkboxes on my web page based on data in a
SQL Server table. Therefore, these checkboxes do not exist at design
time and I cannot refer to them in my server-side code at design time.

Once the page is submitted, how can I access these checkboxes in my
code-behind?

Thanks for the help,

Steve
Nov 18 '05 #1
2 4410
You can use Request.Form["controlName"] to access them. this is for just
reading the value.

Av.

"Steve Black" <St*********@EagleCCI.com> wrote in message
news:7d**************************@posting.google.c om...
Hello,

I am dynamically creating checkboxes on my web page based on data in a
SQL Server table. Therefore, these checkboxes do not exist at design
time and I cannot refer to them in my server-side code at design time.

Once the page is submitted, how can I access these checkboxes in my
code-behind?

Thanks for the help,

Steve

Nov 18 '05 #2


I see. Thank you.

However, now I have a follow-up question. How can I access
dynamically-defined attributes of my radio button (I accidentally said
checkbox before but I meant radio button)?

I am creating my radio buttons as follows:

rdBtn = New RadioButton
With rdBtn
.ID = ....
.GroupName = "GroupName"
.Attributes.Add(Key1, Value1)
.Attributes.AdD(Key2, Value2)
End With

I then add this radio button (and many others with the same Group Name)
to the web page.

I see that when I submit the page and I try Request.Form("GroupName"), I
can get the ID of the selected radio button. However, I'm not sure how
to access the Attributes which are critical to my application.

Thanks again,

Steve

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1696
by: Jonathan Williams | last post by:
Hi, I have an object which inherits from WebControl (CUSTOM : WebControl) In this object I have code in which I add child contols: protected override void CreateChildControls() {...
6
2542
by: Earl Teigrob | last post by:
I am writing an application that dynamically loads user controls at run time based on user options. I would like to give my users the ability to build their own user controls and add them to my...
2
2909
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have...
1
2556
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web...
1
1369
by: drakuu | last post by:
All, I created dynamically part of a table and its components such as text boxes etc... As you can see in the example below I created txtAddress textbox... Everything works perfectly until the...
3
2854
by: keithb | last post by:
My code dynamically adds template fields to a GridView control. Everything seems to work OK, except when updating, because I haven't found a way to reference the dynamically added textboxes....
7
2119
by: =?Utf-8?B?Li46OiBLZXZpbiA6Oi4u?= | last post by:
I have a problem with accessing controls that I have loaded dynamically and added to a web page. The scenario: I have a webpage that displays multiple instances of a user control on the page. ...
1
1858
by: Grega | last post by:
Hi all, I am trying to create a VB smart device application. I create few buttons dynamically on form_load... something like this: Dim WithEvents BtnOperate As New...
1
1914
by: karthik25 | last post by:
Hi, The following code creates a tab container, 5 tab panels, buttons, labels. I was able to add event handlers to the button. But how am i supposed to access the dynamically created labels? For...
1
4870
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
0
7205
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
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7006
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
7467
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...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.