protected void CloseAndRefreshWindow(String msg) { //ClientScript.RegisterStartupScript(this.GetType(), "CloseAndRefresh", "parent.Dialog.CloseAndRefresh(frameElement);", true); String js = null; if (!String.IsNullOrEmpty(msg)) { js += "alert('" + Js.Encode(msg) + "');"; } js += "parent.Dialog.CloseAndRefresh(frameElement);"; WebHelper.WriteScript(js); Response.End(); }