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

Use Telerik AJAX in Medium Trust

Environment

ProductProgress® Telerik® UI for ASP.NET AJAX

Description

How can I use Telerik UI for ASP.NET AJAX in Medium Trust?

Solution

When your application is running in Medium Trust and you want to use Telerik AJAX on your pages, you need to use any of the following approaches to make Telerik AJAX work properly. Note that in all cases when the application is running in Medium Trust, you can have only one Telerik AJAX control in the whole page hierarchy. Therefore, in complex Master/Content Page applications, it is recommended that you use a single AjaxManager on the Master page which will handle all available Ajax scenarios. This limitation is due to the fact that in Medium Trust the reflection permissions are not granted.

  • Inherit your page from the RadAjaxPage as shown below:
C#
public partial class MyPage: System.We.UI.Page {}
//should be changed to:
public partial class MyPage: Telerik.Web.UI.RadAjaxPage {}
  • Set the RestoreOriginalDelegate property of the Telerik AJAX control to false:
ASP.NET
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" RestoreOriginalRenderDelegate="false">
</telerik:RadAjaxManager>
	
or 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" RestoreOriginalRenderDelegate="false">
</telerik:RadAjaxPanel>
  • Implement the IRadAjaxPage interface:
C#
public class MyPage : System.Web.UI.Page, Telerik.Web.UI.IRadAjaxPage
{
	private System.Web.UI.RenderMethod _onRenderDelegate;
	#region IRadAjaxPage Members
	public void AttachOnRender(System.Web.UI.RenderMethod renderMethod)
	{
		_onRenderDelegate = renderMethod;
	}
}
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support