网页发布后Session值为空
我在VS2005中DEBUG时都没有问题,将网站发布后就出现未将"未将对象引用设置到对象的实例"的错误,各位大是救命啊!这个是为什么?前几天之前发布也是没有问题的,最近我在IIS中增加了一个虚拟目录,修改了一点Web.config文件中的配置,但是没有修改到关于Session相关的内容啊,怎么全这样.
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。
源错误:
行 54: if (BmName.ToString() == "" || TypeName.ToString() == "")
行 55: {
行 56: c_str = "Select * From 参数表 WHERE 所属部门=" + "'" + Session["CurBm"].ToString() + "'";
行 57: Info = new SqlDataAdapter(c_str, conData);
行 58: Info.Fill(ds);
源文件: c:\WF_pub\DevicePara.aspx 行: 56
堆栈跟踪:
[NullReferenceException: 未将对象引用设置到对象的实例。]
ASP.devicepara_aspx.BindData(String BmName, String TypeName) in c:\WF_pub\DevicePara.aspx:56
ASP.devicepara_aspx.Page_Load(Object sender, EventArgs e) in c:\WF_pub\DevicePara.aspx:24
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061