当前上下文中不存在名称"Session"
来源:互联网 发布:电商可变数据印刷 编辑:程序博客网 时间:2024/05/16 06:11
using System;using System.Web;/// <summary>/// Summary description for CodeDemo/// </summary>public class CodeDemo{ public CodeDemo() { // // TODO: Add constructor logic here // } //下面列举了几个对象与方法 public void t() { HttpContext.Current.Session["mykey"] = "Session content"; HttpContext.Current.Response.Write("Write content."); HttpContext.Current.Server.MapPath(@"z:\...\"); }}
一些对象或是方法,如Session, Response,Server等等,无法在类别中直接打,是因为没有在类别中引用它们的名称空间。这个名称空间(namespace):System.Web。另外它们正确的写为HttpContext.Current.Session,HttpContext.Current.Response 和HttpContext.Current.Server。
参考:
0 0
- 当前上下文中不存在名称"Session"
- 当前上下文中不存在名称"Session"
- 当前上下文中不存在名称 ***
- 当前上下文中不存在名称 "Invoke "
- “当前上下文中不存在名称”解决
- 当前上下文中不存在名称“Response”
- 当前上下文中不存在名称 AspNetPager*
- 当前上下文中不存在名称“ConfigurationManager
- “当前上下文中不存在名称”解决
- 当前上下文中不存在名称 GridView1
- 当前上下文中不存在名称“Request”
- 在当前上下文中不存在名称“InitializeComponent”
- 当前上下文中不存在名称XXX
- 解决 当前上下文中不存在名称 c#
- 当前上下文中不存在名称“ViewBag”
- 当前上下文中不存在名称“ViewBag”
- 当前上下文中不存在名称XXX
- 【牛腩】当前上下文中不存在名称"..."
- ShareSDK for Android版本:V2.3.12发布
- 如何使用java创建json对象
- 微信
- Kobject and Kset
- KMP
- 当前上下文中不存在名称"Session"
- 部署app到模拟器时卡住Eclipse,会导致Eclipse关不了
- Tomcat 运行时,一闪而过。
- android scroller
- error: insufficient permissions for device
- PermGen space 异常解决办法
- 消息推送--证书
- First Missing Positive
- 理解冒泡排序的算法,很简单