views:

342

answers:

0

I can get an object from the server side by using static receive callbackresult methods from server side.

But I want to run a non-static method in my page which populates an ajax accordion by calling a client side function.

The object I am calling from server side is a complex object which I can't use in client side if I get it by callbackresults.

Is there any other solution that I can run a non static method in an aspx file by a client side control ?

Codes I am using so far ...

       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 is running, but doesnt work !
    //printAlternativesFromAirport(eventArgument);
}

public string GetCallbackResult()
{
    // Returns the results 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);
 }