Close Module Dialog SharePoint from server side Code and javascript
Javascript
C#
//current Context
HttpContext Currentcontext = HttpContext.Current;
//Checking dialog is open on this page or not
if (HttpContext.Current.Request.QueryString["IsDlg"] != null)
{
//executing javascript for closing pop on runtime;
Currentcontext.Response.Write("");
Currentcontext.Response.Flush();
Currentcontext.Response.End();
}
from update panel
///
/// Call Runtime Javascript Functions
///
/// type Complete Function and js Code
private void CallJavaScriptMethods(string Script)
{
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), Guid.NewGuid().ToString(), Script, true);
}
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), Guid.NewGuid().ToString(), "window.frameElement.commitPopup();", true);
0 comments:
Post a Comment