Single Page Login

时光毁灭记忆、已成空白 提交于 2019-12-11 13:54:12

问题


I have three separate .aspx pages that handle, logging in, creating a user, and reseting a password. What i want ot do is merged them all into my default.aspx pag and by utilizing panels hide the main content if the user isn't autheticate.

So my Page_Load wil look something similar to this:

Page_Load 
{
  if (User.IsAutheticated)
  {

     this.pnlLoggedIn.Visible = true;
  }
  else
  {
    this.pnlNotLoggedIn.Visible = true;
  }

My WebConfig, currently holds these values to authenticating a users:

   <location path="CreateUser.aspx">
   <system.web>
     <authorization>
       <allow users="?"/>
     </authorization>
   </system.web>
   </location>
  <location path="RetrievePassword.aspx">
  <system.web>
    <authorization>
     <allow users="?"/>
   </authorization>
  </system.web>
 </location>

<authentication mode="Forms" >
    <forms loginUrl="Login.aspx"
      name=".ASPXFORMSAUTH"  />
  </authentication>

  <authorization>
    <deny users="?" />
  </authorization>

Any ideas on how to role this all up into a single page - Default.aspx?


回答1:


Sorted this. Changed the Login.aspx to Default.aspx - had some issues with an UpdatePanel, but this was due to the solution drive being changed.



来源:https://stackoverflow.com/questions/15614747/single-page-login

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!