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

Migrating from ModalPopupExtender to RadWindow

3 Answers 180 Views
Window
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 18 Jan 2012, 11:54 PM
Hi,

Does anybody has an example on how to convert from the asp.net Toolkit ModalPopupExtender to the RadWindow control?
Basically I have this code:

<asp:Button runat="server" ID="hiddenTargetControlForModalPopup" style="display:none"/>

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderAddEditSample" runat="server"                
				TargetControlID="hiddenTargetControlForModalPopup"                
				PopupControlID="PanelSamples"
				BackgroundCssClass="modalBackground"                 
				DropShadow="true"                                
				>
				</ajaxToolkit:ModalPopupExtender>       
		<!-- modal popup -->
		<asp:Panel ID="PanelSamples" runat="server" Style="displaynone" CssClass="modalPopup"> 
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">                
				<ContentTemplate>
				<!-- a bunch of controls and HTML -->
				</ContentTemplate>            
			</asp:UpdatePanel>
		</asp:Panel>
Is there an easy way to covert this code to a RadWindow? Thanks!

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Jan 2012, 04:32 AM
Hello,

Making RadWindow as modal is nearly simple by setting the "Modal" property to "True".

<telerik:RadWindow ID="RadWindow 1" runat="server"  Modal="true">

Also take a look into this for more.

Thanks,
Princy.
0
Chris
Top achievements
Rank 1
answered on 20 Jan 2012, 09:34 PM
Princy:

Thank you for your prompt answer. the problem I'm having now is that my popup requires to be opened after a click event on a linkbutton control. With my current code, in order to show the popup, all I had to do was to call this:

this.ModalPopupExtenderAddEditSample.Show();

RadWindow does not seem to have any equivalent method. Is the only way to achieve that by hooking to the clientScript the javascript code?
0
Marin Bratanov
Telerik team
answered on 23 Jan 2012, 03:40 PM
Hello Chris,

The RadWindow is a client-side object and thus must be shown via JavaScript. You can use the LinkButton's OnCilentClick event to open the Radwindow and cancel the postback (if it is only an AJAX request that will not dispose the RadWindow you may not cancel it), for example:
<asp:LinkButton ID="Linkbutton1" Text="some text" OnClientClick="JsFunctionToOpenTheRadWindow(); return false;"  runat="server" />

Please also examine this help article on the ways to open a RadWindow: http://www.telerik.com/help/aspnet-ajax/window-programming-opening.html. If you explicitly need to do this from the server please examine this thread: http://www.telerik.com/community/forums/aspnet-ajax/window/opening-radwindow-from-the-server.aspx.

I believe examining the Client-side API of the RadWindow will also be helpful: http://www.telerik.com/help/aspnet-ajax/window-programming-radwindow-methods.html.

Kind regards,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Window
Asked by
Chris
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Chris
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or