madhu goud

madhu goud

  • NA
  • 36
  • 14.4k

How to expire a pop window in asp.net

Jan 21 2016 1:41 AM
I have two buttons in my page login and register,
If i click login am showing a login popup(user id and password) ,
if this pop up stable for 5 minutes , i want redirect that to expired.aspx page, how to do this
 
this is my code
 
<form id="form1" runat="server">
<input type="hidden" name="ctl00$TxbWater1_ClientState" id="TxbWater1_ClientState" />
<div onload="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'" onkeydown="checkKeycode2">
<div id="light" class="white_content">
<table cellpadding="0" cellspacing="0" border="0" style="background-color: #FFFFFF; font-family: Verdana, Geneva, Tahoma, sans-serif;"
width="100%">
<tr>
<td height="16px">
<a href="javascript:void(0)" id="pop_up_pretrazivanje:closeButton" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">
<img src="Images/delete.png" style="border-style: none; border-color: inherit; border-width: 0px; height: 20px; width: 20px;"
align="right" alt="Close" /></a>
</td>
</tr>
<tr>
<td style="padding-left: 16px; padding-right: 16px; padding-bottom: 16px">
<table align="center" border="0" cellpadding="0" cellspacing="0" style="background-color: #fff"
width="100%">
<tr>
<td align="center" colspan="2" class="headertext">
<h1 class="LoginHead" align="center">LOGIN</h1>
</td>
</tr>
<tr>
<td>&nbsp;
</td>
</tr>
<tr>
<td align="center">
<table>
<tr>
<td align="right" class="bot_text">Username:
</td>
<td>
<%--<input type="text" runat="server" id="txtSearchTerm" placeholder="Username" value="txtName" />--%>
<asp:TextBox ID="txtName" runat="server" placeholder="Username"></asp:TextBox>
</td>
</tr>
<tr>
<td height="10px"></td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName"
ErrorMessage="User ID Required" ValidationGroup="a" CssClass="content3" ForeColor="#FF3300"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right" class="bot_text">Password:
</td>
<td>
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" placeholder="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right"></td>
</tr>
<tr>
<td height="10px"></td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPassword"
ErrorMessage="Password Required" ValidationGroup="a" CssClass="content3" ForeColor="#FF3300"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td></td>
<td align="center">
<asp:Button ID="_btnLogin" runat="server" Text="Login" CssClass="Button1" ValidationGroup="a"
Height="40px" Width="100px" />
</td>
</tr>
</table>
<table>
<tr>
<td>
<a href="ForgotPassword.aspx" class="style4" style="font-family: Verdana">Forgot password?</a>&nbsp
| &nbsp<a href="Registration.aspx" class="style4" style="font-family: verdana">Register</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="10px"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="fade" class="black_overlay">
</div>
</div>
<asp:Panel ID="Panel1" runat="server">
<pre style="margin-bottom: 10px"><a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'"
style="font-size: small; color: #0000FF; font-family: verdana;">Login</a>|<a class="anchor"
href="Registration.aspx" style="font-family: verdana; font-size: small; color: #0000FF;">Register</a></pre>
</asp:Panel>
</form>
 
 
Javascript
 
<script type="text/javascript">
window.onkeyup = function (event) {
if (event.keyCode == 27) {
window.close();
}
}
</script>
<script type="text/javascript">
document.onkeydown = checkKeycode2
function checkKeycode2(e) {
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
if (keycode == 27) {
var obj;
obj = document.getElementById('pop_up_pretrazivanje:closeButton');
if (obj != null) {
document.getElementById('pop_up_pretrazivanje:closeButton').click();
}
}
}
</script>
 
 
 

Answers (1)