Close the alert message on browser back

Posted by Arun.Padmanaban under ASP.NET on 8/6/2012 | Points: 10 | Views : 1552 | Status : [Member] | Replies : 1
Hi All,
I have web based application. In Page1: i am selecting data and click on submit i am showing popup message,once user clicks on popup message it's redirect to Page 2 . Now , when user clicks on browser back from IE it's showing the popup message.How to close the popup message when user clicks on browser back in IE.


Posted by: Srilu.Nayini577 on: 8/6/2012 [Member] Starter | Points: 25


I have taken two web pages Default2.aspx and Default3.aspx.

In Default2.aspx ,I wrote the code like this:

In Default2.aspx ,i put the controls i.e, dropdownlist and button:

When i select a value in dropdownlist and clicking submit button it redirecs to another page:

Default2.aspx Source page:

<head runat="server">
<script type="text/Javascript" language ="javascript" >

function alertmes() {

alert("Submitting the data.Do u want to continue?");


<form id="form1" runat="server">

<asp:DropDownList ID="DropDownList1" runat="server"
style="z-index: 1; left: 397px; top: 77px; position: absolute">
<asp:Button ID="Button2" runat="server" Style="z-index: 100; left: 379px; position: absolute;top: 131px"

Text="Alert" OnClientClick ="alertmes()" Font-Bold="True" ForeColor="Red"
Width="72px" onclick="Button2_Click"/>


protected void Button2_Click(object sender, EventArgs e)

You can write any custom code for dropdown.Bt iam taking simple to explain the requirement.

put a label print a message.

set default2.aspx page as startup page press f5.Then a select a value in dropdown list click on button.It redirects to Default3.aspx page.Press backbutton of IE It won't display any popup message.

I tried in this way.It works fine.

Thank You,

.Net Developer

Arun.Padmanaban, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response