Web Forms :: How To Delete Dirctory / Causing Session Time Out

May 8, 2010

when i trying to delete Empty folder this is Cause session Timeout, i have found solution on the net and i found this:

using System.Reflection;
using System.Web;

namespace MyWebsite
{
/// <summary>
/// Stops the ASP.NET AppDomain being restarted (which clears
/// Session state, Cache etc.) whenever a folder is deleted.

[Code]....

View 5 Replies


Similar Messages:

State Management :: How To Check Time In Background And Then Delete Session

May 6, 2010

I am writing a chat application, in which a chat starts in a chat room. Now, i want this room active only for a certain amount of time and not more. i.e 1 hour etc. So, to check the time constantly what and how should i write something in the background, so that when the time is over, the sessions of all the users logged in at that chat room get destroyed. And the users are again redirected to the login page. e.g The chat has been setup from 3 to 4 pm. At 3.55 everybody should be given a popup that the chat will end in 5 mins. And at 4 everybodys session should be destroyed and they should be redirected to the login page.

View 6 Replies

Localization :: Locale Settings Causing Date-Time Exceptions?

Jan 12, 2010

Our application has a database varchar field which at times store datetime values. Code is not formatting the date time values before storing.

Now the issue is coming when we are trying to restore database from our deployment server
to local server and then run the application.Dates are getting stored in format 'dd/mm/yyyy' [ex 31/12/2009] on deployment machine [EN-UK]however when we have restored DB and then try to run application on local server it throws invalid datetime exception, probably because it is expecting
datetime in 'mm/dd/yyyy' format [EN-US] (Dont know why !!).

The code base for our ASP.NET application is deployed into server machines with Regional and local settings as English-UK. However our local servers have regional settings as English-US we changed the regional settings from Control Panel to En-UK however still same error is coming !!

View 2 Replies

C# - Response.end Method Causing Session Variable To Expire?

Mar 1, 2011

I am storing the returned sql resultant rows in a session variable ... so that I need not to query again and again

Session["ds"] = datasetname;

Everything is fine but when I am doing export to excel ... where at last after the export is completed I am calling the method in try/catch

try {
Response.End()
}
catch {}

But due to this, my session variable (ds) is getting expired and when I am using it next there is no rows and hence my page displays no data.

I tried going through internet and found that this is a bug it seems as identified by Microsoft and they have provided a hotfix for this but in Windows Vista .... I am running on XP.

[URL]

Is there any other workaround to this problem?

View 1 Replies

State Management :: Redirect Causing A Loss Of Session Cookie?

May 17, 2010

We have a web app running .net 1.1 that users must login to access (uses FormsAuthentication). At one point, the user submits a form that is handled by a separate web app on the same website but in a different directory (running .net 2.0 and not requiring authentication). When the user submits the form and is redirected to this other page they have some options including returning to the previous web app.

We need our users to stay logged in to the first web app so they do not have to log in again when returning. This works fine on 3 out of four computers, but the fourth computer is asked to log in when they hit the return button (by reviewing the active cookies we see that when it returns to the original web app, the FormsAuthentication cookie is missing)

why this cookie would disappear on one machine but not the others? I am going through IE settings now but the machine has the problem in IE and Chrome (not sure if this would be a shared setting) If it is an IE setting is there a way to make this work without requiring the user to change their settings and without switching to cookieless sessions?

Here is the authentication part of web.config

[Code]....

And if it makes a difference, the redirect and form action property use a the full path, would using a relative path likely change anything?

View 2 Replies

State Management :: Objects In Session Variables Now Causing Slow-downs?

Oct 24, 2010

I've noticed that once I've instantiated 3-4 objects now, my ASPX page is running slower. The response from the server (which is my own PC) is taking longer.

With one or two objects, the performance is same. After I instantiate 3, it slows a little, and 4 just completely wears it down.

I've read this article: [URL]

that says to avoid using session variables especially storing objects into them. Well thats exactly what I'm doing. My object has about 10 methods(~30 lines of code each) and 20 fields.

My question is, if I want to persist object in memory for each user session, how else could I store them on each postback if not in the session variable>? I can't use application variable because thats shared and not thread safe.

View 3 Replies

Web Forms :: Delete Not Working All The Time?

Aug 30, 2010

From time to time i am getting this error when attempting to delete a file.

Exception Details: System.IO.IOException: The process cannot access the file 'D:galleryimagesUntitled-1.jpg' because it is being used by another process.

And the times i see it most is if i upload the image and then within seconds try to delete the image.

View 9 Replies

C# - Session Gets Time Out Frequently Although Set Timout Time In Web.config?

Mar 13, 2010

Session gets time out frequently although i set timout time in web.config

View 4 Replies

State Management :: Session Time Out Before Time Reach

Jan 10, 2011

<sessionState mode="InProc" timeout="300"></sessionState>

is my session related tag in web.config file but most of the time if i idle 20 minutes then its automatically timedout and went to my login page, is there any solution ?

View 5 Replies

Web Forms :: Why All Session Is Changed To Null When Delete A Folder

Mar 3, 2011

I use the simple code in onunload's body method like this:

<body
onunload="closeIt()"> ... </body>

The closeIt method is call a server method, like this:

function closeIt ()
{
$.ajax({
type: "POST",
url: "mypage.aspx/myFunc",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
//async: false,
success: function(response){},
failure: function(response) {
alert(response.d);
}
});
}
I delete a folder in temp directory in myFunc method. The folder's name is the same of value in Session["id"], like this:
string id = Session["id"];
string temp = "~/temp" + id;
temp = Server.MapPath(temp);
DirectoryInfo dr = new DirectoryInfo(temp);
Directory.Delete(dr.FullName);

When the last code( Directory.Delete(dr.FullName) ) is run, the all session in project is changed to null. If i disable the last code( //Directory.Delete(dr.FullName) ) every thing work properly(all session have the value). Why when i enable the last code, all session are null? What's the problem and how can i solve it?

View 7 Replies

Web Forms :: How To Create A Unique Name Aspx Page When Session Started And Delete

Dec 12, 2010

how to create a unique name aspx page when session started and delete when session is End in code behind

View 4 Replies

Web Forms :: Where To Increase Session Time

Jan 26, 2011

Where to increase session time? IIS or web.config of app?

View 4 Replies

Web Forms :: How To Show A Message Box When Session Time Out

Mar 7, 2011

How can I show up a message box in client when the session of a user is time out?

View 7 Replies

How To Extend The Session Time When There Are Multiple Forms

Jun 28, 2010

How to extend the session time. There are many form in my application like parent and child forms. So how can I make pop up to appear when session times out and the pop up should appear on the form where the user is currently in, when popup comes I have to disable all forms like(they should be transparent (i.e) user should NOT be able to edit them). how can i extend the session when I click on the OK button.

View 2 Replies

How To Set Session Time Out To 6 Hours With Forms Authentication

Jan 7, 2010

In my application I use Forms Authentication and sessions. How do I take care that the user is logged out after a period of 6 hours?

In my web.config I set the sessions time-out to 360 minutes. But after a period of 10 minutes of inactivity I have to login again.

I also set my forms authentication timeout to 360 minutes.

View 5 Replies

Web Forms :: Dealing With Session Time Out While Using Modules?

Dec 20, 2010

We are using cutesoft AJAX uploader. The uplodaer is implemented using HTTP Modules. Everything works well. The problem is that if the user clicks the upload button after being idle for long (means after session time out) the control throws and error.

I just want to know the work around to bypass this issue.

Note:- We are just using one web.config and two master pages (one for login and error pages and one for all other pages which are accessed after authentication). We have written the code to check the session timeout in oninit of the master page which is used by all the pages except (Login and Error pages).

View 4 Replies

Web Forms :: Session Is Not Alive For Long Time

May 14, 2012

I have used session in my application for admin panel. It is redirecting if i not use 1 or 2 minutes. I need to stay session until I click logout  button.

View 1 Replies

How To Delete / Add More Session Value To Repeater

Nov 2, 2010

I've got this problems n till now i could not find the answer. I create an custom cart application, and the problem occur when I'm trying to solve the final page. This cart model like a wizard, it means there are pages to be passed before getting to the last (Cart) page.

The problem here is, every value which is checked/choose in the beginning pages are saved in Session (Session["CurrentCartItem"]). And in the final cart page, the collected value in the "CurrentCartItem" Session is inserted to the "repeater". Now the question is, how can I add more values in the repeater (which is returning again to the beginning pages) without the value which showed in the repeater is gone?
And how can I delete one of the values from the repeater ? FYI, I'm saved all the value using the Session, not database.

View 1 Replies

Web Forms :: How To Programmatically Reset Session Time Without Page Refreshing

May 7, 2015

I am using session timeout in IIS 8 for about 60 minutes :<sessionState timeout="60" /> now lets suppose 58 minutes have passed , and it showed user a message that your session will be expired after 2 minutes , Click here [BUTTON] to refresh the session timeout , without page refreshing, clicking on the button , i want to reset the session timeout .... when user clicks on button at 58th minute , his session would be reset to 60 minute without page refresh ....

View 1 Replies

DataSource Controls :: How To Delete Record After A Specific Time

Jan 24, 2011

I am working with asp.net 2008 and sql server 2005 . I get a situation where i have to delete data after 30 days. a suitable query how to do the same. I have go through different query but nothing going right for me.

View 2 Replies

Visual Studio :: Files Take A Long Time To Delete?

Feb 9, 2011

When I try to delete files or directories within the solution explorer, they take an excessive amount of time to delete. When I say excessive, I mean I almost had enough time to type this post out before a directory with nothing in it was finally removed. I'm using visual studio 2010 on Windows XP SP3 and I primarily program in MVC/C#.

View 7 Replies

Session - Why Does Application Recycle When Delete A Folder

Sep 27, 2010

I have a Silverlight application using a WCF service hosted in IIS. I make use of some aspects of ASP.NET. I have the following folder structure for my application:

inetput
wwwroot
myapp
reports
{user-guid-folders}
report1.pdf
report2.pdf
App_Data (folder)
bin (folder)
Client_Bin (folder)
(various .aspx files, plus web.config, etc.)

The application dynamically generates reports and puts them in a folder with a GUID for the name which is unique to the user. This all works fine. However, when the user logs out I was cleaning up and deleting the PDF files in their folder, then deleting their GUID folder.

Deleting the files works fine, but if I delete the folder, the application recycles (which then removes all other users' sessions - I get a Session_OnEnd event for every user's session, and an Application_OnEnd event. The next user request causes the whole application to restart. So, while I can fix this by not deleting the GUID folder (which my application itself created), what is the reason for this? Is there any way I can prevent this from happening?

View 1 Replies

Web Forms :: Display Session Timeout Time Left In Minutes And Seconds?

Jul 25, 2013

sessionTimeout = sessionTimeout - 10;

I Set session timeout I wnt to show the remaining session timeout on the page and show in the format seconds i.e. 7.45min remaining

View 1 Replies

State Management :: Session Expires On File Delete?

Sep 14, 2010

I am trying to delete Files and Directory through ASP.NET3.5 (C#)web application.

But as soon as DirectoryFile is deleted It automatically redirects me to Login Page.

It means I am lossing my session on deleting File/Directory.

View 5 Replies

SQL Server :: Auto Delete Of Data From Database After A Fixed Time Interval?

Jan 11, 2011

I am using sql server 2005. In my project i wanna auto delete the data from the database after a fixed interval of time say (30 days); Is there any automatic process to delete the data from the database without the user intervention..

View 19 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved