473,396 Members | 1,970 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.

how get the selections from dynamically created radiobuttonlists in asp.net 2.0?

I have an aspx page where I am creating "radiobuttonlists" dynamically
based on the result from a SQL query. "ID" property of these controls
is set dynamically.
Then...i have a "submit" button on my page which when clicked takes me
to another page.
I want to capture the user selections on the radiobuttonlists in my
previous page.

code looks like this.

page1.aspx (code behind, in page_loadcomplete)

resultFromQuery = <<get the result from query>>
for i = 0 to resultFromQuery - 1
Dim rdl As New RadioButtonList
Dim arr() As String
arr = <<get the list of array values>>
rdl.Font.Size = FontSize.XLarge
rdl.Font.Name = "arial"
rdl.ID = "rdl_" & a(i)
Dim l As Integer
For l = 0 To UBound(arr) - 1
rdl.Items.Add(arr(l))
Next
rdl.RepeatDirection = RepeatDirection.Vertical
next

then a "submit" button whose "postbackUrl" property is set to
"page2.aspx".

Problem is ...I would like to get the user selections on dynamically
created radiobuttonlists (page1.aspx) in page2.aspx?

any ideas??

Jun 9 '06 #1
1 1849
did you tried:
for i = 0 to resultFromQuery - 1
Dim arr() As String
arr = <<get the list of array values>>

mySelectedValue = CType(PreviousPage.FindControl("rdl_" & a(i)),
RadioButtonList).SelectedValue
next


--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)
"loga123" <vd**********@covansys.com> escreveu na mensagem
news:11**********************@g10g2000cwb.googlegr oups.com...
I have an aspx page where I am creating "radiobuttonlists" dynamically
based on the result from a SQL query. "ID" property of these controls
is set dynamically.
Then...i have a "submit" button on my page which when clicked takes me
to another page.
I want to capture the user selections on the radiobuttonlists in my
previous page.

code looks like this.

page1.aspx (code behind, in page_loadcomplete)

resultFromQuery = <<get the result from query>>
for i = 0 to resultFromQuery - 1
Dim rdl As New RadioButtonList
Dim arr() As String
arr = <<get the list of array values>>
rdl.Font.Size = FontSize.XLarge
rdl.Font.Name = "arial"
rdl.ID = "rdl_" & a(i)
Dim l As Integer
For l = 0 To UBound(arr) - 1
rdl.Items.Add(arr(l))
Next
rdl.RepeatDirection = RepeatDirection.Vertical
next

then a "submit" button whose "postbackUrl" property is set to
"page2.aspx".

Problem is ...I would like to get the user selections on dynamically
created radiobuttonlists (page1.aspx) in page2.aspx?

any ideas??

Jun 10 '06 #2

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

Similar topics

18
by: Alpha | last post by:
Hi, I'm working on a Windows applicaton with VS 2003 on windows 2000. I have a listbox that I have binded to a dataset table, "source" which has 3 columns. I would like to display 2 of those...
2
by: sramruttun | last post by:
hi I have 2 radiobuttonlists in my form both having more or less the same listitems: At Design time, RDLGroup1 (1st radiobuttonlist) has the foll. items: A1 A2 A3 A4 A5 (A1 is selected) ...
1
by: DJ Dev | last post by:
Hi, I am stuck at a problem for 3 days now. I create runtime datagrids depending on the user selections and they may vary from 2-10 depending on user selection at runtime. The datagrids are...
2
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...
2
by: John Hoge | last post by:
I'm looking for that elusive .net time saving magic. I have an application that presents a list of items which the user can select from. A CheckBoxList works great for that, but I want to query...
5
by: Chris Kettenbach | last post by:
Good morning, Does anyone happen to know if there's a way to make an array of the selected items in an asp:ListBox? I know you can loop through and check the selected property, my question is how...
7
by: pmclinn | last post by:
I was wondering if it is possible to dynamically create a structure. Something like this: public sub main sql = "Select Col1, Col2 from Table a" dim al as new arraylist al =...
3
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...
3
by: Ben Dewey | last post by:
Okay, so I have a base Page class called ArticlesPageBase. This base class has reads in an overridable ArticleId and Loads the data into a Panel object in the ContentPlaceHolder of the Master. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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,...
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...

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.