How to call a ServerSide Script through Javascript
public void testData()
{
String cbReference = Page.ClientScript. GetCallbackEventReference(
{
String cbReference = Page.ClientScript.
if (!ClientScript.
{
String callbackScript;
callbackScript = "function CallServer(arg, context)" +
"{" + cbReference + ";}";
Page.ClientScript.
}
}
protected string returnValue;
public void RaiseCallbackEvent(String assetid)
{
returnValue = assetid;
//if (LoadHandler != null)
// LoadHandler(assetid);
returnValue= GetDataByAssetIdforCertificate s(Convert.ToInt32(assetid));
}
public String GetCallbackResult()
{
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
TList<IcEquipmentDetails> tlst_eqdetails = new TList<IcEquipmentDetails>();
tlst_eqdetails = obj_Equipmentdetails.GetAll();
public void RaiseCallbackEvent(String assetid)
{
returnValue = assetid;
//if (LoadHandler != null)
// LoadHandler(assetid);
returnValue= GetDataByAssetIdforCertificate
}
public String GetCallbackResult()
{
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
TList<IcEquipmentDetails> tlst_eqdetails = new TList<IcEquipmentDetails>();
tlst_eqdetails = obj_Equipmentdetails.GetAll();
if (tlst_eqdetails != null)
{
ddlplantEqpmentIsolation.
ListItem firstItem = new ListItem("------Select------", "-1");
tlst_eqdetails.Filter = "Status = true";
ddlplantEqpmentIsolation.
ddlplantEqpmentIsolation.
ddlplantEqpmentIsolation.
ddlplantEqpmentIsolation.
//GVLookupEmp.DataSource = tlst_eqdetails;
//GVLookupEmp.DataBind();
ddlplantEqpmentIsolation.
}
else
{
ddlplantEqpmentIsolation.
ddlplantEqpmentIsolation.
}
ddlplantEqpmentIsolation.
//return GetDataByAssetIdforCertificate
return sw.ToString();;
}
type 2:
[WebMethod(true)]
public static string WebMethod(string passedString)
{
string localString = passedString;
//System.Threading.Thread.
return localString;
}
function CallServerFun(assetid) {
CallServer(assetid, '');
}
function CallServer(assetid, context) {
}
function ReceiveServerData(retValue) {
alert(retValue);
}
CallServer(assetid, '');
}
function CallServer(assetid, context) {
}
function ReceiveServerData(retValue) {
alert(retValue);
}
No comments:
Post a Comment
Comments