Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想根据页面标题创建会话值。如果我调试代码,则不会出现会话值。我无法抓住任何价值。有人可以帮助我吗?
这是我的代码
string pageTitle = new PageManager().GetPageNode(new Guid(SiteMapBase.GetCurrentProvider().CurrentNode.Key)).Title; Session['"' + pageTitle + '"'] == true
将您的代码更改为:
string pageTitle = new PageManager().GetPageNode(new Guid(SiteMapBase.GetCurrentProvider().CurrentNode.Key)).Title; Session[pageTitle] = true; //remove double = as it is for comparing, //also get rid of single quotes