<script type="text/javascript">
function doajax() {
$.ajax(
{
url: "GridDemo.aspx/search",
data: "flag=1",
success: function (msg) {
if (msg.d) {
alert("Sucess");
}
});
}
</script>
In the code behind
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["flag"] != null) search();
}
public void search()
{
int id = Convert.ToInt32(txtSearch.Value.ToString());
ds.Clear();
ds = (DataSet)ser.getDataID("SP_SELECT_DATA_FROM_INFO", id);
if (ds.Tables[0].Rows.Count > 0)
{
grdMyGrid.DataSource = ds;
grdMyGrid.DataBind();
}
else
{
Response.Write("No Record Found");
}
}
I hope I was able to solve your problem.
Watch my first article posted on codeproject and comment and vote:
http://www.codeproject.com/KB/HTML/speechinputapi.aspx
or http://blog.robinrizvi.info
Drop me a mail for any comments, suggestions or questions.
mail@robinrizvi.info