protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Page.ClientScript.RegisterStartupScript(this.GetType(),"onLoad","DisplaySessionTimeout()", true);
}
}
<script type="text/javascript">
var sessionTimeout = <%= Session.Timeout %>
function DisplaySessionTimeout()
{
document.getElementById("<%= lblSessionTime.ClientID %>").innerText = sessionTimeout;
sessionTimeout = sessionTimeout - 1;
if (sessionTimeout >= 0)
window.setTimeout("DisplaySessionTimeout()", 60000);
else
{
alert("Your current Session is over.");
}
}
</script>
{
if (!IsPostBack)
{
Page.ClientScript.RegisterStartupScript(this.GetType(),"onLoad","DisplaySessionTimeout()", true);
}
}
<script type="text/javascript">
var sessionTimeout = <%= Session.Timeout %>
function DisplaySessionTimeout()
{
document.getElementById("<%= lblSessionTime.ClientID %>").innerText = sessionTimeout;
sessionTimeout = sessionTimeout - 1;
if (sessionTimeout >= 0)
window.setTimeout("DisplaySessionTimeout()", 60000);
else
{
alert("Your current Session is over.");
}
}
</script>