Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Posting an Array

Status
Not open for further replies.

acent

Technical User
Feb 17, 2006
247
US
Greetings.

I have a form with some runat="server" controls that have a style of display="none". For instance:
Code:
<asp:DropDownList ID="ddlLimitBy" style="display:none;" runat="server" />

On the client side, via javascript, this control get cloned with their id's set. For instance, ddlLimitBy becomes ddlLimitBy[]. All is well, with the client side.

What I can't figure out is how to then loop the ddlLimitBy[] array retrieving the values.

I'm working with VB.NET 2.0.

Any ideas are appreciated.

"If it's stupid but works, it isn't stupid."
-Murphy's Military Laws
 
Update:

I was able to determine that the entire form was not being submitted. Any ideas why all the form elements would not get submitted? Only the form elements with runat="server" are being submitted.

Thanks in advance.

"If it's stupid but works, it isn't stupid."
-Murphy's Military Laws
 
as far as I know that is how .net works. If you want any controls ect.. past to the server you must use the runat=server or pass them by querysting or you can add them to the viewstate.

Ordinary Programmer
 
by "cloning" do you mean dynamically creating web server controls and adding them back to the page? if so research dynamically adding controls. if webforms isn't bad enough as is, dynamic controls are even more complex.

taking a whole different approach... if you add dynamic html input fields using javascript on the client, you should be able to access them through the Request.Form collection. make sure to set the id and name of the input elements. because you are dealing strictly with html and DOM elements at this point everything is a dictionary with strings for keys and values, so you will need to parse the values.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top