How to Close Particular tab after saving the Record ?..
Dear Friends,
I would have to need one Requirement that when we save the Record in Asp.net,
We show some message like " Record Saved Successfully " Popup , i want to Close the Tab Automatically .when i close the Javascript Popup Message ..
This what i really want ..
Thanks
- Karthik.


Sunny SharmaRank #223 · 11.1K reputationPosted Aug 8, 2013, 11:59 PM EDT
You can achieve this purpose with JavaScript/jQuery very easily. Share your code.
Rohatash KumarRank #12 · 57.7K reputationPosted Aug 9, 2013, 12:16 AM EDT
Karthik KRank #1,981 · 738 reputationPosted Aug 9, 2013, 12:36 AM EDT
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Msg", "alert('Saved!')", true);
The Above Message to be displayed after record inserted into db..
The Thing Is The Page should be closed , when i close the above Popup Message ..
The Opened Page should close..
Sunny SharmaRank #223 · 11.1K reputationPosted Aug 9, 2013, 1:01 AM EDT
You can't close the current browser tab with JavaScript. You can close the window (popup) using window.close() but not a browser tab.
A "browser tab" is defined nowhere in HTML nor in the EcmaScript specifications, some browsers don't even have tabs. So you just can't. It would be annoying for the user if sites start to close by themselves.
Hope you got the point.
Happy Coding :)
Karthik KRank #1,981 · 738 reputationPosted Aug 9, 2013, 1:50 AM EDT
Sunny SharmaRank #223 · 11.1K reputationPosted Aug 9, 2013, 2:15 AM EDT
I'm glad I could help. pleas mark the post as answer so that somebody else could find the resolution in one go.
Thanks.