Sunday, March 11, 2012

Combobox population

I suppose you want when the user click the first combo u want to create a call back to the server and then populuate the second combo?

I can suggest that you can do it in two ways:

1) Update Panel - thats is the easiest, fastest and usually the best approach for beginners

http://www.asp.net/ajax/documentation/live/overview/UpdatePanelOverview.aspx

2) Page methods - this is for best performance but usually require little bit more work.

http://www.asp.net/ajax/documentation/live/tutorials/ExposingWebServicesToAJAXTutorial.aspx


or...

3) use the cascading dropdowns control in the Ajax toolkit -click here for details

I would personally go for option 1 to regain full control. Just put both Comboboxes into an UpdatePanel and set AutoPostback="true" on the first combobox, when the user changes the option have it call a subroutine which re-binds the second combobox with the relevant options.

No comments:

Post a Comment