This is a migrated thread and some comments may be shown as answers.

Passing more organized data to AjaxRequest

1 Answer 81 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 2
Sean asked on 31 May 2011, 09:40 PM
Hi all,

I am passing some data back to AjaxRequest through e.Argument. I pass the data in as an array, it comes out as a comma separated list. Is there any way to maintain my object? I am working with a large set of data and it is confusing to have a huge list of CSVs not associated with any titles. 

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
    //TODO: This needs extensive work still.
    Logger.InfoFormat("Received an ajax request. Arguments are: {0}", e.Argument);
 
    string[] arguments = e.Argument.Split(',');
    if (arguments[0] == "Update Local Settings")
    {
        string dockID = arguments[1];
 
        Logger.InfoFormat("Dock ID: {0}", dockID);
        CormantRadDock dock = Utilities.FindControlRecursive(Page, dockID) as CormantRadDock;

etc... would like to do arguments["Command Name"] == "Update Local Settings";

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 01 Jun 2011, 08:10 AM
Hello Sean,

As far as I know, you can pass only basic type parameters directly.
One suggestion is to use XML. You can easily generate it on the client and use the XML parser in the .NET framework on the server.

Another option is JSON.  It is better than XML because it is more concise. 

Thanks,
Shinu.
Tags
Ajax
Asked by
Sean
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or