how to pass value to webpage and return data from server and display data using ajax

Posted by Swappy_Gaj under ASP.NET AJAX on 12/26/2014 | Points: 10 | Views : 943 | Status : [Member] | Replies : 0
I have two forms.
First form contains dropdown of city.
On dropdown selection value is passed to second page like:
xmlhttp.open("GET", "getcitydetails.aspx?q=" + str, true);
xmlhttp.send();
On second page i have created sqlconnection and access city value selected from dropdown using querystring:
string city=request.querystring["q"];
sqldataadapter da=new ("select * from citytable where city=city");
dataset ds=new dataset();
da.fill(ds);
gridview.datasource=ds;
gridview.databind();

Now question is how to display data in gridview.Its showing nothing using
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
// document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
document.getElementById("pop").innerHTML = xmlhttp.responseText;

}

please help..............




Responses

(No response found.)

Login to post response