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

pop-up window does not close

1 Answer 86 Views
Window
This is a migrated thread and some comments may be shown as answers.
Anumeha
Top achievements
Rank 1
Anumeha asked on 23 Dec 2010, 07:46 PM

I load a pop-up window fromone of my pages and based on certain action in the pop-up I need to close the pop-up and refresh data on the parent page.
I used the functionality as shown in the demo - http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window

I was able to send back arguments to the parent page and the ajaxrequest is initiated. But as soon the page is posted back my pop-up window shows up again. If I comment the code to initiate the ajaxrequest everything looks ok.

Below is the code I am using:

On Parent Page:
  
function OnClientClose(args) {
                var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
                var arg = args.argument
                if (arg) {
                    ajaxManager.ajaxRequest("Refresh");
                }
                else {
                }
            }
  
Window declaration on parent page:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" 
        Behavior="None"  ShowContentDuringLoad="false" Width="900px">
        <Windows>
            <telerik:RadWindow ID="RadWindowSelectPolicyRole" runat="server"  DestroyOnClose="false" Title="Activity" OnClientClose="OnClientClose"
                 Behavior="None" ReloadOnShow="true" ShowContentDuringLoad="false"
                Width="975px" Height="545px" Modal="true" />
        </Windows>
    </telerik:RadWindowManager>
  
code-behind:
Protected Sub manager_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs)
        If e.Argument = "Refresh" Then
            PopulateAdditionalContacts()
        End If
    End Sub
  
on my dialog page I close the window like this:
function CloseWindowOnSuccess() {
            var oWnd = GetRadWindow();
            if (oWnd != null) {
                oWnd.argument = "Refresh";
                oWnd.close();
            }
        }

I am unable to understand why the pop-up window is loaded once the ajax request is initiated?

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 24 Dec 2010, 12:26 PM
Hello Anumeha,

 I applied the changes you mention in the sample demo code but unfortunately to no avail - everything works as expected.

The only thing Is can suggest without examining and debugging demo code are the following ones:

1) Make sure that you do not get any js error - in case such is thrown, this can cause unexpected behavior, including RadWindow stop working

2) Make sure that you do not set the VisibleOnPageLoad property to true without resetting it to false when needed.

3) Make sure that you do not open the window in this method PopulateAdditionalContacts

In case the above does not help, please prepare a sample,. fully runnable reproduction demo, open a new support ticket and send it to me along with detailed reproduction steps and explanations and I will do my bets to help.

Greetings,
Svetlina
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.
Tags
Window
Asked by
Anumeha
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or