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

Open Div and Post Back Problem!

1 Answer 61 Views
Window
This is a migrated thread and some comments may be shown as answers.
ali
Top achievements
Rank 1
ali asked on 08 Jan 2009, 03:14 PM

Hi

When I click to Button1, radwindow manager close and page is postback. But I don't want close rand window and page post. How can I make  idea?

thank you... 

 <asp:ScriptManager ID="ScriptManager1" runat="server">    
    </asp:ScriptManager>    
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">  
            <ContentTemplate> 
             <telerik:RadWindowManager  ID="RadWindowManager1" Skin="Web20" runat="server" Modal="true">  
             </telerik:RadWindowManager>    
                        
                <script type="text/javascript">    
                    function openAndSet()    
                    {    
                        var content = $get("hiddenContent");     
                        var oWnd = radopen(null,"RadWindow1");     
                        oWnd.set_contentElement(content);     
                    }    
                    
                </script>    
                    
                <button onclick="openAndSet(); return false;" type="button">open and set</button>    
                <div style="display: none">    
                    <div id="hiddenContent">    
                        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /><asp:Label ID="Label1" runat="server" 
                            Text="Label"></asp:Label> 
                    </div>    
                </div>    
                <asp:Button ID="Button2" runat="server" Text="Button1" OnClick="Button2_Click" /> 
                <asp:Label ID="Label2" ForeColor="red" runat="server" Text="Label"></asp:Label> 
            </ContentTemplate> 
        </asp:UpdatePanel> 

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 09 Jan 2009, 01:45 PM
Hello Ali,

If I understand your scenario correctly, when you click the button with ID Button1, you want to make postback and update the labe with ID Label 1 but not to close the RadWindow.
If this is so, this is not possible - you are using the set_contentElement() method that supports pure HTML only and the content is on the same page - when you postback the page, RadWindow will be destroyed as any other dynamically created element on that page.
What I can suggest is to use RadToolTip or RadDock with Ajax/ RadAjax. RadWindow is designed to replace the browser's popup and just like the popup, it displays a content page different from the browser. The set_contentElement() method allows you to put simple HTML content in RadWindow, but it cannot be used in more complex scenarios.


All the best,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
ali
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or