473,322 Members | 1,526 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,322 software developers and data experts.

Access options from a dynamically created listbox.

Hello,

I'm working on a page that dynamically creates listboxes and the
"options" that are added to the listbox. A user can then click on
buttons to either add or delete the "options" from one listbox to the
other. All of this works fine, but when the user changes from one
page to the next, I'm trying to save all user input before it
redirects to the next page. For some reason, I can't see what values
have been selected in one of the listboxes. Obviously I only care
about one of the listboxes which represents selected values. I've
tried using Request.Form[], and Request.Form.GetValues(), but both
give me a null value.

My call looks something like this. When I create the control
dynamically, I give it a dynamic name of "ListBox55S". Then when I
try to access the values,

string name = ListBox55S;
Request.Form[name];

-or-

Request.Form.GetValues(name);

neither works.....

Any ideas would be helpful.
BTW, this is a web application in Visual Studio.Net, and I'm using C#
as my selected code-behind language.

Thanks
Nov 17 '05 #1
1 3338
One option would be to process all the information on teh page that
containes the "options" and then use either a response.redirect or
server.transfer call to move the user to the next page.

The code might look something like this

<asp:button id="btnSave" text="Save Options" runat=server />

sub btnSave_onClick(sender as object, e as eventargs) handles
btnSave.onClick

' Process all information of the options

' Transfer to the next page
server.transfer("nextpage.aspx",false)

End Sub

"mlarson" <ma*********@ga-utah.com> wrote in message
news:3c**************************@posting.google.c om...
Hello,

I'm working on a page that dynamically creates listboxes and the
"options" that are added to the listbox. A user can then click on
buttons to either add or delete the "options" from one listbox to the
other. All of this works fine, but when the user changes from one
page to the next, I'm trying to save all user input before it
redirects to the next page. For some reason, I can't see what values
have been selected in one of the listboxes. Obviously I only care
about one of the listboxes which represents selected values. I've
tried using Request.Form[], and Request.Form.GetValues(), but both
give me a null value.

My call looks something like this. When I create the control
dynamically, I give it a dynamic name of "ListBox55S". Then when I
try to access the values,

string name = ListBox55S;
Request.Form[name];

-or-

Request.Form.GetValues(name);

neither works.....

Any ideas would be helpful.
BTW, this is a web application in Visual Studio.Net, and I'm using C#
as my selected code-behind language.

Thanks

Nov 17 '05 #2

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

Similar topics

1
by: Corey | last post by:
I have a subform with two list boxes on it. The first listbox has a SQL rowsource that builds from one of the tables that lists multiple work skills (ex - Word Exp, Excel Exp, 10 Key). When end...
5
by: Eddie Clark | last post by:
I'm trying to access the items in a listbox from a client-side vb script. <asp:listbox id="ListBox1" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 120px" runat="server" Width="400px"...
1
by: nicholas | last post by:
I got a product with product options, such as color, size, etc All are defined a table. 1 table for the products 1 for the options (optionID, parentoptionID, optionname) ex: 1, 0, color 2, 1,...
3
by: AnandaSim | last post by:
Hi All, I'm experiencing what I think is a bug - can't figure out how it would be stated so difficult to search the NG. I have a form. It has four listboxes. Each listbox has a rowsource. The...
0
by: Matt | last post by:
Hello! I have a user control (ascx) which simply has a couple textboxes and a listbox... On a page that has a could of them, dynamically created, I am having a weird problem with the listbox.....
1
by: stimul8d | last post by:
okay; ASP. I have i listbox inside a user control which is dynamically created on page_init. I check for postback and only populate the datasource if it's false. regardless, i do this ...
6
by: GS | last post by:
how can I set tooTip on ToolTip1 for a listbox?
1
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...
10
by: glenfernandez | last post by:
HI there, Need a little help with the reporting component of my MS Access 2002 project and would appreciate any insight / help from the experts. Please bear with me as I am still learning Access...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.