CJe*_*CJe 6 .net c# asp.net session session-variables
我有这个非常奇怪的问题,我确信我在这里遗漏了一些明显的东西.我有这两行:
HttpContext.Current.Session[listModelType + "ListModel"] = listModel;
listModel.ProductRows = new Collection<ProductRow>(listModel.ProductRows.Where(r => r.ParentRowId == 0).ToList());
Run Code Online (Sandbox Code Playgroud)
执行第二行后,我的会话对象也会更新(根据Visual Studio中的"Watch")
我在这里错过了什么?
我试过了
int i = 0;
HttpContext.Current.Session["i"] = i;
i++;
Run Code Online (Sandbox Code Playgroud)
和HttpContext.Current.Session ["i"]保持为0.