Global Variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top