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

Server-side code after window closes

2 Answers 102 Views
Window
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 23 Apr 2010, 03:37 PM
Hi,

I was working with the rad window and was running into some problems regarding server side code.  Basically, we have a pop up window that contains a RadTreeView.  We select an item in the tree view and click a button in the pop up.  The pop up window closes, then the parent page does some logic with the selected value that is returned from the tree view in the pop up.  Is it possible to do server side code from the parent as the pop up window is closing or after it closes? 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Apr 2010, 07:29 AM

Hello Chris,

You can attach OnClientClose event to RadWindow and get the parameters passed from the window. Checkout the documentation to know more about passing an argument to OnClientClose:

Using RadWindow as a Dialog

Now in the OnClientClose event handler, you can invoke an ajaxRequest() and pass the values to code behind.

JavaScript:

 
<script type="text/javascript">   
    function ClientClose(sender, args) {   
        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");   
        ajaxManager.ajaxRequest(args.get_argument()); // invoke ajaxRequest  
  }   
</script>  

In the RadAjaxManager1_AjaxRequest event, perform the server code by gettting the passed parameter.

CS:

 
    protected void RadAjaxManager1_AjaxRequest1(object sender, AjaxRequestEventArgs e)   
    {   
        string value = e.Argument;  // Get the argument passed  
        // Your code  
    }  

[Also set the AjaxSettings correspondingly]

-Shinu.

0
Chris
Top achievements
Rank 1
answered on 26 Apr 2010, 11:43 AM
Awesome, that's exactly what I need.  Thanks
Tags
Window
Asked by
Chris
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Chris
Top achievements
Rank 1
Share this question
or