Re: VERY IMPORTANT: Sharing

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Yama (anonymous_at_discussions.microsoft.com)
Date: 02/09/04


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
>



Relevant Pages

  • Re: Set Crystal Report Namespace
    ... how can I go about and set a Crystal Reports namespace? ... >> they use the Root Namespace from the project. ... report. ... The Crystal Report file should go under the correct namespace in the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Set Crystal Report Namespace
    ... how can I go about and set a Crystal Reports namespace? ... >> they use the Root Namespace from the project. ... report. ... The Crystal Report file should go under the correct namespace in the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Set Crystal Report Namespace
    ... how can I go about and set a Crystal Reports namespace? ... >> they use the Root Namespace from the project. ... report. ... The Crystal Report file should go under the correct namespace in the ...
    (microsoft.public.vb.crystal)
  • Re: namespaces in unit names in D7
    ... probably an undocumented feature? ... > I have seen a report on QC where code completion would add the own unit ... > namespace supported is limited on D7. ...
    (borland.public.delphi.non-technical)
  • [WR] Peterhead 31.05.2007
    ... Correction to my report last evening: ... I could claim the error as a typo but in fact it was owing to incompetence - sorry (-: ...
    (uk.sci.weather)