in Education by
I'm having some trouble recently. On a WebForm I declare a static object, like this : public static MyObject myobject=new MyObject(); Response.Write(myobject.Title()); now, if I load another page that doesn't contain the declaration of myobject and I do again Response.Write(myobject.Title()); I see the previosly result. Is the object stored on session during the navigation due to the static? And it's reckon by the VIEWSTATE? Or what's happening? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
No it's stored as a static variable in the process, which can be recycled at any point, assuming you use IIS. In short, try not to use static variables in this situation. To expand on what is happening. The static variable is stored in the server's process, which is controlled by IIS. It just so happens that the process is still alive when you call back onto the server. IIS can recycle this process at any time. Update: OK more accurately it is per AppDomain, which sits in a process - substitute the word process with AppDomain in my previous paragraphs :-)

Related questions

0 votes
    I'm having some trouble recently. On a WebForm I declare a static object, like this : public static ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I'm having some trouble recently. On a WebForm I declare a static object, like this : public static ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    Is there a way to share the session between ASP3 And ASP.NET? Thanks JavaScript questions and answers, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    we are developing into an asp classic application introducing new asp.net pages. The session variables are ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I am facing a very strange problem. Actually I developed a web application in ASP.NET using C#. My ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 21, 2022 in Education by JackTerrance
0 votes
    If I am trying to determine the read speed of a drive, I can code a routine to write files to a ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    Basically I want to achieve using a lock to a property that has no private variable, the goal is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 5, 2022 in Education by JackTerrance
0 votes
    I am building a small website for fun/learning using a fairly standard Web/Service/Data Access layered ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    I am building a small website for fun/learning using a fairly standard Web/Service/Data Access layered ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    I am building a small website for fun/learning using a fairly standard Web/Service/Data Access layered ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    I am building a small website for fun/learning using a fairly standard Web/Service/Data Access layered ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    guys, I've been developing an iphone web application for a while, and encountered a weird problem: when ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I've got a method that reads settings from my config file like this: var value = ConfigurationManager. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    How do I implement a Copy menu item in a Windows application written in C#/.NET 2.0? I want to ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
0 votes
    I've created a seperate assembly with a class that is intended to be published through wmi. Then I' ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 24, 2022 in Education by JackTerrance
...