Passing more organized data to AjaxRequest

2 posts, 1 answers
  1. Sean
    Sean avatar
    200 posts
    Member since:
    Nov 2010

    Posted 31 May 2011 Link to this post

    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";
  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 01 Jun 2011 Link to this post

    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. 

Back to Top