This is a migrated thread and some comments may be shown as answers.

RadWindowManager, AlertTemplate

3 Answers 137 Views
Window
This is a migrated thread and some comments may be shown as answers.
Philipp
Top achievements
Rank 1
Philipp asked on 06 May 2011, 09:05 AM
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

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 May 2011, 12:42 PM
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.
0
Philipp
Top achievements
Rank 1
answered on 06 May 2011, 02:03 PM
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
0
Georgi Tunev
Telerik team
answered on 12 May 2011, 08:14 AM
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.

Tags
Window
Asked by
Philipp
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Philipp
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or