Is it necessary to lock application state before accessing it ?
Answer / kumar saurabh
Only if you're performing a multistep update and want the update to be treated as an atomic operation. Here's an example:
Application.Lock ();
Application["ItemsSold"] = (int) Application["ItemsSold"] + 1;
Application["ItemsLeft"] = (int) Application["ItemsLeft"] - 1;
Application.UnLock ();
By locking application state before updating it and unlocking it afterwards, you ensure that another request being processed on another thread doesn't read application state at exactly the wrong time and see an inconsistent view of it.
| Is This Answer Correct ? | 0 Yes | 0 No |
which event in global.asx that fires for every request of same user?
What r new things introduced in ASP.NET 2.0 in comparision to ASP.NET 1.1
Which namespace do the classes, allowing you to support COM functionality, are located?
How we can bind textbox,listbox and datagrid to sql server database in asp.net using visualstudio.net language (vb.net)?
Explain what is postback in asp. Net?
What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
What is server components?
Where sessions are stored?
which is faster ArraytList Or Collection ? how? hows the Hashing works internally ?
What is the maximum number of classes that can be contained in one dll file?
What does the "EnableViewState" property do? Why would I want it on or off?
2 Answers Photon Infotech, Siebel Systems, Syntax Softtech,
What is postback and autopostback in asp.net?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)