0

我之前发布了这个问题,它被关闭了。我的问题与其他问题不同,当用户在登录控制中输入错误的用户名或密码时,我在登录的一页中收到此消息。出现此消息,但如果用户名和密码正确。它工作正常,用户可以登录。我的控制是:

 <asp:Login ID="loginPane" runat="server" Font-Names="Tahoma" Font-Size="11px" LoginButtonText="Login"
                                                RememberMeSet="True" TitleText="" Width="314px" Height="201px" BackColor="gray">
                                                <TextBoxStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Font-Names="Tahoma"
                                                    Font-Size="11px" Width="200px" />
                                                <LabelStyle HorizontalAlign="Left" />
                                                <LoginButtonStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" />
                                                <LayoutTemplate>
                                                    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;
                                                        width: 325px; height: 217px; background-color: Gray;">
                                                        <tr>
                                                            <td style="width: 325px">
                                                                <table border="0" cellpadding="0" style="width: 319px; height: 196px">
                                                                    <tr>
                                                                        <td align="left">
                                                                        </td>
                                                                        <td style="width: 312px" align="left">
                                                                            <asp:TextBox ID="UserName" runat="server" BorderColor="Gray" BorderStyle="Solid"
                                                                                BorderWidth="1px" Font-Names="Tahoma" Font-Size="16px" Height="32px" Width="260px"
                                                                                ForeColor="Gray" placeholder="Username" BackColor="white"></asp:TextBox>
                                                                            <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                                                                ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="loginPane">*</asp:RequiredFieldValidator>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td align="left" style="height: 17px">
                                                                        </td>
                                                                        <td style="height: 17px; width: 312px;" align="left">
                                                                            <asp:TextBox ID="Password" runat="server" BorderColor="Gray" BorderStyle="Solid"
                                                                                TextMode="Password" BorderWidth="1px" Font-Names="Tahoma" Font-Size="16px" Height="32px"
                                                                                Width="260px" type='password' placeholder="Password" ForeColor="Gray"></asp:TextBox>
                                                                            <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                                                                ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="loginPane">*</asp:RequiredFieldValidator>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2" style="height: 25px" align="left">
                                                                            <br />
                                                                            &nbsp;
                                                                            <asp:CheckBox ID="RememberMe" runat="server" Checked="True" Text="Remember me next time."
                                                                                ForeColor="white" Font-Size="small" />
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td align="center" colspan="2" style="color: red">
                                                                            <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <%-- style="opacity: 1; filter: alpha(opacity=100); -moz-opacity: 1;
                                                                            -khtml-opacity: 1;"--%>
                                                                        <td align="right" colspan="2">
                                                                            <asp:Button ID="LoginButton" runat="server" BorderColor="#FFF8C6" BorderStyle="None"
                                                                                BorderWidth="1px" CommandName="Login" Height="34px" Text="Login" ValidationGroup="loginPane"
                                                                                Width="90px" Font-Size="Medium" ForeColor="#C11B17" Font-Bold="True" BackColor="White"
                                                                                OnClick="LoginButton_Click" />
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </LayoutTemplate>
                                            </asp:Login>

当我在我的机器上发布但在远程服务器上发布时出现此消息:建立与 SQL Server 的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接

and when run on VS it works fine and show message of login failing that i show to user

4

1 回答 1

0

thanks all,

the first error occur as i have sql express running so i have to stop it and the second one occur when try by login button and fail. it try to login via login control so i have to set login authenticate to false

于 2012-10-16T11:17:42.650 回答