G
Guest
Hello All
I have developed a new site using ASP.NET/VB.NET. I fell into a big problem. Here is the problem
I created a module as follow
Namespace FinancialCompany.Porta
Public Class myPropertie
Private _intCounter As System.Int3
Public Property intCounter() As System.Int3
Ge
Return _intCounter
End Ge
Set(ByVal Value As System.Int32
_intCounter = Valu
End Se
End Propert
End Class
End Namespac
Now I use this in an ASP.NET page as follow
Imports FinancialCompany.Portal.myPropertie
Namespace FinancialCompany.Porta
Public Class _defaul
Inherits System.Web.UI.Pag
Private m_test As System.Int32 = Resquest.QueryString("TEST"
Sub Page_Load(ByVal Sender As System.Object, ByVal e As System.EventArgs)
If Not Page.IsPostback Then
If m_test = 0 Then intCounter += 0
If m_test = 1 Then intCounter += 1
If m_test = 2 Then intCounter +=
Response.Write("Here is the result: " + CStr(m_test)
End If
End Sub
End Clas
End Namespac
Now when I tested this with two to five users with the following URLs
User 1: http://localhost/myproject/default.aspx?TEST=
User 2: http://localhost/myproject/default.aspx?TEST=
User 3: http://localhost/myproject/default.aspx?TEST=
If user 2 clicks the URL he gets
Here is the result:
But if user 3 cllicks the URL he gets
Here is the result:
instead of
Here is the result:
Hence the intCount property remains active for every users!!! I expect it to be a different instance for each different users
How come is it being shared??
I am using Windows 2000 Server, ASP.NET 2003, & Framework 1.
Hope someone can help me... Should I simply just use Session("intCount") instead or even Application("intCounter")
I really need to understand why the hack is intCounter being stored in memory...
Thanks
Yam
I have developed a new site using ASP.NET/VB.NET. I fell into a big problem. Here is the problem
I created a module as follow
Namespace FinancialCompany.Porta
Public Class myPropertie
Private _intCounter As System.Int3
Public Property intCounter() As System.Int3
Ge
Return _intCounter
End Ge
Set(ByVal Value As System.Int32
_intCounter = Valu
End Se
End Propert
End Class
End Namespac
Now I use this in an ASP.NET page as follow
Imports FinancialCompany.Portal.myPropertie
Namespace FinancialCompany.Porta
Public Class _defaul
Inherits System.Web.UI.Pag
Private m_test As System.Int32 = Resquest.QueryString("TEST"
Sub Page_Load(ByVal Sender As System.Object, ByVal e As System.EventArgs)
If Not Page.IsPostback Then
If m_test = 0 Then intCounter += 0
If m_test = 1 Then intCounter += 1
If m_test = 2 Then intCounter +=
Response.Write("Here is the result: " + CStr(m_test)
End If
End Sub
End Clas
End Namespac
Now when I tested this with two to five users with the following URLs
User 1: http://localhost/myproject/default.aspx?TEST=
User 2: http://localhost/myproject/default.aspx?TEST=
User 3: http://localhost/myproject/default.aspx?TEST=
If user 2 clicks the URL he gets
Here is the result:
But if user 3 cllicks the URL he gets
Here is the result:
instead of
Here is the result:
Hence the intCount property remains active for every users!!! I expect it to be a different instance for each different users
How come is it being shared??
I am using Windows 2000 Server, ASP.NET 2003, & Framework 1.
Hope someone can help me... Should I simply just use Session("intCount") instead or even Application("intCounter")
I really need to understand why the hack is intCounter being stored in memory...
Thanks
Yam