PDA

View Full Version : ASP, AJAX and postback on dropdowns.


FabriceB
05-06-2010, 03:12 PM
Hi, I need some help on how to do postback on dropdowns which were populated by a DB through the use of AJAX.

the code I used is the one I had posted in the following thread:
http://codingforums.com/showthread.php?t=187836

Can anyone help me on how to approach this? when I google asp ajax and postback so far i only seem to fall on .net results which is not what i need...

Thanks in advance for any assistance!

Fab

seco
05-06-2010, 04:56 PM
do you mean chained dropdowns or just 1 drop down per query?

FabriceB
05-06-2010, 05:07 PM
Hi,
Thanks for replying so quickly,
If chained is the same as cascading then yes.
They are interrelated.

I use a stored procedure which takes each newly selected parameter to obain the following list.

i.e.: dept is selected, the sp will fetch all managers... managers are selected, all team leaders are obtained by the sp... etc..

seco
05-06-2010, 09:19 PM
i just released one.

you can use php if its installed on the server, but its pretty straight forward and can be converted to asp no problems.

http://www.blueicestudios.com/chained-select-boxes-using-php-mysql-ajax/


let me know if that helps

FabriceB
05-07-2010, 03:53 PM
Thank you for the link.

I clearly see I still have a lot to learn about all this since I don't really see in your code how you handle the postback.

seco
05-07-2010, 04:23 PM
the php just gets the data from the database, that code just checks for the url variable and if it exists use the variable, like a query string. all the postback stuff is in the jquery on the index page.

FabriceB
05-07-2010, 06:12 PM
so you mean the fact that you're using method="post" ?