I am using a ModalPopupExtender to show the session time out countdown alert to user of web application.
My application also has many pop windows on which the user works.
Challenge i am facing is that the session alert shows up on the main browser window i.e. in back of the browser pop up windows. And so the user may not be able to notice the session reset alert.
So how to show the ModalPopupExtender in front of the browser pop up windows ?
Following is the relevant code:
<asp:ModalPopupExtender ID="mpeTimeout" BehaviorID ="mpeTimeout" runat="server" PopupControlID="pnlPopup"
TargetControlID="lnkFake"
OkControlID="btnYes" CancelControlID="btnNo" BackgroundCssClass="modalBackground" OnOkScript = "ResetSession()">
</asp:ModalPopupExtender>
<script type="text/javascript">
function SessionExpireAlert(timeout) {
var seconds = timeout / 1000;
document.getElementsByName("seconds").innerHTML = seconds;
setInterval(function () {
seconds--;
document.getElementById("seconds").innerHTML = seconds;
}, 1000);
setTimeout(function () {
$find("mpeTimeout").show();
}, timeout - 30 * 1000);
setTimeout(function () {
window.location = "<%= Page.ResolveUrl("~/AppPages/WebForm3.aspx") %>" ;
}, timeout);
};
function ResetSession() {
window.location = window.location.href;
}
</script>
What I have tried:
Tried to check the possible properties of ModalPopupExtender and looked for options while showing the alert. And searched the web for the solution too.