ICallbackEventHandler//THIS BELOW CODE REPRESENT THE USING OF I CALLBACK WHERE PAGE DOENT REFRESHWHEN REQUEST IS PLACED HERE GOES WITH C# CODEusingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Collections.Generic;usingSystem.Data.SqlClient;usingSystem;public partial class Test_Callback: System.Web.UI.Page,ICallbackEventHandler
{ private stringm_callbackResult =String.Empty;
protected voidPage_Load(objectsender,EventArgse)
{Label1.Text =DateTime.Now.ToString(); if(!Page.IsPostBack){ this.lblQuote.Text =this.getQuote();
} // Creating the scripts which need to be called // this below statment is based with timer for each second //string clientScript = "function serverRequest(args, context){{ " +ClientScript.GetCallbackEventReference(this, "args", "getResult", "context")+ "; }} function getResult(result, context){{ eval(result); callServer(); }}function callServer(){setTimeout('serverRequest();', 1000);} callServer();"; // this below statment is based with out timerstringclientScript ="function serverRequest(args, context){{ "+
ClientScript.GetCallbackEventReference(this,"args","getResult","context")
+"; }} function getResult(result, context){{ eval(result); callServer(); }}function callServer(){serverRequest()} callServer();"; // Register the client script ScriptManager.RegisterClientScriptBlock(this,typeof(Page),
"RandomQuoteCallback", clientScript,true);
} private stringgetQuote()
{ intrandomIndex = (new Random()).Next(0, 29);
stringWav =string.Empty;
SqlConnectioncon =new SqlConnection("server=softpro-
srv\\sqlexpress;User Id=apdrptest;Password=Apdrp@test;database=APDRP;"); SqlDataAdapterda =new SqlDataAdapter("select Parm_name from
Parameters where Parm_Id="+ randomIndex +"", con);
DataSetds =new DataSet();
da.Fill(ds);returnWav = ds.Tables[0].Rows[0].ItemArray[0].ToString(); //int randomIndex = (new Random()).Next(0, m_quotes.Count);