![](/img/trans.png)
[英]error “Sanitizer provider is not configured in the web.config file. ”
[英]How to add public property to custom SqlMembership Provider to be configured in web.config
我正在创建一个自定义SqlMembershipProvider类,并且我想在其上添加一个新的公共属性,该属性将允许用户在SqlMembershipProvider基类中已经设置了web.config以及其他公共属性。 但是,当我添加我的属性并尝试运行该应用程序时,出现黄色错误消息,提示属性未识别为“ DataLocationDescription”。 我需要做什么才能使该属性与该类的其他属性一起在web.config中访问?
这是我的代码:
public class CustomSqlMembershipProvider : SqlMembershipProvider
{
public string DataLocationDescription { get; set; }
}
这是web.config文件,其中指定了我的Property DataLocationDescription:
<add name="CustomizedMembershipProvider"
type="ClassLibraries.Web.Security.CustomSqlMembershipProvider"
connectionStringName="SQLConnection"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="30" DataLocationDescription="Tier2"/>
我尝试使用ConfigurationProperty属性,但这没有任何区别。
[ConfigurationProperty("DataLocationDescription", IsRequired = true)]
任何帮助是极大的赞赏。
谢谢! 跳蚤
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.