State Management :: Clear Private Static Collections?
Aug 9, 2010
I am working on rewriting an application. The previous developers have declared some Private static hashtables within a class in a class library. The first time when the application runs, this hashtable gets populated by running the query. After that this hastable is refrenced elsewhere to get the employee information.Even if the employee is removed from the DB, he is still able access the application, Since the private static hashtable holds the employee information. I totally understand that the hashtable is referenced to prevent the DB calls everytime.
The problem is even after closing the browser and restarting the application the hashtable holds the employee information. How do i get clear this so that it calls the DB?
View 9 Replies
Similar Messages:
Aug 2, 2010
I need to clear private data programmatically when someone clicks logout ?
View 5 Replies
Mar 26, 2011
I have a private static field in my Controller class in an MVC web application.
I have a static method in that controller that assigns some value to that static field, I want to apply lock on that static field until some other instance method in the controller uses the value stored in the static field and then releases it.
DETAILS:
I have a controller named BaseController having a static ClientId field as follows and two methods as follows:-
public static string ClientId = "";
static void OnClientConnected(string clientId, ref Dictionary<string, object> list)
{
list.Add("a", "b");
// I want the ClientId to be locked here, so that it can not be accessed by other requests coming to the server and wait for ClientId to be released:-
BaseController.clientId = clientId;
}
public ActionResult Handler()
{
if (something)
{
// use the static ClientId here
}
// Release the ClientId here, so it can now be used by other web requests coming to the server.
return View();
}
View 1 Replies
May 26, 2010
I have a form that takes the user information. When the user submits the form, after the postback, I need to get all some of the textboxes in the form cleared. I tried disabling the ViewState and ViewStateMode. But both of them failed. Also tried disabling the cacheability for the page. I know I can clear the textboxes on the page load event. But I am curious to know if there is another way to do this.
View 7 Replies
Nov 25, 2010
I am using master page and i use session id to identify coming user before navigation
i have a link button to logout ..this link button only will navigate to login page
once navigated if i click back i am still able to browse the page
clickin logout button not cleanin the session? how to avoid page click back?
or how to clear session id when user click logout?
View 7 Replies
May 24, 2010
I have multiple sites with main and subdomain. all doing one same method for the login. login is done with the multi domain cookie but there is problem with the logout. I'm using cookie and session for that state.
When ever I logout form the any domain. I should logout form the all domain.
(Like yahoo or google)
As per my method , My all domain have logout page which has code
[Code]....
and main site(www.domain.com) have
[Code]....
So what can I change in this code to do the Logout process for the all subdomains.
View 3 Replies
Aug 4, 2010
I have a report parameter page which contains many pop up windows for the parameter selection. For example, for driver , there is a pop up window called driver.aspx which contains a listbox that contains list of driver's name.
Now, for each of these pop up windows, i am passing the values of these windows as a session value.
Now, when a user logs in the system, there are many parameter pages for different reports which commonly share the same pop up windows if the parameters are same for different reports.
The problem now is,a user selects 10 drivers for report 1 and runs it. When he goes to report 2 and runs the report, the report 2 takes only those 10 drivers as the driver parameter value.
It means, the error can arise on the system because he may forgot that he have selected 10 drivers for previous report 1. User will not have time to recheck each previous selected values of different paramaters.
What i want is, when a person moves from one report page to another, i want to clear all the session values and adjust it as default for the new report .
View 6 Replies
Sep 17, 2010
how to clear cokkies when my website open
View 3 Replies
Aug 23, 2010
How to set session timeout and clear session in web.config and login.aspx ? And when we close the web application , the session must be cleared? I have use session.abandon as per below but is not working.
protected void btnLogout_Click(object sender, EventArgs e)
{
Session.RemoveAll();
Session.Abandon();
Response.Redirect("LoginPage.aspx");
}
View 3 Replies
Dec 21, 2010
I have 4 webpages. In those pages, i am using session variables,viewstates,cookies. I am passing session variables,viewstates to different pages. Now the problem is sometimes i am getting the old cookie values or session values. I want to clear all these things when i close the browser or if i open a new tab of browser.
View 10 Replies
Jun 17, 2010
I am wondering if it is possible to clear a session variable if the user navigates away from my site.
My example is I have a session storing the logged in user. This is checked for user access to each page.
If the user goes to another site (e.g. google) I want them to relog into the site.
This is to prevent others getting access to a users account if they use the same pc minutes.
I do have a logout that performs this and I know that it is impossible to make users use it! :)
View 2 Replies
May 17, 2010
I would like to clear sessions after hitting back button . Iuse the java script to disable back button how can i clear sessions now after hitting back button.
I use the following script
<script type="text/javascript">
function preventBack(){window.history.forward();}
setTimeout("preventBack()", 0);
window.onunload=function(){null};
</script>
View 6 Replies
Sep 18, 2010
I am using asp.net 3.5 and use master pages for most of the website. I need to make sure that users after they logout are not able to use the back button to see in cache data.
View 4 Replies
May 26, 2010
I am caching a file in ttpContext.Current.Application object. Now when I change the values in file, it does not get reflected in the application (I am reading the values from the file for app version).
Even after restarting the app pool and the website in IIS, the changes does not reflect. I dont want to restart IIS.
View 1 Replies
Sep 16, 2010
my understanding static/shared objects will be saved in a memory that is shared by all instances of the asp.net application,so if we set a value to shared object from inst1 & i should be able to access it via instance2(may be in same computer or anywhere)Actually:In my vb.net application,previously they defined shared dataset to hold some information specific to the user,still now i cant reproduce the error that same value shared across all application instances.Please help me to solve or clarify this.
[URL]
View 3 Replies
Sep 24, 2010
I know the big difference, but one thing is confusing me. Cache works only on a single machine on webfarm and to make it globally we use Velocity or memcache.So is static does same, or is it already work globally ?
eg
Cache["someid"] = "value"; //this will only work on single machine cache,
static string abc = "value"; // will this work on single machine or globally ?
View 6 Replies
Jul 3, 2010
Currently I have my data cached in Datasets in a static class. I was talking to my cousin's husband, who works as a C# developer for our local Telecom company.
Basically, I'm pretty new to ASP.NET and although to me having cached data in a static class makes sense to me, when I talked to him about it, he said there might be a problem when the site goes live, as on a web server more than one instance of the class may be created.
He did say this was a theory, and it was an area he didn't know an awful lot about, so I thought I'd ask some of you ASP.NET gurus to see if what I've done is totally wrong or not.
View 12 Replies
Jul 20, 2010
I have an content page that got
<%@ OutputCache Duration="600" VaryByParam="*" %>
Now i want to display a link on the same content page that actually clear the cache.
[Code]....
But its just not working, What i am doing wrong here?
View 5 Replies
Nov 20, 2010
how to create a logout page that clears the session and cookies??? using c# .net...
View 5 Replies
Mar 25, 2011
Which one is faster? For a dropdownlist binding it the first time and using ViewSate or Turning of viewstate, keeping the data in a static datatable and binding the dropdownlist each time on a postback
View 7 Replies
Oct 29, 2010
I am creating a static variable and adding to session.This variable has value that is user specific. Now I am getting a problem with this users are complaining that they are getting values that should be another users. It's like a mix up with session. Could this be because of static variable declaration?
View 2 Replies
Jul 2, 2010
What is difference between Application object and static variable? Where these are stroed in memory.
View 4 Replies
Oct 17, 2010
I want to know , how good / bad is it to save configuration values in a static properties?I am creating an application which reads configuration from an XML file and a DataContext file, instead of sending the CustomConfig class into the configuration.xml each time I tought about using an ReadXml() method on application_start at the global.ascx
the ReadXml() method would save the data in static properties of CustomConfig and whereever I would want to read that particler data I would ask CustomConfig.PROERTY_NAME
My question is ? how smart it is ? how long does IIS would save the data in a static member? (if as long as the application exists then I'm ok as long as I add the ReadXml() in the application_start)
View 2 Replies
Nov 18, 2010
I need to keep a global variable throughout the whole time the user is at my site, but do I use Application or a static class? The string variable should store a region name and my site makes a few changes depending on which region that has been set.
I read that Application was mainly for classic ASP, but I also read that a static class cannot be instantiated at runtime (e.g. when the user has logged in).
So, have I got something wrong here and which solution do I use?
View 2 Replies
Feb 25, 2011
when we go for client and server side state management in asp.net
View 2 Replies