由于web.config中的身份验证,无法转到注册页面 [英] Unable to go to sign up page due to authentication in web.config

查看:88
本文介绍了由于web.config中的身份验证,无法转到注册页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我已经锁定了用户,直到他登录到他无法访问任何其他URL的应用程序。但是现在由于身份验证,我甚至无法打开我的注册页面。我试过了< location>在web.config中为SignUp标记,但它不起作用。请提出一些解决方案。

Hi,

I have locked down the user until he login's into the application he can't access any other URL. But now i'm unable to even open up my sign up page due to that authentication. I have tried down the <location> tag in web.config for SignUp but its not working. Please suggest some solution.

<location path="">
    <system.web>
      <authorization>
        <deny users="?" />
      </authorization>
    </system.web>
  </location>

  <location path="~/SignUp">
    <system.web>
      <authentication mode="Forms">
        <forms loginUrl="~/SignUp" timeout="20"/>
      </authentication>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  
  <system.web>
    <httpRuntime targetFramework="4.5" />
    <compilation debug="true" targetFramework="4.5" />
    <authentication mode="Forms">
      <forms path="/" loginUrl="~/Login" timeout="2880" />
    </authentication>
<system.web>



这就是我目前在网络上所做的事情.config<


This is what i'm doing currently in my web.config<

推荐答案

删除位置路径=

试试这个



remove location path=""
Try this

<location path="Signup">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>

<system.web>
    <httpRuntime targetFramework="4.5" />
    <compilation debug="true" targetFramework="4.5" />
    <authentication mode="Forms">
      <forms loginUrl="Login.aspx" timeout="2880" />
    </authentication>
   <authorization>
      <deny users="?" />
    </authorization>
<system.web>





我假设您在主文件夹下有一个Signup文件夹,在主文件夹中有一个login.aspx页面



I assume you have a Signup folder under the main folder and a login.aspx page in the main folder







感谢您的帮助...是的我确实有,但我不希望用户移动到任何其他页面,这就是为什么我可以删除该位置标记...否则用户可以直接更改URL并访问其他页面而无需任何身份验证
Hi,


Thanks for the help ... yes i do have but i don't want the user to move to any other page that's why i can't remove that location tag ... else user can directly change the URL and access other pages without any authentication


我已经在我的解决方案中改变了一点...而不是现在的SignUp一世有一个注册页面...层次结构是这样的...查看 - >登录 - > Index.cshtml和Register.cshtml
Well i have changed a bit in my solution ... Instead of SignUp now i have a Register Page... hierarchy is like this ... View --> Login --> Index.cshtml and Register.cshtml


这篇关于由于web.config中的身份验证,无法转到注册页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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