|
I have login page and a main page in the asp.net 2.0 application.In web.config, session Timeout value is set as 5 mins.
My requirements are as below
1.If the main page is idle for 5 mins, the session will expire and the same page will be retained. If the user tries to do some action then it has to redirect to loginpage.
bebuggiung steps
1.comes to session end event in global.asax and the retain the main
page
2.comes to session start event in global.asax after the user tries to
do some action.
3.check the condition and redirects to login page
2.If the session ends at the time of some action is going in the main page(eg executing a stored procedure for a long time ) then the session has to continue upto the action gets finished.Once it is completed session timeout value has to reset as original value (5 mins)
bebuggiung steps
1. Comes to session end event and assigns the session timeout value
to retain the running process in the main page.
I have used the following code to do the above requirements.It is working fine in IIS V5.1 (win xp) and not working in IIs 6.0 in win 2003 server
Web.config
sessionState timeout="5" mode ="InProc" cookieless ="false"
Global.asax
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Application["Button"] = "Started";
}
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
HttpContext context = HttpContext.Current;
HttpCookieCollection cookies = context.Request.Cookies;
if (cookies["starttime"] == null)
{
HttpCookie cookie = new HttpCookie("starttime", DateTime.Now.ToString());
cookie.Path = "/";
context.Response.Cookies.Add(cookie);
cookie.HttpOnly = true;
Application["Button"] = "Started";
}
else
{
if (Application["Button"] == "NotClicked" || Application["Button"] == "Error")
{
context.Response.Redirect("~/Logon.aspx");
}
}
}
void Session_End(object sender, EventArgs e)
{
if (Application["Button"] == "Clicked")
{
Session.Timeout = 60;
}
else
{
Application["Button"] = "NotClicked";
}
}
}
Main Page Load
Application["Button"] = "NotClicked";
Main Page Button Click (calling sp in this button)
Application["Button"] = "Clicked";
Please any one help me out to do the same in IIS 6.0. I have tried with worker process idle time also in application pool.
What is the difference in IIS 6.0 with IIS 5.1 using the above code with cookies? Please any one reply me as soon as possible. its very urgent....
|
|
|
|
|
prasannavenkatesh wrote: Please any one reply me as soon as possible. its very urgent....
This is Bad
prasannavenkatesh wrote: IIS 6.0. I have tried with worker process idle time also in application pool.
Did you create separate Application pool for that? What are the configuration did u changed in Application Pool ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi,
I didnt create seperate application pool for that.In the Default Application pool, i have changed the settings and tested the same functionality based on the below link.
http://sanjaykattimani.blogspot.com/2007/02/net-session-timeout-settings-in-iis6-on.html
I have modified the option "ShutDown Worker processes after being idle for" into 5 minutes and restrated the IIS entirely and tested but no solution.
Now,i have reverted to default settings 90 minutes for that option.
Please help me if any other solution for this issue.
prasannavenkatesh
|
|
|
|
|
how could i know,
such a button onclick() event get fired in checking Postback
|
|
|
|
|
You can use Request.Form["__EVENTTARGET"] to get the control which caused the postack
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
thanx for reply yep its works ,yet have to add
UseSubmitBehavior="false"
to the button
|
|
|
|
|
hii...
i have taken buttonfield in one of the columns of a grid view rest of the columns are populated from the database.I want to perform some task on the buttonclick event how can i do this.
plz guide me....
thanks...
|
|
|
|
|
|
right, I have used this way!
|
|
|
|
|
That's cool !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
use gridview edit and delete event and Google u will find so many example
Thanks,
Amit Patel
|
|
|
|
|
Amit, I guess he is not asking about the GridView Edit Button.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
|
You are 7 min late
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
LOL i am Always Ur Follower Dude..!
If It Helps Click It as Answer
|
|
|
|
|
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
thanks...
|
|
|
|
|
Any Time DUDE
If It Helps Click It as Answer
|
|
|
|
|
Hi all,
I Develop one application in which i want to load XML file from client machine using javascript and process its nodes.
How can i load XML file which is stored at client machine into my application???
Thanks in advance...
Krishnraj
|
|
|
|
|
Javascript does not have the power to to access the file system.
you will need to use ActiveX which will read the file for you.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi manas,
First-of-all thanks for reply...
Do u have any idea regarding the kind of ActiveX available which read the xml file from client machine as i have a short deadline??
Thanks Again buddy..
Krishnraj
|
|
|
|
|
Krishnraj wrote: Do u have any idea regarding the kind of ActiveX available
var xmlDocument = new ActiveXObject("Msxml2.DOMDocument.3.0");
xmlDocument.load(src);
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
pass the xml string to this function and get the Document object. After that you can call GetElementsByTagName to get nodes
function(text) getXMLDocument {
try {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.loadXML(text);
}
catch (e) {
try {
var parser = new DOMParser();
xmlDoc = parser.parseFromString(text, "text/xml");
}
catch (e) {
alert(e.message);
return;
}
}
return xmlDoc;
}
var doc = getXMLDocument('<abc><item>xx</item><item>gg</item></abc>');
var elements = doc.getElementsByTagName('item');
I think this is what you needed.
|
|
|
|
|
Dear Experts,
I'm developing a web application & I'm using a thick-box as a container to display my popup page.
Issue: when ever the user clicks out of the pop up page, i.e pop will be having only 2 or 3 fields with 2 buttons and its displayed as a child page on the main page at the center of the screen, the pop up page gets closed when the user clicks anywhere out side the popup window.
Is there any way to restrict the mouse click outside the popup page? i.e i want to disable the mouse click outside the popup page.
would be very happy to receive the responses and any suggestions would be appreciated.
Thanks in advance
Murali..
|
|
|
|
|