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

RadWindow closes automatically when calling from user control

2 Answers 217 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Uwe
Top achievements
Rank 1
Uwe asked on 03 May 2011, 11:15 AM
Hi,
I'm having a strange behaviour in the following scenario:

A textbox and a button on a webform. Clicking the button opens a modal dialog with a grid. After closing the popup, the value selected in the grid in written into the text field. I used the following code to open the dialog:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
    <script type="text/javascript"
     function ShowDialog() 
    
        window.radopen(null, "winSearchDialog"); 
    
    </script>
</telerik:RadCodeBlock>
     
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Overlay="false"
    <Windows>
        <telerik:RadWindow ID="winSearchDialog" runat="server" Width="600px" Height="600px" Modal="true"
            Title="Select BP" NavigateUrl="~/Pages/Parent2Popup.aspx" />
    </Windows>
</telerik:RadWindowManager>

This works fine when using the code snippet on a web form.

But I need to use this code in a user control. The user control contains the same textbox and button with the same code snippet.
After opening the modal dialog closes automatically after 1-2 seconds. This is really strange.

Thanks for help,
Uwe

2 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 06 May 2011, 08:24 AM
Hello Uwe,

Based on the provided information it is hard to determine what is the cause of the problem. Can you try preparing a sample project illustrating the problem and send it to us? For that purpose, you will need to open a formal support ticket where you would be able to attach a zipped version of the project.

Regards,
Iana
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.

0
Uwe
Top achievements
Rank 1
answered on 06 May 2011, 11:19 AM
Hello Iana,
thanks for your reply. But I solved the problem this morning. :-)
This behaviour is caused because of the postpack when clicking the button to open the popup.

I added the command "return false" to the OnClientClick event of the Button to prevent a postback. This works fine and my popup keeps openend. :-)

<asp:ImageButton ID="btnSearch" runat="server" ImageUrl="~/App_Themes/Search.png" OnClientClick="ShowDialog(); return false;" />

But this solution is not right perfect for me because after closing the popup a postback is raised that takes to much time. Is there another even better solution that you know?

Here is the scenario again:
I need a textbox and a button in a user control. Clicking the button opens a RadGrid in a modal popup. After closing the popup, the value selected in the grid in written into the text field. That's all! ;-)

But I could not find a good usable example for that scenario yet.

Thanks for your help again,
Uwe
Tags
Grid
Asked by
Uwe
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Uwe
Top achievements
Rank 1
Share this question
or