Chandrashekar
10/16/2015 - 5:12 PM

ConfigureUserFacilities.aspx Close model and Refresh only grid

ConfigureUserFacilities.aspx Close model and Refresh only grid

RadAjaxManager.GetCurrent(Page).ResponseScripts.Add(string.Format("openWindow('{0}','{1}');", pageUrl, title));


 function openWindow(pageUrl, title) {
                pageUrl = pageUrl.indexOf("?") > 0 ? (pageUrl + '&Rnd=' + Math.random()) : (pageUrl + '?Rnd=' + Math.random());
                var oWnd = radopen(pageUrl, "ConfigureWindow");
                oWnd.SetTitle(title);
                oWnd.SetSize(400, 500);
                oWnd.set_modal(true);
                oWnd.set_visibleStatusbar(false);
                oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
                oWnd.center();
                oWnd.add_close(OnClientClose); //set a function to be called when RadWindow is closed  
            }
            
            
            
 function OnClientClose(oWnd) {
                //alert('claose');
                oWnd.setUrl("about:blank"); // Sets url to blank 
                oWnd.remove_close(OnClientClose); //remove the close handler - it will be set again on the next opening 
                //window.location.href = window.location.href;
                var masterTable = $find("<%= rgdCenterUser.ClientID %>").get_masterTableView();
                masterTable.rebind();
            }   
            
            
 //In Modal Window           
 <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" CssClass="button hpred" />
 
 ScriptManager.RegisterStartupScript(this, GetType(), "close", "CloseModal();", true);
 
 function CloseModal() {
                var oWnd = GetRadWindow();
                if (oWnd) oWnd.close();
            }