New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
Pass Two or More Arguments in ajaxRequest and ajaxRequestWithTarget with the AjaxManager or AjaxPanel
Environment
Product | Progress® Telerik® UI for ASP.NET AJAX AjaxManager | Progress® 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:
-
Join the arguments on the client.
JavaScriptvar arg3 = arg1 + "," + arg2; ajaxManager.ajaxRequest(arg3);
-
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()); }