Request.IsAuthenticated =false的问 HttpContext.Current.Request.IsAuthenticated == true用表单提交登录后,在一个类里判断是否登录成功IsAuthenticated 总是=假,为什么以前不在表在中好用啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 自定义类public class Class1{ public string Mth() { return HttpContext.Current.Request.IsAuthenticated.ToString(); }}页面调用 protected void Button1_Click(object sender, EventArgs e) { Class1 c = new Class1(); Response.Write(c.Mth()); }返回值为true; if (HttpContext.Current.User != null) { if (HttpContext.Current.Request.IsAuthenticated == true) //验证过的一般用户才能进行角色验证 { System.Web.Security.FormsIdentity fi = (System.Web.Security.FormsIdentity)HttpContext.Current.User.Identity; System.Web.Security.FormsAuthenticationTicket ticket = fi.Ticket; //取得身份验证票 } return ""; } else return "";还是不行啊 Form表单的验证。具体的可以看看网上的资料。cnbologs上有你可以去看看 webconfig裡是不是沒有設置Form驗證啊 <!--验证方式及设置--> <authentication mode="Forms"> <forms loginUrl="LoginDl.aspx" name=".yinyuebbCoName"></forms> </authentication> <authorization> <allow users="*"/> </authorization>这样设置的 VS2012 asp.net网站如何发布 关于跨服务器访问数据库的疑问? gridview中,用ajax实现dropdownlist联动,出现“回发或回调参数无效”错误!! web.conifg的问题 图片上传程序大家通常都是怎么搞的? 应用程序如何看到dll文件中方法的注释? 为什么在用到框架的时候无法显示SCR中的控件? 请教个样式表的问题,谢谢大家了!! 把程序转到win2000server下的问题,各位指点一下? 如何让asp.net网页跳到错误指定页? 请问asp.net如何遍历导出数据库为sql文件 gridview中js与checkbox结合,无法获取checkbox选中?
public class Class1
{
public string Mth()
{
return HttpContext.Current.Request.IsAuthenticated.ToString();
}
}
页面调用
protected void Button1_Click(object sender, EventArgs e)
{
Class1 c = new Class1();
Response.Write(c.Mth());
}
返回值为true;
{
if (HttpContext.Current.Request.IsAuthenticated == true) //验证过的一般用户才能进行角色验证
{
System.Web.Security.FormsIdentity fi = (System.Web.Security.FormsIdentity)HttpContext.Current.User.Identity;
System.Web.Security.FormsAuthenticationTicket ticket = fi.Ticket; //取得身份验证票
}
return "";
}
else
return "";还是不行啊
<!--验证方式及设置-->
<authentication mode="Forms">
<forms loginUrl="LoginDl.aspx" name=".yinyuebbCoName"></forms>
</authentication> <authorization>
<allow users="*"/>
</authorization>
这样设置的