[已解决] Web.config表单错误 [英] [Solved] Web.config Error in forms

查看:61
本文介绍了[已解决] Web.config表单错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Web.config文件中,我正在进行身份验证模式。我有一个错误,说不允许''forms'属性。为什么我会收到此错误?我如何安全地解决这个问题?我在数据库中也有超过5,000个用户。有没有办法让我验证这些没有在web.config文件中输入所有内容的用户?



 <   system.web  >  
< 编译 debug = true targetFramework = 4.0 / >

< 身份验证 模式 = 表单 >
< 表格 表格 = 401kApp loginUrl = / Login.aspx / >
< / authentication >

< / system.web >





以下是我的更改内容:



 <   system.web  >  
< 编译 debug = true targetFramework = 4.0 / >

< 身份验证 mode = 表格 >
< 表格 loginUrl = /Login.aspx / > ;
< / authentication >
< membership defaultProvider = SqlProvider

userIsOnlineTimeWindow = 15 >
< 供应商 >
< add

name = SqlProvider

type = System.Web.Security.SqlMembershipProvider

connectionStringName = SqlServices

< span class =code-attribute> < span class =code-attribute> applicationName = SACSCOCLogin1.1

enablePasswordRetrieval = true

enablePasswordReset = true

requiresQuestionAndAnswer = false

requiresUniqueEmail = true

< span class =code-attribute>
passwordFormat = 哈希

< span class =code-attribute> maxInvalidPasswordAttempts = 5

passwordAttemptWindow = 10 / >
< / providers >
< / membership >
< / system .web >

< / configuration >

解决方案

< blockquote>仅回答从未答复列表中删除:由OP解决


I am in my Web.config file and I am doing authentication mode. I have an error saying that, "The 'forms' attribute is not allowed. Why am I getting this error? How can i fix this safely? I also have over 5,000 users in a database. Is there a way for me to authenticate those users with out typing them all in the web.config file?

<system.web>
        <compilation debug="true" targetFramework="4.0" />
      
      <authentication mode="Forms">
        <forms forms="401kApp" loginUrl="/Login.aspx" />
      </authentication>
      
    </system.web>



Here is what I have changed:

<system.web>
        <compilation debug="true" targetFramework="4.0" />
      
      <authentication mode="Forms">
        <forms loginUrl="/Login.aspx" />
      </authentication>
      <membership defaultProvider="SqlProvider"

      userIsOnlineTimeWindow="15">
        <providers>
          <add

            name="SqlProvider"

            type="System.Web.Security.SqlMembershipProvider"

            connectionStringName="SqlServices"

            applicationName="SACSCOCLogin1.1"

            enablePasswordRetrieval="true"

            enablePasswordReset="true"

            requiresQuestionAndAnswer="false"

            requiresUniqueEmail="true"

            passwordFormat="Hashed"

            maxInvalidPasswordAttempts="5"

            passwordAttemptWindow="10" />
        </providers>
      </membership>
    </system.web>

</configuration>

解决方案

Answered only to remove from unanswered list: solved by OP


这篇关于[已解决] Web.config表单错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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