asp.net登录控制不工作 [英] asp.net login control doesnt work
问题描述
我把一个登录控制,它不会让我的网站里。
(我甚至试图使用登录控件来检索和重置密码。仍然不会工作)。
下面是我的web.config文件的一部分。昨天,我今天在添加tag..but更改属性的问题重演固定的问题。
http://go.microsoft.com/fwlink/?LinkId=169433
- >
<添加名称=YourGuruDB的connectionString =数据源= DIMA-00AA1DA557;初始目录=模型;集成安全性=真/>
<添加名称=modelConnectionString的connectionString =数据源= DIMA-00AA1DA557;初始目录=模型;集成安全性=真的providerName =System.Data.SqlClient的/>
<添加名称=LocalSqlServer2的connectionString =数据源= \\ SQLEX $ P $干燥综合征; AttachDbFilename ='D:\\的Documents and Settings \\迪马\\我的文档\\ Visual Studio 2010的\\网站已\\ WebSite10 \\ App_Data文件\\ ASPNETDB.MDF ';集成安全=真;用户实例=真的providerName =System.Data.SqlClient的/>
< /&是connectionStrings GT;
<&的System.Web GT; <会员defaultProvider =MyMembershipProvider>
<供应商>
<清/>
<添加
NAME =MyMembershipProvider
类型=System.Web.Security.SqlMembershipProvider
的connectionStringName =LocalSqlServer2
minRequiredPasswordLength =2
minRequiredNonalphanumericCharacters =0
maxInvalidPasswordAttempts =1000
passwordAttemptWindow =1000
/>
< /供应商>
< /会员> < roleManager启用=真/> <身份验证模式=表格>
<形式的名称=MyAppCookie
loginUrl =〜/ Registration.aspx
保护=全部
超时=30路径=//>
< /认证>
请问LocalSqlServer这个存在的连接字符串?
什么错误,你好吗?
您会发现在你的ConnectionString部分是这样的:
<添加名称=LocalSqlServer这个的connectionString =< YourConnectionString>中的providerName =System.Data.SqlClient的/>
和你启用FormsAuthentication?
<身份验证模式=表格>
<形式loginUrl =< YourLoginPage>中超时=2880/>
< /认证>
I put a login control and it wont let me inside the site. (I even tried to use login control to retrieve and reset password. still wont work).
Here is a section of my web.config file. Yesterday, i fixed that issue by changing the properties in the add tag..but today the problem repeats itself.
http://go.microsoft.com/fwlink/?LinkId=169433 -->
<add name="YourGuruDB" connectionString="Data Source=DIMA-00AA1DA557;Initial Catalog=model;Integrated Security=True"/>
<add name="modelConnectionString" connectionString="Data Source=DIMA-00AA1DA557;Initial Catalog=model;Integrated Security=True" providerName="System.Data.SqlClient"/>
<add name="LocalSqlServer2" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename='D:\Documents and Settings\Dima\My Documents\Visual Studio 2010\WebSites\WebSite10\App_Data\ASPNETDB.MDF';Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<membership defaultProvider="MyMembershipProvider">
<providers>
<clear/>
<add
name="MyMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer2"
minRequiredPasswordLength="2"
minRequiredNonalphanumericCharacters="0"
maxInvalidPasswordAttempts="1000"
passwordAttemptWindow="1000"
/>
</providers>
</membership>
<roleManager enabled="true" />
<authentication mode="Forms">
<forms name="MyAppCookie"
loginUrl="~/Registration.aspx"
protection="All"
timeout="30" path="/" />
</authentication>
Does "LocalSqlServer" exists as connection string? What errors are you getting?
You should find in your ConnectionString section something like:
<add name="LocalSqlServer" connectionString="<YourConnectionString>" providerName="System.Data.SqlClient"/>
And did you enabled FormsAuthentication?
<authentication mode="Forms">
<forms loginUrl="<YourLoginPage>" timeout="2880"/>
</authentication>
这篇关于asp.net登录控制不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!