I am trying to retrieve an object from the server side using static receive callbackresult methods.
However, my goal is to execute a non-static method on my page to populate an ajax accordion by invoking a client-side function.
The object I am fetching from the server side is quite complex and cannot be utilized on the client side if obtained through callback results.
I am wondering if there is another solution that would allow me to run a non-static method in an aspx file using a client-side control?
Below are the codes I have been working with:
function ReceiveServerData(arg, context) {
// Message.innerText = "Date from server: " + arg;
}
#region ICallbackEventHandler Members
public void RaiseCallbackEvent(String eventArgument)
{
// Processes a callback event on the server using the event argument from the client.
Insert(); // this function runs but doesn't work!
// printAlternativesFromAirport(eventArgument);
}
public string GetCallbackResult()
{
// Returns the result of a callback event to the client.
return null;
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
ClientScriptManager cm = Page.ClientScript;
String cbReference = cm.GetCallbackEventReference(this, "arg", "ReceiveServerData", "");
String callbackScript = "function CallServer(arg, context) {" + cbReference + "; }";
cm.RegisterClientScriptBlock(this.GetType(), "CallServer", callbackScript, true);
}