if(!Page.IsPostBack)
{
string us;
us=Convert.ToString(Session["userclass"]);
if(us.Trim()=="系统管理员"||(int)Session["addnews"]==1||(int)Session["addnchk"]==1)
{getClass();}
else
{Page.Visible=false;}
}
未将对象引用设置到对象的实例。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。行 264: string us;
行 265: us=Convert.ToString(Session["userclass"]);
行 266: if(us.Trim()=="系统管理员"||(int)Session["addnews"]==1||(int)Session["addnchk"]==1)
行 267: {getClass();}
行 268: else
源文件: c:\inetpub\wwwroot\webnews\admin\admin_articleadd.aspx.cs 行: 266
{
string us;
us=Convert.ToString(Session["userclass"]);
if(us.Trim()=="系统管理员"||(int)Session["addnews"]==1||(int)Session["addnchk"]==1)
{getClass();}
else
{Page.Visible=false;}
}
未将对象引用设置到对象的实例。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。行 264: string us;
行 265: us=Convert.ToString(Session["userclass"]);
行 266: if(us.Trim()=="系统管理员"||(int)Session["addnews"]==1||(int)Session["addnchk"]==1)
行 267: {getClass();}
行 268: else
源文件: c:\inetpub\wwwroot\webnews\admin\admin_articleadd.aspx.cs 行: 266
解决方案 »
- c#.net发布程序出现错误
- 关于在C#中应用Ajax的问题
- 急!救命啊!
- 求教我在VS2003.net下的DataGrid控件的单元格中通过样式添加了ComboBox控件但是如何得到SelectValue
- 100分求救PictureBox问题!!
- c# socket 异步socketAsyncEventArgs效率问题,有源码
- 请问各位高手,他这里为什么用到委托?
- 如何让dataset在C#中绑定System.Data.OleDb.OleDbConnection
- 一个WPF中动画特效的问题
- c#电信结算业务的项目中,能使用tuxedo中间件吗?
- winform下的listview怎样在首列加入checkbox,怎样点击列头以排序,怎样分页?
- 关于post数据的问题,很莫名其妙,弄了一下午
{
us=Convert.ToString(Session["userclass"]);..
}
{
string us;
us=Convert.ToString(Session["userclass"]);
if(us.Trim()=="系统管理员"||(int)Session["addnews"]==1||(int)Session["addnchk"]==1)
{getClass();}
else
{Page.Visible=false;}
}
{
string us;
us=Convert.ToString(Session[ "userclass "]);
if(Session[ "userclass "] != null)
{getClass();}
else
{Page.Visible=false;}
}
在浏览器中出现的页面什么也没有是空白。