我有类定义静态变量,它工作正常,但当不同的人登录时,值被覆盖。 就像我以user1身份登录而我选择LocationFrom = 3它工作正常但是当user2登录并且他选择locationFrom = 2时,那么在不同的PC和浏览器上我的LocationFrom也设置为2,当我刷新我的页面user1和user2都将locationFrom设置为3,以下是我的代码中的示例
public partial class ABC: System.Web.UI.Page
{
static string LoacationFrom;
static string LocationTo;
[System.Web.Services.WebMethod]
public static void locatFrom(string LocFrom)
{
LoacationFrom = LocFrom;
}
[System.Web.Services.WebMethod]
public static void LocatTo(string LocTo)
{
LocationTo = LocTo;
}
protected void ExecuteReport_Click(object sender, EventArgs e)
{
//do something
}
}