Search This Blog

Wednesday, March 16, 2016

Programmatically close dialogue box in share point

private void CloseDialogPopup()
{
    try
   {
      HttpContext context = HttpContext.Current;
      if (HttpContext.Current.Request.QueryString["IsDlg"] != null)
      {
         context.Response.Write("<script      type=\"text/javascript\">window.frameElement.commonModalDialogClose(0, 'cancelled');</script>");
                    context.Response.Flush();
                    context.Response.End();
                    this.Page.Response.End();
                }
                else
                {
                    Response.Redirect(SPContext.Current.Web.Url);
                }
            }
            catch(Exception ex)
            {

                throw ex;
            }
        }

No comments:

Post a Comment