CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011

    [RESOLVED] Class File - Timing Issue?

    I have c#/asp.net web application which has several aspx.cs. I have created a class file(cs) that contains variables and methods that is used through out the applications. My problem happens only occasionally which I believe is an timing issue among multiple users. With the debugging I have done, it appears that the variables in the class file is trying to be updated at the same time. I was thinking that the each user had their on copy of the class file, appears that is not true. What is the best practice to be able to use the same variables & methods in the class file among multiple users without mixing up the data. Is there a way to isolate each users data without declaring the same variable in each aspx.cs.

    The application was originally written using VS 2005, but been using VS 2010 for the past year for modifications.
    Last edited by godistop1; March 4th, 2013 at 02:07 PM.

  2. #2
    Join Date
    Apr 2011

    Re: Class File - Timing Issue?

    Here is the answer I got from another forum:

    You will only see non-static properties/functions etc on an instance of the class. ie;

    clsIncidFrom myClass = new clsIncidFrom();
    myClass.NonStaticProperty = "hello";
    myClass.NonStaticMethod();Whereas static properties and methods are on the class type itself, but they are shared across all users and are considered global. Each user doesn't have their own copy of the data;

    clsIncidFrom.StaticProperty = "hello";

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.