Application variable is reflected in the current sessions of all users. For example, we may like to fix variables like tax rate, discount rate, company name, etc., that will be specified once for all variables we can access in a session.
Creating an application variable is similar to session variables.
Application(“legal_notice”) = “No part of this article may be reproduced without prior permission”
There is a concern when changing the value of an application variable: at any particular instant, multiple sessions might be trying to change the value, although only one session can be allowed to change it. ASP.NET has an in built mutual exclusion for dealing with these types of problems.
- Application.Lock – Locks the application variables
- Application.Unlock – Unlocks the application variables
Once application variables are locked sessions that attempt to change them have to wait.
No comments:
Post a Comment