Server-side code after window closes

3 posts, 0 answers
  1. Chris
    Chris avatar
    43 posts
    Member since:
    Aug 2008

    Posted 23 Apr 2010 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Apr 2010 Link to this post

    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.

  3. Chris
    Chris avatar
    43 posts
    Member since:
    Aug 2008

    Posted 26 Apr 2010 Link to this post

    Awesome, that's exactly what I need.  Thanks
Back to Top