Global Variable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dennis

    #1

    Global Variable

    Hi,

    I have declared a global variable in module using the following syntax
    (without Class) in my ASP.NET application:
    Public UserName As String

    There is no problem for me to share the value among all the webforms.
    However, the value can be overwritten by another client/computer who is
    accessing to the application. For example:

    1st user set UserName="abc" and 2nd user set UserName="xyz". In this case,
    the 1st user will get the "xyz" instead of "abc". Any idea to prevent the
    value to be overwritten by other client? Thanks.

    Dennis.
  • Cor Ligthert

    #2
    Re: Global Variable

    Dennis,

    Yes by not using for this shared subs or modules.

    A shared sub (module) and cach belongs to the application. That is why I say
    forever that a webapplication (the serverside) can be seen as a middle tier.

    Here is better to use the session.item

    I hope this helps,

    Cor


    Comment

    • Dennis

      #3
      Re: Global Variable

      Thanks, Cor.

      Dennis.
      -----------------

      "Cor Ligthert" wrote:
      [color=blue]
      > Dennis,
      >
      > Yes by not using for this shared subs or modules.
      >
      > A shared sub (module) and cach belongs to the application. That is why I say
      > forever that a webapplication (the serverside) can be seen as a middle tier.
      >
      > Here is better to use the session.item
      >
      > I hope this helps,
      >
      > Cor
      >
      >
      >[/color]

      Comment

      Working...