多个登录显示不正确的值。

问题描述:

你好,

我正在开发一个在线购物Portal.in,我在我的母版页上给出了购物车的概述。

我用过的静态变量当另一个用户同时从其他计算机登录时,类没有变得清晰,因此显示不正确的数据,即USER 1的总量显示为USER 2

Hello,
I am developing an online shopping Portal.in that i give the overview of the cart on my master page.
The static variables i have used in Class is not getting clear when another user logs in simultaneously from other computer hence showing incorrect data i.e the total amount of USER 1 is shown to USER 2

使用 会话 [ ^ ]而不是静态变量。



也可以通过在ASP.NET中探索会话 [ ^ ]了解有关会话及其使用的更多信息。
Use Sessions[^] instead of Static Variables.

Also go through Exploring Session in ASP.NET[^] to know more on Sessions and its use.