473,614 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieving values from dynamic controls

I have dynamically created n number of text boxes in a form like txtQL(1),
txtQL(2) , ...txtQL(n)
How I retrieve the values in a loop? I'm confused as to how to approach
this! Please help.

Thanks for your time.
Jul 21 '05 #1
1 1295
I get the error "Referenced object has a value of 'Nothing'". as indicated in
the code below:

For Each c In Controls
If i < maxRow Then
Error txtQLLink(i) = c.FindControl(" txtQLLink(" + i & ")")

txtQLUrl(i) = c.FindControl(" txtQlUrl(" + i & ")")
If txtQLLink(i).Te xt <> "" Then
textQLHtml = textQLHtml & txtQLUrl(i).Tex t & txtQLLink(i).Te xt
strQL = strQL & txtQLLink(i).Te xt & "," & txtQLUrl(i).Tex t
i += 1
End If
End If
Next
I created the controls dynamically! But cant seem to figure out how to
retrieve it dynamically?!! Please help.
Jul 21 '05 #2

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

Similar topics

1
1274
by: tascien | last post by:
I have a user control that has dynamic controls loaded to it in Page_Init. this works well. I have a function inside the user control: GetValues() When i add this usercontrol to a page: test.aspx and i call GetValues(), it returns me the values of the dynamically added controls correctly.
2
2932
by: Ben Amada | last post by:
I'm a little confused about in what Event should I add dynamic controls and in what Event should I retrieve the value of a dynamic control on postback. I've found that adding dynamic controls in the Page Load event works, and I realize that I need to add the dynamic controls again on each postback. But if I'm trying to retrieve the value of a dynamic control (Text property of a TextBox for instance), should I retrieve the value in the...
1
284
by: Victor | last post by:
I have dynamically created n number of text boxes in a form like txtQL(1), txtQL(2) , ...txtQL(n) How I retrieve the values in a loop? I'm confused as to how to approach this! Please help. Thanks for your time.
1
2913
by: Joe | last post by:
Hello All, I have a user control which is composed of a label and a dropdownlist. In my code I add the user control to a placeholder on the webform. Now I want to be able to retrieve the selected value from the drop downlist when a user clicks a button server control. Here is the code that populates the user control and placeholder: Dim UControl As AugmentedDropDownList =
3
2530
by: Dotnet Gruven | last post by:
I've built a WebForm with a Table added dynamically in Page_Load when IsPostBack is false. The table includes a couple of TextBoxes, RadioButtonLists and CheckboxLists. On postback, those controls are not present nor their valves in Request.Form.AllKeys.
3
3093
by: Andreas Wöckl | last post by:
Hi Group! I have a web form that is created dynamically - so I create Textboxes, RadioButtonLists, CheckBoxLists and so on - I have found some articles that there may be some problems with postback - but if I press a submit button the textboxes keep the value. My problem is the following: I would like to use this Code to collect the data: 'Collects values - is calles from a button
5
4448
by: Nathan Sokalski | last post by:
I have a custom control that I wrote (I inherit from System.Web.UI.WebControls.CompositeControl). I dynamically add this control to my Page, but I was told that dynamically added controls do not survive postback. This seems to be true. However, this seems to make dynamically adding controls rather pointless to me, since if you cannot retrieve the values of the controls when you perform a postback, why add the controls in the firstplace?...
0
1197
by: cruz | last post by:
Hi all, I am now developing an asp.net/C# web application. In this, in one aspx (say 'Parent page') page I am using two Iframes. Each Iframe source file (that are also .aspx file, say 'child1' and 'child2') contain a dropdown list control. According to the number selected in the dropdown, the page creates dynamic text boxes. For eg: if i select 5 from the dropdown list of child1, then child1 displays 5 dynamically generated textbox in...
2
4245
by: =?Utf-8?B?TG91aXNhOTk=?= | last post by:
Hello. ive just read some posts on the age old issue of losing dynamic control values on postback. Most people say recreate the controls on the onInit, but i just dont think this serves my purpose. if i could explain: i have a list of reports in a datalist. a user clicks a report link. it goes off to reporting services, fetches the parameters for this report and displays x number of textboxes (and labels) for those parameters (hence it...
0
8130
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8627
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8579
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8279
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6088
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4052
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1425
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.