New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Pass Two or More Arguments in ajaxRequest and ajaxRequestWithTarget with the AjaxManager or AjaxPanel

Environment

ProductProgress® Telerik® UI for ASP.NET AJAX AjaxManagerProgress® Telerik® UI for ASP.NET AJAX AjaxPanel

Description

How can I pass two or more arguments in the ajaxRequest and ajaxRequestWithTarget functions with the Telerik UI for ASP.NET AjaxManager or AjaxPanel?

Solution

By default, the ajaxRequest and ajaxRequestWithTarget functions accept only one argument.

To achieve the desired scenario and pass two or more arguments in the functions:

  1. Join the arguments on the client.

    JavaScript
    var arg3 = arg1 + "," + arg2;
    ajaxManager.ajaxRequest(arg3);
  2. Split the arguments on the server in the AjaxManager_AjaxRequest.

    C#
    private void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
    	string argument = (e.Argument);
    	String[] stringArray = argument.Split(",".ToCharArray());
    }			

See Also