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

Radwindow close causes full postback

1 Answer 175 Views
Window
This is a migrated thread and some comments may be shown as answers.
Nasiem
Top achievements
Rank 1
Nasiem asked on 05 Sep 2010, 08:14 AM

I'm using a web usercontrol with fields to edit an XML file. I have an "Edit" link on this usercontrol to edit a radgrid on this parent usercontrol by opening a child radwindow then in the child radwindow i save the values and close the child radwindow. The problem I'm having is that the values are saved are refreshed in the parent window and the grid is populated with the new values but the values that I had in the form in other fields get lost because a full postback is caused. Is there a way I can only refresh the grid only on the parent usercontrol instead of refreshing the whole parent. I'm using the following JavaScript to open the radwindow then refresh the parent after the child window is closed.

Code to open the child radwindow

function openDevDealTailredPopup(tailoredIndex) {

    var oWnd = radopen(“blabla”, "RadWindow1");

    oWnd.set_modal(true);

    oWnd.SetWidth((document.documentElement.clientWidth) * (95 / 100));

    oWnd.SetHeight((document.documentElement.clientHeight) * (80 / 100));

    oWnd.center();

   

}

The code that closes the child radwindow and refreshes the parent usercontrol

function GetRadWindow() {

    var oWindow = null;

    if (window.radWindow) oWindow = window.radWindow;

    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;

    return oWindow;

}

 

function CloseRadWindow() {

 

    var oWindow = GetRadWindow();

    oWindow.opener = "x";

    oWindow.Close();

     OnClose();

 }

 

            

function OnClose() {

    var oWnd = GetRadWindow().BrowserWindow;

    oWnd.location.href = oWnd.location.href;

}

 

I would appreciate your help on this matter.
Thanks
Nasiem

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Sep 2010, 10:23 AM
Hello Nasiem,


You could invoke an ajaxRequest() instead of refreshing the parent page. The documentation shows how to invoke an ajaxRequest from client code.
Client-Side API

Now in the code-behind part, rebind the grid. Make sure that you set the AjaxSettings properly.


-Shinu.
Tags
Window
Asked by
Nasiem
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or