Re: VERY IMPORTANT: Sharing
From: Yama (anonymous_at_discussions.microsoft.com)
Date: 02/09/04
- Next message: Felix Wu [MSFT]: "Re: Web App need permission to post files to a virtual directory"
- Previous message: Ken Cox [Microsoft MVP]: "Re: VERY IMPORTANT: Sharing"
- In reply to: Ken Cox [Microsoft MVP]: "Re: VERY IMPORTANT: Sharing"
- Next in thread: Yama: "RE: VERY IMPORTANT: Sharing"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 8 Feb 2004 17:41:06 -0800
Hi Ken,
Thanks for correcting the typo. I typed an demo program to present my case... :-) Sorry for the typo.
The bug is that two different user can share the same session. So for instance:
--- if I am userA on computer A
--- and you are userB on computer B
--- if userA is viewing ReportA
--- then userB although trying to view ReportB will see ReportA...
I have report name as a string property called strReportName that keeps track (kinda like a session variable) of the report name. But when userA selects the report userB will share that report name...
Hopefully that is a little more self-explanatory.
Yama Kamyar
----- Ken Cox [Microsoft MVP] wrote: -----
Not sure this is your problem, but I noticed a typo:
Private m_test As System.Int32 = Resquest.QueryString("TEST")
Should be Request
"Yama" <anonymous@discussions.microsoft.com> wrote in message
news:52DBB56C-1DE9-4BF8-8A2D-6D70B732538D@microsoft.com...
> 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.Portal
> Public Class myProperties
> Private _intCounter As System.Int32
>> Public Property intCounter() As System.Int32
> Get
> Return _intCounter
> End Get
> Set(ByVal Value As System.Int32)
> _intCounter = Value
> End Set
> End Property
> End Classs
> End Namespace
>>> Now I use this in an ASP.NET page as follow:
>> Imports FinancialCompany.Portal.myProperties
>> Namespace FinancialCompany.Portal
> Public Class _default
> Inherits System.Web.UI.Page
>> 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 += 2
>> Response.Write("Here is the result: " + CStr(m_test))
> End If
> End Sub
> End Class
> End Namespace
>> Now when I tested this with two to five users with the following URLs:
>> User 1: http://localhost/myproject/default.aspx?TEST=0
> User 2: http://localhost/myproject/default.aspx?TEST=1
> User 3: http://localhost/myproject/default.aspx?TEST=2
>> If user 2 clicks the URL he gets:
> Here is the result: 1
>> But if user 3 cllicks the URL he gets:
> Here is the result: 3
> instead of:
> Here is the result: 2
>> 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.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,
>> Yama
>
- Next message: Felix Wu [MSFT]: "Re: Web App need permission to post files to a virtual directory"
- Previous message: Ken Cox [Microsoft MVP]: "Re: VERY IMPORTANT: Sharing"
- In reply to: Ken Cox [Microsoft MVP]: "Re: VERY IMPORTANT: Sharing"
- Next in thread: Yama: "RE: VERY IMPORTANT: Sharing"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|