asp.net 中Request.IsAuthenticated else 不执行 问题
if (Request.IsAuthenticated){ FormsIdentity identity = (FormsIdentity)User.Identity; FormsAuthenticationTicket ticket = identity.Ticket; string strUserID = User.Identity.Name; string strCompany = ticket.UserData.Split("|".ToCharArray())[0];}else{ lal_text.Value= "游客!";}
web.config<authentication mode="Forms"> <forms name="webUserKey" loginUrl="login.aspx" defaultUrl="index.html" protection = "All" timeout="5"></forms></authentication>