session的问题 null是不能ToString()的.要判断Session["name"]==null 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 一楼正解,要先判断是否==null session为null的时候不能.tostring() 否则会出错判断session[""]==""||session[""]==null即可 if(Session["name"] ==null || Session["name"].ToString()=="") { Response.Write(" <script> alert('网页过期,请重新登陆!');window.close() </script> "); } if (Session["s"] != null){ this.TextBox1.Text = Session["s"].ToString(); } if(Session["name"] ==null) { if(Session["name"].ToString().Length>0) { Response.Write(" <script> alert('网页过期,请重新登陆!');window.close() </script> "); } } if (Convert.ToString(Session["LoginID"]) == "" ||Convert.ToString(Session["LoginID"]) == null){ Response.Redirect("../return.aspx");} Session["name"]==nullSession["name"]为null时是不能.ToString() if(Session["name"].ToString()==string.Empty ¦ ¦Session["name"].ToString()=="") { Response.Write(" <script> alert('网页过期,请重新登陆!');window.close() </script> "); } 关于数据绑定的问题--明细显示 在线等 急 如何查看或者验证Active Directory中的邮箱密码 asp.net 移动web窗体的定时跳转 想了解一下~~.net程序员和java程序员现在哪个更吃香点~~~ 老问题新谈,从asp过渡到asp.net 请教三个关于xml/xslt的问题,一个30分! gridview自带的update语句怎么写 pageload事件 SqlDataReader 问题--在线等待 __doPostBack未定义该怎么解决 请问一下,添加xml节点怎么会出错?谢谢 取html中表格的数据
判断session[""]==""||session[""]==null即可
{
Response.Write(" <script> alert('网页过期,请重新登陆!');window.close() </script> ");
}
{
this.TextBox1.Text = Session["s"].ToString();
}
{
if(Session["name"].ToString().Length>0)
{ Response.Write(" <script> alert('网页过期,请重新登陆!');window.close() </script> ");
}
}
{
Response.Redirect("../return.aspx");
}
Session["name"]为null时是不能.ToString()
{
Response.Write(" <script> alert('网页过期,请重新登陆!');window.close() </script> ");
}