client-side controls and server-side code

  • Thread starter Thread starter Jake
  • Start date Start date
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
 
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.
 
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
 
Back
Top