RadWindowManager, AlertTemplate

4 posts, 0 answers
  1. Philipp
    Philipp avatar
    27 posts
    Member since:
    Mar 2011

    Posted 06 May 2011 Link to this post

    Hi everybody,

    i am customizing the AlertTemplate of my RadWindowManager.
    I have some trouble with the button inside the template.
    While using an asp:button without any problems i always get an error when i change the asp:button with a radbutton-control.
    The errormessage says:

    "Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request. "

    In detail:

    "[InvalidOperationException: Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.]
       Telerik.Web.UI.ScriptRegistrar.GetScriptManager(Control control) +157
       Telerik.Web.UI.RadWebControl.get_ScriptManager() +16
       Telerik.Web.UI.RadWebControl.RegisterScriptDescriptors() +26
       Telerik.Web.UI.RadWebControl.Render(HtmlTextWriter writer) +84
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Control.Render(HtmlTextWriter writer) +10
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       Telerik.Web.UI.RadWindowManager.GetTemplateContent(String templateName) +152
       Telerik.Web.UI.RadWindowManager.ControlPreRender() +318
       Telerik.Web.UI.RadWebControl.OnPreRender(EventArgs e) +22
       System.Web.UI.Control.PreRenderRecursiveInternal() +80
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
    "

    Is this behavior by design? Can i use radbutton in the templates of RadWindowManager?

    greetings, Philipp
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 May 2011 Link to this post

    Hello,

    As far as I know, the reason for this problem is that you are trying to put a server control like RadButton in the Alert Template while this template accepts only pure HTML. If you want to use RadControls, I would suggest to put it in a separate page which will be loaded in a RadWindow. This way you will get the same result. Hope this information helps you.

    Thanks,
    Princy.
  3. Philipp
    Philipp avatar
    27 posts
    Member since:
    Mar 2011

    Posted 06 May 2011 Link to this post

    Hello Princy,

    that could be the reason.
    I was just wondering why the asp:button as it is also a server control with the attribute runat="server" works like a charme and the radbutton doesn't. Well i will find a workaround maybe the one you suggested. Thank you so far.

    best regards,
    Philipp
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 12 May 2011 Link to this post

    Hi guys,

    Philipp, the asp:Button control is rendered as a standard INPUT on the page and if you don't use its server-side events, you could use in the template. As Princy noted, the alert, prompt and confirm templates, use pure HTML only.
    As for the RadButton control, it is much more complex ASP.NET AJAX control with a different rendering and additional JS code is parsed on the page when it is created - that is why it cannot be used in the templates and throws an error.


    Greetings,
    Georgi Tunev
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top