Hii Guys!!!. I have a grid which is populating through jason data.Now I want to retrieve the jason values using jquery ajax call from server side code...
Below is my server side code...
getGriddahico.ashx
string json ="";
json = json + "{\n";
json = json + " \"page\":\""+intpage+"\",\n";
json = json + "\"total\":"+total_pages+",\n";
json = json + "\"records\":"+total+",\n";
json = json + "\"rows\": [";
rc = false;
while(rs.Read()){
if(rc){
json = json + ",";
}
json = json + "\n{";
json = json + "\"price\":\"" + Convert.ToInt32(rs["price"]) + "\",";
json = json + "\"cell\":[" + Convert.ToInt32(rs["price"]) + "";
json = json + ",\"" + Convert.ToString(rs["username"]) + "\"";
json = json + ",\"" + Convert.ToString(rs["ordinal"]) + "\"";
json = json + ",\"" + Convert.ToString(rs["toc"]) + "\"]";
json = json + "}";
rc=true;
}
json = json +"]\n";
json = json +"}";
and Here is my Jquery Ajax Call code.
$(document).ready(function () {
$.getJSON('getGriddahico.ashx', function (data) {
//loop thru json data
//data will contain json values < --
$.each(data, function (key, val) {
console.log(val);
});
});
});
Plz guys Help me how to retrive the value from server side datareader to client side variable.. Thanx in advance.