client-side controls and server-side code

J

Jake

To avoid a postback, we want to use a webservice and XMLHTTP to fetch the
list of values for dropdowns whose contents are determined by an earlier
user-choice on the page. E.g. if the user selects "FL" from the State
dropdown, the Cities dropdown will be populated with cities in Florida only:

State Dropdown Cities Dropdown
NY Miami
PA Tampa
FL St Augustine


If the Cities dropdown is a client-side SELECT object populated in this
manner (i.e. client-side DOM parsing of XML dataset returned by a
webservice), is it possible, in code-behind, to detect which City was
selected when the form is posted?

Thanks
Jake
 
L

Lucas Tam

Jake said:
is it possible, in code-behind, to detect which City was
selected when the form is posted?

Yes you can use the class "Request.form" to read the control value.
 
S

Steve C. Orr [MVP, MCSD]

You may need to use client side script to write the value to a hidden field.
Then you could read the hidden field from the Request.Form collection.

I recently discovered this suite of controls that makes this kind of thing
easier than I would have imagined it could be:
http://www.dart.com/powerweb/livecontrols.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top