Disable AJAX with the AjaxManager When the Client Browser Does Not Support it
Environment
Product | Progress® Telerik® UI for ASP.NET AJAX AjaxManager |
Description
The Telerik RadAjax controls won't work in browsers that do not support XmlHttpRequests
. How can I disable AJAX when such a browser opens my website?
Solution
To disable AJAX, set the EnableAJAX
property of the Telerik AjaxManager or AjaxPanel control to false
both client- and server-side.
The .NET 2.0 framework provides the SupportsXmlHttp
property which you can use to check if the browser supports XmlHttpRequest
.
Even though some browsers support
XmlHttpRequests
, they can still returnfalse
for theSupportsXmlHttp
property. In such cases, you need to define the browser definition files. For more information, refer to the Browser Definition File Schema (browsers Element) in MSDN and Browser Detection using ASP.NET articles.
The following example demonstrates how to achieve the desired scenario. When the check is over in the Page_Load
event handler, it will make your page work as if it was in a standard postback scenario for those browsers.
RadAjaxManager1.EnableAJAX = Page.Request.Browser.SupportsXmlHttp;