Академический Документы
Профессиональный Документы
Культура Документы
//THIS BELOW CODE REPRESENT THE USING OF I CALLBACK WHERE PAGE DOENT REFRESH
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Data.SqlClient;
using System;
/// <summary>
/// This method returns the result of a callback
/// </summary>
/// <returns>a string of the result of the callback</returns>
public string GetCallbackResult()
{
return m_callbackResult;
}
/// <summary>
/// This method processes the callback event
/// </summary>
/// <param name="eventArgument"></param>
public void RaiseCallbackEvent(string eventArgument)
{
m_callbackResult = "document.getElementById('randomQuote').innerHTML =
'" + this.getQuote() + "'";
}
#endregion
}
Callback.aspx
=======================******************==================================
GridView1.DataSource = BindGrid();
GridView1.DataBind();
}
}
if (CusName != "")
//dv.RowFilter = "ID Like '%" + CusName + "%' And Meter_No Like
'%" + CusCity + "%'";
dv.RowFilter = "Name =" + CusName + "%' And Meter_No =" + CusCity
+ "%'";
GridView1.DataSource = dv;
GridView1.DataBind();
Callbackgrid.aspxPages
function fnSearchGrid()
{
var param1 = document.getElementById('txtCusName').value;
var param2 = document.getElementById('txtCusCity').value;
var inputarg = param1+"|"+param2;
fnCallServerMethod(inputarg,'');
}
function fnShowAll()
{
document.getElementById('txtCusName').value="";
document.getElementById('txtCusCity').value="";
fnSearchGrid();
}
function fnGetOutputFromServer(strOutput)
{
document.getElementById('divGridView').innerHTML = strOutput;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<table width="300">
<tr>
<td>
Customer Name</td>
<td>
<input id="txtCusName" type="text" /></td>
</tr>
<tr>
<td>
Cutomer City</td>
<td>
<input id="txtCusCity" type="text" /></td>
</tr>
<tr>
<td>
</td>
<td>
<input id="btnFilter" type="button" value="Filter"
onclick="fnSearchGrid()" />
<input id="btnShowAll" type="button" value="Show All"
onclick="fnShowAll()" /></td>
</tr>
</table>
<br />
<div id="divGridView">
<asp:GridView ID="GridView1" runat="server" EmptyDataText="No Records
Found.">
</asp:GridView>
</div>
</div>
</form>
</body>
</html>