ASP.NET - Need help with ASP.NET Ajax - Asked By Suraj Kharatmol on 29-Sep-11 09:26 AM

I've below code in page load of certain page: Also inherited ICallbackEventHandler

string objRef = Page.ClientScript.GetCallbackEventReference(this, "arg", "displayThankYou", string.Empty, true);

string strCallbackScript = "function CallServer(arg, context){" + objRef + ";}";

Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CallBack", strCallbackScript, true);

Then I've below function:

public void RaiseCallbackEvent(string eventArg)


//Do something

From the aspx page, onclick of a button I've called some javascript function:
function abc()

var data = selectedChannel.value;

// Call server side code

CallServer(data, "");

Still onclick, RaiseCallbackEvent is not firing.

It is just refreshing whole page which is not desirable as I don't want the whole page to have postback.