单页登录 [英] Single Page Login

查看:87
本文介绍了单页登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三个单独的.aspx页面,它们分别处理,登录,创建用户和重置密码.我想做的是将它们全部合并到我的default.aspx pag中,如果用户不进行身份验证,则利用面板隐藏主要内容.

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.

所以我的Page_Load看起来类似于以下内容:

So my Page_Load wil look something similar to this:

Page_Load 
{
  if (User.IsAutheticated)
  {

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

我的WebConfig,当前包含以下值以对用户进行身份验证:

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>

关于如何将其全部作用于一个页面的任何想法-Default.aspx?

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

推荐答案

对此进行了排序.将Login.aspx更改为Default.aspx-UpdatePanel出现了一些问题,但这是由于解决方案驱动器已更改.

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.

这篇关于单页登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆