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

Page refresh issue on RADwindow OnClientClose

2 Answers 81 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Zinith Patel
Top achievements
Rank 1
Zinith Patel asked on 09 Feb 2010, 10:52 AM
Hello,

I have one page e.g. New Item Create Page. on which there is combo for Category and next to it button to add new category. on clicking on button RAD window is opened as modal window for adding new category. But when I close this modal window the main page refreshes which whole page and clears the values in the controls.
I need to keep this controls to keep their values.
So, I want such help like onClientClose of the modal window only combobox gets refreshed.


Thanks in Advance.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Feb 2010, 07:30 AM
Hello Zinith Patel,

You can invoke an ajaxRequest on closing the modal radwindow in the OnClientClose event. And then popupale the RadComboBox in the AjaxManager AjaxRequest server side event.

Client side:
 
    function OnClientClose(sender, args) { 
         var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); 
         ajaxManager.ajaxRequest('RefreshCombo'); 
    } 

Code behind:
 
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e) 
    { 
        if (e.Argument.ToString() == "RefreshCombo"
        { 
            // Here write code for refreshing the RadComboBox1
        } 
    } 

Also set the AjaxSettings as shown below:
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">  
    <AjaxSettings>  
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
            <UpdatedControls>  
                <telerik:AjaxUpdatedControl ControlID="RadComboBox1" />  
            </UpdatedControls>  
        </telerik:AjaxSetting>  
    </AjaxSettings>  
</telerik:RadAjaxManager>  

-Shinu.
0
Zinith Patel
Top achievements
Rank 1
answered on 10 Feb 2010, 11:33 AM
Hello Shinu,
Thanks  for your reply. Your suggestion worked perfectly. But after implementing this way normal events of the Rad combobox (like selectedindexchanged) has stopped working. can you help resolving this?


Again Thanks in advance.
Tags
Ajax
Asked by
Zinith Patel
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Zinith Patel
Top achievements
Rank 1
Share this question
or