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

RadWindow opens only in Non-MasterPage

2 Answers 207 Views
Window
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Markus asked on 30 Jan 2009, 04:17 PM
Hi everybody,

I experience a strange behaviour using the RadWindow in a page with a master page. I have a simple button and want the RadWindow to open when the button is clicked. This works perfectly well in any page without a master page but fails if a master page is associated to the page.

Here is the code block I use within the pages:

    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server"
    </telerik:RadStyleSheetManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    </telerik:RadAjaxManager> 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
        <Windows> 
            <telerik:RadWindow ID="DialogWindow" runat="server" Behavior="Default" InitialBehavior="None" 
                OpenerElementID="btnTest" VisibleOnPageLoad="False" Modal="true" VisibleTitlebar="False" 
                VisibleStatusbar="False" NavigateUrl="Dialog.aspx"
            </telerik:RadWindow> 
        </Windows> 
    </telerik:RadWindowManager> 
    <asp:Button ID="btnTest" runat="server" Text="Button" /> 

Moving the Rad...Managers between the page and its master page (and using proxies) didn't solve the problem.

Strangely, setting the VisibleOnPageLoad attribute to true, causes the RadWindow to show up in both versions. Then, it is also possible to close the window and open it with the button! Unfortunatelly showing the window on page load is not the behaviour I need.

I also compared the rendered html / script code and it looks identical in both versions - just different names and prefixes for the rendered elements.

Any help is much appreciated.
Thanks,
Markus


2 Answers, 1 is accepted

Sort by
0
Accepted
Fiko
Telerik team
answered on 30 Jan 2009, 04:58 PM
Hi Markus,

The OpenerElementID property expects a clientID which is different when you are using MasterPage - that is why in your case you need to use the opener's client ID:

<telerik:RadWindow  
ID="DialogWindow"  
runat="server"  
Behavior="Default"  
InitialBehavior="None" 
OpenerElementID="<%# btnTest.ClientID %>"  
VisibleOnPageLoad="False"  
Modal="true"  
VisibleTitlebar="False" 
VisibleStatusbar="False"  
NavigateUrl="Dialog.aspx"
</telerik:RadWindow>  


More information on the subject is available in the description of the following demo:
http://demos.telerik.com/aspnet-ajax/Window/Examples/OpenAndPosition/DefaultCS.aspx

Kind regards,
Fiko
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Markus
Top achievements
Rank 1
answered on 02 Feb 2009, 08:22 AM
Hi Fiko,

thanks for your hint. Now it works perfectly.

Best regards,
Markus
Tags
Window
Asked by
Markus
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Markus
Top achievements
Rank 1
Share this question
or