Close Popup window after some activity specially after db update

It’s very simple to close window after some activity ,Just put following code after which you want to close current window –

Page.RegisterStartupScript(“ClosePopup”, “<script language=javascript>window.close()</script>”);

Suppose If the popup page is using Ajax i.e. ScriptManager ,UpdatePanel then use following code –

ScriptManager.RegisterClientScriptBlock(this.Page, GetType(), “ClosePopup”, “window.close()”, true);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s