Please can you suggest me an example in classic asp and ajax to make dependent combo?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Long before the concept of AJAX was formalised, I was using a technique called XML Data Islands to achieve this kind of functionality. Obviously, there are a number of AJAX frameworks and scripts that can achieve similar result, but this is just the tried-and-tested technique that I have used for years in my legacy applications.
I can’t quickly find any suitable articles, so I’ve dug up some of my old code. Basically, when you set the value of the parent control, you run some javascript that sends a request to a separate ASP page. This page queries the DB to get determine the data that will be used to populate the child control.
This second page returns the results as XML, which is stored and manipulated in an XML Data Island in your primary page. The calling javascript then parses the returned XML and populates the child control.
First we have the javascript calls from the primary control:
Then we have the javascript which makes the call to the second page (which retrieves the data from the DB):
And finally, the page that queries the DB itself.
Edit: Oops! I forgot the all-important XML Data Island itself – add this after your Body tag.