Thursday, May 12, 2011
Configuration Error - Unrecognized attribute 'type'.
I got this error message when i host a web application in server. Go to properties of the web site and change the asp.net version.
Monday, May 9, 2011
Timeout message before session expire
Here a javascript solution for detecting session expire.
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<style type="text/css">
.message
{
border: 1px solid #CCCCCC;
position: absolute;
width: 400px;
border: 1px solid #c93;
background: #ffc;
padding: 5px;
left: 0px;
top: -170px;
}
</style>
<script language="javascript" type="text/javascript">
function ShowAlert() {
//get the height and width of the screen
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
//get the height and width of the message box
var popupHeight = $("#TimeoutMessage").height();
var popupWidth = $("#TimeoutMessage").width();
//show the message box
$("#TimeoutMessage").animate({
"top": windowHeight / 2 - popupHeight / 2,
"left": windowWidth / 2 - popupWidth / 2
}, 1000);
//close the message box when cross red image is clicked
$("#close_message").click(function() {
$("#TimeoutMessage").fadeOut("slow");
});
setTimeout('Redirect()', 300000); //15 minutes in milliseconds
}
function Redirect() {
window.location = "../../logout.aspx";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="TimeoutMessage" class="message">
<p>
You will be logged out due to inactivity in 5 minutes.<br /><br />
Please refresh this page, or click on an action to refresh your session.</p>
</div>
</form>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
setTimeout('ShowAlert()', <%=((Session.Timeout * 60) * 1000) - 300000 %>);
});
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<style type="text/css">
.message
{
border: 1px solid #CCCCCC;
position: absolute;
width: 400px;
border: 1px solid #c93;
background: #ffc;
padding: 5px;
left: 0px;
top: -170px;
}
</style>
<script language="javascript" type="text/javascript">
function ShowAlert() {
//get the height and width of the screen
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
//get the height and width of the message box
var popupHeight = $("#TimeoutMessage").height();
var popupWidth = $("#TimeoutMessage").width();
//show the message box
$("#TimeoutMessage").animate({
"top": windowHeight / 2 - popupHeight / 2,
"left": windowWidth / 2 - popupWidth / 2
}, 1000);
//close the message box when cross red image is clicked
$("#close_message").click(function() {
$("#TimeoutMessage").fadeOut("slow");
});
setTimeout('Redirect()', 300000); //15 minutes in milliseconds
}
function Redirect() {
window.location = "../../logout.aspx";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="TimeoutMessage" class="message">
<p>
You will be logged out due to inactivity in 5 minutes.<br /><br />
Please refresh this page, or click on an action to refresh your session.</p>
</div>
</form>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
setTimeout('ShowAlert()', <%=((Session.Timeout * 60) * 1000) - 300000 %>);
});
</script>
</body>
</html>
Subscribe to:
Posts (Atom)
TinyMCE Insert/Edit link not editable
To fix this add e.stopImmediatePropagation() as below. $(document).on('focusin', function (e) { if ($(e.target).close...
-
I spent plenty of time for delving into this problem' depths. I can summarize the solution as follows: 1. Create The Entity Class (e.g...
-
Image upload with CKEditor. My latest issue was how to integrate CKFinder for image upload in CKEditor. Here the solution. 1. Download C...
-
Introduction: In my MonoGame Android project, I wanted to provide users with the option to rate my app when they clicked a button within the...