Hi,
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">
<title></title>
<script type="text/Javascript" language ="javascript" >
function alertmes() {
alert("Submitting the data.Do u want to continue?");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:DropDownList ID="DropDownList1" runat="server"
style="z-index: 1; left: 397px; top: 77px; position: absolute">
<asp:ListItem>101</asp:ListItem>
<asp:ListItem>102</asp:ListItem>
<asp:ListItem>103</asp:ListItem>
<asp:ListItem>104</asp:ListItem>
</asp:DropDownList>
<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"/>
</form>
Default2.cs:
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("Default3.aspx");
}
You can write any custom code for dropdown.Bt iam taking simple to explain the requirement.
Default3.aspx:
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,
SRILATHA
.Net Developer
Arun.Padmanaban, if this helps please login to Mark As Answer. | Alert Moderator