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

Prevent RadWindow from closing

3 Answers 172 Views
Window
This is a migrated thread and some comments may be shown as answers.
Cyrus
Top achievements
Rank 1
Cyrus asked on 05 Apr 2010, 06:57 PM
I have been having some issues using the RadWindow as a container with a custom control.  The control has a button that searches Active Directory users and it populates a listbox.  The indexchange event of the list box should close the window and return properties of the user selected.  However, whenever I click the button to search for a user, the window closes.  How can this be prevented?

<telerik:RadWindow runat="server" Behavior="Default" InitialBehavior="None" Left="" 
        Style="display: none;" Title="User Search" Top="" ID="popupSearch" OpenerElementID="btnSearch" 
        Behaviors="Close, Move" Height="325px" Width="350px" Modal="True">  
        <ContentTemplate> 
            <cc1:UserSearchBox ID="UserSearchBox1" runat="server"></cc1:UserSearchBox> 
        </ContentTemplate> 
    </telerik:RadWindow> 

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 06 Apr 2010, 08:34 AM
Hi Cyrus,

If you are making a postback when you click the "Search for user" button, such behavior is expected - the page is reloaded so any dynamically created HTML element will be destroyed. To avoid that you could Ajaxify the button.
If this is not the case, please open a support ticket and send a small sample project so we could get a better view over your exact setup and code logic.

Kind regards,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Cyrus
Top achievements
Rank 1
answered on 07 Apr 2010, 06:58 PM
Thanks, I abandoned trying to make this work and went with a separate page to open and do the work.  Now I am having all sorts of issues trying to pass items from the dialog page back to the parent page.  I am not well versed in JavaScript and that is what I try to avoid using your controls.  Anyway, this control really is a pain to deal with, I wish it was easier to pass items back and forth.
0
Georgi Tunev
Telerik team
answered on 08 Apr 2010, 09:40 AM
Hello Cyrus,

When you use RadWindow to display a content page, the control uses an IFRAME and behaves just like one. Because the parent and the content page are separate ones, the communication between them is done either on the client (via JavaScript) or you could use the Session to transfer arguments back and forth.
I don't know what your exact problems are, but I suggest to implement your logic not by using RadWindow but a standard popup (window.open()). Once you have your code working as expected, the same logic will work with RadWindow as well.


Kind regards,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Window
Asked by
Cyrus
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Cyrus
Top achievements
Rank 1
Share this question
or