consider this code:
Partial Public Class MyAspNETClass
Inherits System.Web.UI.Page
Protected Shared MyVariable As String
....
....
2 questions:
- Is Myvariable a variable used local for each instance of the page ? Or that variable is "shared" for all users accessing my page ?
- Is MyVariable sa开发者_如何学运维ved in server memory, or is it saved on the viewstate of aspx page ?
This is 2 doubt i can't answering by myself, so i'm asking you ! Thanks
Because MyVariable
is Shared
it will be allocated in memory only once and shared by every instance of the class.
It is not stored in the ViewState
精彩评论