New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
Using RadAjax in Medium Trust
When your application is running in Medium trust and you want to use RadAjax on your pages, you need to use one of the following approaches in order to make RadAjax work properly:
- Inherit your page from 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 RadAjax 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;
}
Note that in all cases when the application is running in Medium trust you could have only one RadAjax control in the whole page hierarchy. Therefore in complex Master/Content Page applications we suggest using single RadAjaxManager on the Master page which could handle all available Ajax scenarios. The mentioned limitation is due to the fact that in Medium Trust the reflection permissions are not granted.