New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
Force a Postback 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 force a postback with the Telerik UI for ASP.NET AjaxManager or AjaxPanel?
Solution
To perform a single postback instead of an AJAX request, set arguments.EnableAjax
to false
.
The following example demonstrates the code-behind.
C#
if (!RadAjaxManager1.EnableAJAX)
{
RadAjaxManager1.ClientEvents.OnRequestStart = "OnRequestStart";
}
The following example demonstrates the settings on the client.
JavaScript
function OnRequestStart(sender, args) {
args.set_enableAjax(false);
}
To disable AJAX because of unsupported browsers or previous browser versions, it is recommended that you do it on the server as demonstrated in the following snippets.
C#
RadAjaxManager1.EnableAJAX = Page.Request.Browser.SupportsXmlHttp;