我在装有VS2005的自己机子上配置一个网站,运行都没发现错误,怎么一配置到局域网的一台相同Wind2003SP1机子上(只有装.NET Framewok2.0),怎么一打开这个网站,马上就出现了
Object reference not set to an instance of an object.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
而且我观察了一下,几乎都是Cookies空异常问题
如:
HttpContext.Current.Request.Cookies["AdminRole"].Value.ToString().ToLower()这个地方就出错---------------------------------------错的模块都在进行权限判断模块。
该Cookies["AdminRole"]的值来源于,用户初次登陆我给它赋值的= cookie.Value = "progadmin";
Response.Cookies.Add(cookie);
//设置半小时后Cookies过期
HttpContext.Current.Response.Cookies["AdminRole"].Expires = DateTime.Now.AddHours(1.5);
//2007-10-12解决针对部分页面该Cookies策略
Response.Cookies["AdminRole"].Path = "/";
各位看看,究竟是我对Cookies的赋值写法有错,还是其他因素
Object reference not set to an instance of an object.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
而且我观察了一下,几乎都是Cookies空异常问题
如:
HttpContext.Current.Request.Cookies["AdminRole"].Value.ToString().ToLower()这个地方就出错---------------------------------------错的模块都在进行权限判断模块。
该Cookies["AdminRole"]的值来源于,用户初次登陆我给它赋值的= cookie.Value = "progadmin";
Response.Cookies.Add(cookie);
//设置半小时后Cookies过期
HttpContext.Current.Response.Cookies["AdminRole"].Expires = DateTime.Now.AddHours(1.5);
//2007-10-12解决针对部分页面该Cookies策略
Response.Cookies["AdminRole"].Path = "/";
各位看看,究竟是我对Cookies的赋值写法有错,还是其他因素
解决方案 »
- vs2010建的3.5项目里怎么使用mschart?
- 谁有比较好的自己写的Listbar代码 1.1的就可以
- sql参数问题?
- 跪求高手指点,跨系统登录问题。。。
- 导出EXCEL后怎么不让在EXCEL中显示乱码?
- dataview中的数据可以用select语句来查询吗?
- Gridview 和 DropDownList 亲密接触 ?????
- 怎样在dropdownlist 的selectindexchanged 找到放在 datagrid 脚里的控件
- 快捷方式的名称
- 带后台管理的网站,网页以什么格式存储较好?数据库,html?
- 一个管理系统的用户权限怎么设计(设计思路)
- ajax制作网页版MP3播放器!!!!!!!!!!!!!!!!!!!!!!!!!!!
了。为什么还会这样者了。另外又多了个概念要问大家:
到底静态方法跟非静态方法有什么具体差别。
Cookie没事,用户也可以自己清除的。
简单区别,不用实例化呗,用起来简单