I would suggest you to follow the approach explained by jhon. if you are not familiar with AJAX then you can follow this general approach like write javascript code from server side after postback <asp:Button ID="btnVDistro" runat="server" Font-Bold="True" onclick="btnVDistro_Click" Text="Use Validated" /> protected void btnVDistro_Click(object sender, EventArgs e) { // Add your code here this.ClientScript.RegisterStartupScript(this.GetType(), "close", "javaScript:window.close(); return false;, true); }