Я использую createwizard, подключенный к удаленной базе данных SQL. Пользователь создает нормально и появляется в БД.
У меня также есть контроль входа в систему, но после ввода имени пользователя и пароля, я не могу войти в систему, он просто сидит на экране входа в систему. Что мне нужно посмотреть?
Я прошел через утилиту конфигурации asp.net и установил каталог, содержащий мои страницы auth / member, чтобы запретить всем, кто не является пользователем.
исходный код для входа в систему
<%@ Page Title="Login" Language="C#" MasterPageFile="~/Account/LoginMaster.Master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="BT4SGWebApplication.Account.Login" %>
<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<div style="border-style: none; border-width: thin; height: 565px; top: -3px; left: -5px; width: 922px; position: relative;">
<div style="border-style: solid; border-width: thin; height: 370px; width: 360px; top: 95px; left: 420px; position: absolute">
<asp:Login ID="LoginField" runat="server"
style="position: absolute; top: 89px; left: 71px; height: 132px; width: 217px"
MembershipProvider="MySqlLoginProvider">
<LayoutTemplate>
<table cellpadding="1" cellspacing="0" style="border-collapse:collapse;">
<tr>
<td>
<table cellpadding="0">
<tr>
<td align="center" colspan="2">
Log In</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
</td>
<td>
<asp:TextBox ID="UserName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server"
ControlToValidate="UserName" ErrorMessage="User Name is required."
ToolTip="User Name is required." ValidationGroup="LoginField">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server"
ControlToValidate="Password" ErrorMessage="Password is required."
ToolTip="Password is required." ValidationGroup="LoginField">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td colspan="2">
<asp:CheckBox ID="RememberMe" runat="server" Text="Remember me next time." />
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color:Red;">
<asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In"
ValidationGroup="LoginField" PostBackUrl="~/Tabs/Home.aspx" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</LayoutTemplate>
</asp:Login>
<asp:Label ID="loginLabel" runat="server" BackColor="White" BorderColor="White"
Font-Bold="True" Font-Size="XX-Large"
style="height: 42px; width: 100px; top: 30px; left: 128px; position: absolute; border-style: solid; border-width: thin"
Text="Log In"></asp:Label>
<asp:PasswordRecovery ID="PasswordRecovery1" runat="server"
style="top: 253px; left: 28px; position: absolute; height: 102px; width: 304px">
</asp:PasswordRecovery>
</div>
<asp:Button ID="Button1" runat="server" BorderColor="Black" BorderStyle="Solid"
BorderWidth="8px" Font-Bold="True" Font-Size="X-Large"
style="top: 233px; left: 150px; height: 53px; width: 232px; position: absolute; border-style: solid; border-width: thin"
Text="Click to Register" onclick="Button1_Click" />
</div>
</asp:Content>
web.config
<configuration>
<connectionStrings>
<add name="LoginSQL" providerName="System.Data.SqlClient" connectionString="Data Source=xx.xx.xx.xx;Initial Catalog=xxxx;UID=xxxx;pwd=xxxxx;"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
<authentication mode="Forms">
<forms name="Login" loginUrl="Default.aspx" timeout="20" />
</authentication>
<membership defaultProvider="MySqlLoginProvider">
<providers>
<add name="MySqlLoginProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LoginSQL" applicationName="/" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="3" passwordAttemptWindow="30" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager cacheRolesInCookie="true" cookieName=".ASPRoles"
cookieTimeout="60" defaultProvider="AspNetWindowsTokenRoleProvider">
<providers>
<add connectionStringName="LoginSQL" applicationName="/" name="MyRoleProvider"
type="System.Web.Security.SqlRoleProvider" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>