关于URL的 现在我想实现这样的功能。只有用户登陆后台管理系统后,(比如添加新闻),点击添加新闻的按扭,才能跳转到addnews.aspx这个页面。如果用户没有登陆,而是直接在地址栏中输入...addnews.aspx的时候,就使其跳转到首页!!请问该怎么实现?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用SESSION里存放用户登录信息,进入addnews.aspx这个页的时候,判断他是否是合法用户,不是就转到首面。 public void LoginValite(){ if(LoginUserCode==null) { Response.Redirect("~/login.aspx"); }} 怎样判断是合法的用户???原来我在Page_Load函数中是这样写的 if(Session["userID"].ToString()==""){ Server.Transfer("index.aspx");} else{}但是不知道怎么来判断Session["userID"].ToString();的值为空?请zhangxiaopin(zxp) 再说明一下了,谢谢了 if(Session["userID"] == null)或者try{Session["userID"].Tosting();}catch(System.NullRefreException){Response.redirect("index.aspx")} if(Session["userID"]==null) Response.Redirect("index.aspx");else//操作 asp.net 创建控件时出错 如何将winform代码改成webform代码? 菜鸟问题:统计记录与显示 ===============用过母版的来看看!!!=============== SqlDataSource.SelectParameters的格式化参数问题 【北京】招聘asp.net开发人员 如果gridview里面如果没有数据时,就会显示空白,要怎样设置,没有数据时,列头也能显示出来? 请教大家两个问题,请进.. DataGrid邦定的时候需要把英文列翻译成中文 招聘ASP.NET程序员 如何获取动态生成的控件的值 新手,请问各位?
{
if(LoginUserCode==null)
{
Response.Redirect("~/login.aspx");
}
}
原来我在Page_Load函数中是这样写的
if(Session["userID"].ToString()=="")
{
Server.Transfer("index.aspx");
}
else
{
}但
是不知道怎么来判断Session["userID"].ToString();的值为空?请zhangxiaopin(zxp) 再说明一下了,谢谢了
或者
try
{
Session["userID"].Tosting();
}
catch(System.NullRefreException)
{
Response.redirect("index.aspx")
}
Response.Redirect("index.aspx");
else
//操作