Session_Control.cs:
public class Session_Control
{
protected HttpSessionState Session;
public bool Check_Session()
{
if (Session["UserName"]==null)
{
return true;
}
else return false;
}
}Main.aspx调用的时候:
Session_Control ISLogin = new Session_Control();
if (ISLogin.Check_Session())
{
Response.Redirect("Login.aspx");
}
else
{
Response.Write("Main.aspx");
}总是提示:未将对象引用设置到对象的实例
public class Session_Control
{
protected HttpSessionState Session;
public bool Check_Session()
{
if (Session["UserName"]==null)
{
return true;
}
else return false;
}
}Main.aspx调用的时候:
Session_Control ISLogin = new Session_Control();
if (ISLogin.Check_Session())
{
Response.Redirect("Login.aspx");
}
else
{
Response.Write("Main.aspx");
}总是提示:未将对象引用设置到对象的实例
解决方案 »
- WebForm_PostBackOptions 未定义
- 怎么控制客户端用户的单击次数?
- 麻烦各位大侠推荐一本asp.net(C#)开发的好书
- 向自定义控件 传值 问题?
- asp.net 读取excel问题
- 为什么我有时使用Freetextbox保存到数据库时出错呢?
- 请高手快接呀!!datagrid按钮列的使用问题,急急~
- asp.net下DataGrid 点编辑后,怎么让这行的第一个文本框获得焦点?(继续讨论)
- 利用两个dropdownlist值进行查询,让其查询结果显示在第三个dropdownlist里
- 求一个jquery图片轮播的插件
- VS NET2003出现这样问题 如何啊?(在线等)
- 谁能帮我解释一下每行的意思嘛??谢谢了。我是新手
public class Session_Control
{
protected HttpSessionState Session;
public bool Check_Session()
{
if (Session["UserName"]==null)
{
return false;
}
else return true;
}
}