Reputation: 12663
When I declare a static
member in the code behind file of aspx class. For example
public partial class MyAspNetPage : System.Web.UI.Page
{
public static int IntVal;
}
As far as I know, the static
member of a class is shared by all the instances of that class. How static member works in Asp.Net requests? The IntVal
value is NOT shared among all the requests to the MyAspNetPage
right? Can somebody explain and clarify? Thanks.
Upvotes: 0
Views: 65
Reputation: 13286
Any static variable in ASP.NET is shared among all requests and users of the application.
Upvotes: 1