Advantages and disadvantages of using application variables in web applications

I have not used application variables in my asp.net web applications. I am using asp.net2.0. Are there any disadvantages to using application variables?

+2
source share
1 answer

What do you mean by application variables? How:

private int _key = 0;

If so, these variables are not saved between web requests. When the page is unloaded, and you should use a session or cache or viewstate to save them, for example:

ViewState["Key"] = 1;

or

Session["Key"] = 1;

And reload it here when the page loads again. If you mean something else, please comment and I will update the answer.

EDIT: For the application, check:

- , .

0

Source: https://habr.com/ru/post/1784292/


All Articles