Änderunge validierungen der login felder

This commit is contained in:
ja
2021-10-07 11:26:11 +02:00
parent 4bcff2222e
commit 46f11a72eb
5 changed files with 58 additions and 36 deletions

View File

@@ -24,7 +24,7 @@
} }
.container-fluid { .container-fluid {
width: 400px; width: 400px;
height: 379px; height: 464px;
background-color: rgba(255,255,255,0.5); background-color: rgba(255,255,255,0.5);
margin: 0 auto; margin: 0 auto;
margin-top: 220px; margin-top: 220px;

View File

@@ -54,4 +54,7 @@
color: #fff; color: #fff;
width: 140px; width: 140px;
height: 25px; height: 25px;
}
#Password{
margin-right:-20px;
} }

View File

@@ -92,26 +92,24 @@
<!-- <tr><td> <!-- <tr><td>
<input type="email" runat="server" style="width:150px" placeholder="example@somehost.com" /> <input type="email" runat="server" style="width:150px" placeholder="example@somehost.com" />
</td></tr> --> </td></tr> -->
<tr style="color:#003680; height:30px;"> <tr style="color:#003680; height:30px;">
<td align="right" colspan="2"> <td align="left" colspan="2">
<asp:Label ID="lbl_Email" runat="server" Text="Email Address:" CssClass="txt_design"></asp:Label> <asp:Label ID="lbl_Email" runat="server" Text="Email Address:" CssClass="txt_design"></asp:Label>
</td></tr> </td>
<tr style="color:#003680; height:30px;"> <td align="left" colspan="2">
<td align="right" colspan="2">
<asp:TextBox ID="txtEmail" runat="server" Width = "250" OnTextChanged="txtEmail_TextChanged"/> <asp:TextBox ID="txtEmail" runat="server" Width = "250" OnTextChanged="txtEmail_TextChanged"/>
</td></tr> </td></tr>
<tr style="color:#003680; height:30px;"> <tr style="color:#003680; height:30px;">
<td align="right" colspan="4"> <td align="left" colspan="2">
<asp:RegularExpressionValidator ID="regexval_txt_Email" ControlToValidate="txtEmail" runat="server" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic"></asp:RegularExpressionValidator> <asp:RegularExpressionValidator ID="regexval_txt_Email" ControlToValidate="txtEmail" runat="server" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic"></asp:RegularExpressionValidator>
</td></tr> </td></tr>
<tr style="color:#003680; height:30px;"> <tr style="color:#003680; height:30px;">
<td align="right" colspan="2"> <td align="left" colspan="2">
<asp:Label ID="lbl_Username" runat="server" Text="Username:" CssClass="txt_design"></asp:Label> <asp:Label ID="lbl_Username" runat="server" Text="Username:" CssClass="txt_design"></asp:Label>
</td></tr> </td>
<tr style="color:#003680; height:30px;"> <td align="left" colspan="2">
<td align="right" colspan="2"> <asp:TextBox ID="txt_Username" runat="server" Width = "250" />
<asp:TextBox ID="txt_Username" runat="server" Width = "250" /> </td></tr>
</td></tr>
<tr style="color:#003680; height:30px;"> <tr style="color:#003680; height:30px;">
<td align="right" colspan="2"> <td align="right" colspan="2">
<asp:Label ID="lblMessage" runat="server" /> <asp:Label ID="lblMessage" runat="server" />

View File

@@ -75,38 +75,52 @@
<!-- <tr style=" background-image: linear-gradient(to right, #003680 , #0055cc);color:#fff;height:30px;font-size:12px"> <!-- <tr style=" background-image: linear-gradient(to right, #003680 , #0055cc);color:#fff;height:30px;font-size:12px">
<td align="center" colspan="2" style="color:#fff;font-kerning:auto;font-weight:700;">Bitte melden Sie sich an:</td> <td align="center" colspan="2" style="color:#fff;font-kerning:auto;font-weight:700;">Bitte melden Sie sich an:</td>
</tr> --> </tr> -->
<tr style="color:#003680; height:50px;"> <tr style="color:#003680; height:40px;">
<td align="center" colspan="2" style="color:#003680;font-kerning:auto;font-weight:700;"> <td align="center" colspan="2" style="color:#003680;font-kerning:auto;font-weight:700;">
<asp:Label ID="lbl_login" runat="server" Text="Login" CssClass="txt_design" ></asp:Label></td> <asp:Label ID="lbl_login" runat="server" Text="Login" CssClass="txt_design" ></asp:Label></td>
</tr> </tr>
<tr style="color:#003680; height:50px;"> <tr style="color:#003680; height:30px;">
<td align="right"> <td align="left" colspan="2">
<asp:Label ID="CustomerIDLabel" runat="server" AssociatedControlID="CustomerID" CssClass="txt_design">Kundennummer:</asp:Label> <asp:Label ID="CustomerIDLabel" runat="server" AssociatedControlID="CustomerID" CssClass="txt_design">Kundennummer:</asp:Label>
</td> </td>
<td> <td align="left" colspan="2">
<asp:TextBox ID="CustomerID" runat="server" TextMode="Number" required="true"></asp:TextBox> <asp:TextBox ID="CustomerID" runat="server" required="true" ValidationGroup="txt_check"></asp:TextBox>
<asp:RequiredFieldValidator ID="CustomerIDrequired" runat="server" ControlToValidate="CustomerID" ErrorMessage="Die Kundennummer ist erforderlich." ToolTip="Die Kundennummer ist erforderlich." ValidationGroup="Login1">*</asp:RequiredFieldValidator> </td></tr>
<tr style="color:#003680; height:15px;">
<td align="right">
<asp:RequiredFieldValidator ID="CustomerIDrequired" runat="server" ControlToValidate="CustomerID" ToolTip="Die Kundennummer ist erforderlich." ValidationGroup="Login1">Die Kundennummer ist erforderlich.</asp:RequiredFieldValidator>
</td></tr>
<tr style="color:#003680; height:15px;">
<td align="right">
<asp:RegularExpressionValidator ID="valid_getNumberInput" ControlToValidate="CustomerID" ValidationGroup="txt_check" runat="server" Display="Dynamic" SetFocusOnError="true" ValidationExpression="^[0-9]"></asp:RegularExpressionValidator>
</td> </td>
</tr> </tr>
<tr style="color:#003680; height:50px;"> <tr style="color:#003680; height:30px;">
<td align="right"> <td align="left" colspan="2">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" CssClass="txt_design">Benutzername:</asp:Label> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" CssClass="txt_design">Benutzername:</asp:Label>
</td> </td>
<td> <td align="left" colspan="2">
<asp:TextBox ID="UserName" runat="server" TextMode="SingleLine" required="true"></asp:TextBox> <asp:TextBox ID="UserName" runat="server" TextMode="SingleLine" required="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNamerequired" runat="server" ControlToValidate="UserName" ErrorMessage="Der Benutzername ist erforderlich." ToolTip="Der Benutzername ist erforderlich." ValidationGroup="Login1">*</asp:RequiredFieldValidator> </td>
</tr>
<tr style="color:#003680; height:20px;">
<td align="right">
<asp:RequiredFieldValidator ID="UserNamerequired" runat="server" ControlToValidate="UserName" ErrorMessage="Der Benutzername ist erforderlich." ToolTip="Der Benutzername ist erforderlich." ValidationGroup="Login1">Der Benutzername ist erforderlich.</asp:RequiredFieldValidator>
</td> </td>
</tr> </tr>
<tr style="color:#003680; height:50px;"> <tr style="color:#003680; height:30px;">
<td align="right"> <td align="left" colspan="2">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" CssClass="txt_design">Kennwort:</asp:Label> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" CssClass="txt_design">Kennwort:</asp:Label>
</td> </td>
<td> <td align="left" colspan="2">
<asp:TextBox ID="Password" runat="server" TextMode="Password" required="true"></asp:TextBox> <asp:TextBox ID="Password" runat="server" TextMode="Password" required="true" ValidationGroup="Login2" MaxLength="30"></asp:TextBox>
<asp:RequiredFieldValidator ID="Passwordrequired" runat="server" ControlToValidate="Password" ErrorMessage="Das Kennwort ist erforderlich." ToolTip="Das Kennwort ist erforderlich." ValidationGroup="Login1">*</asp:RequiredFieldValidator> </td></tr>
<tr style="color:#003680; height:20px;">
<td align="right">
<asp:RequiredFieldValidator ID="Passwordrequired" runat="server" ControlToValidate="Password" ErrorMessage="Das Kennwort ist erforderlich." ToolTip="Das Kennwort ist erforderlich." ValidationGroup="Login2">Bitte Passwort angeben.</asp:RequiredFieldValidator>
</td> </td>
</tr> </tr>
<tr style="color:#003680; height:50px;"> <tr style="color:#003680; height:30px;">
<td> <td>
<asp:CheckBox ID="RememberMe" runat="server" Text="Anmeldedaten speichern." /> <asp:CheckBox ID="RememberMe" runat="server" Text="Anmeldedaten speichern." />
</td> </td>
@@ -116,11 +130,11 @@
<asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal> <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
</td> </td>
</tr> </tr>
<tr style="color:#003680; height:50px;"> <tr style="color:#003680; height:20px;">
<td align="left" colspan="2"> <td align="left" colspan="2">
<br/> <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Login" ValidationGroup="Login1" target="_top" OnClientClick="bust2()"/> <br/> <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Login" ValidationGroup="Login1" target="_top" OnClientClick="bust2()"/>
</td> </td>
<tr style="color:#003680; height:50px;"> <tr style="color:#003680; height:20px;">
<td align="middle" colspan="2"> <td align="middle" colspan="2">
<asp:LinkButton ID="LinkButton1" runat="server" target="_top" OnClientClick="bust2()">Admin-Login</asp:LinkButton> <asp:LinkButton ID="LinkButton1" runat="server" target="_top" OnClientClick="bust2()">Admin-Login</asp:LinkButton>
</td> </td>

View File

@@ -4,6 +4,9 @@ Imports System.Data
Partial Class login_login_TEST Partial Class login_login_TEST
Inherits System.Web.UI.Page Inherits System.Web.UI.Page
Dim CustomerIDTextBox As TextBox Dim CustomerIDTextBox As TextBox
Protected Sub Page_Load(sender As Object, e As EventArgs)
End Sub
Protected Sub ValidateUser(sender As Object, e As EventArgs) Protected Sub ValidateUser(sender As Object, e As EventArgs)
Dim userId As Integer = 0 Dim userId As Integer = 0
' cDBFunctions.GetNewOpenConnection() ' cDBFunctions.GetNewOpenConnection()
@@ -58,4 +61,8 @@ Partial Class login_login_TEST
Protected Sub LoginButton_Click(sender As Object, e As EventArgs) Protected Sub LoginButton_Click(sender As Object, e As EventArgs)
End Sub End Sub
Protected Sub CustomerID_TextChanged(sender As Object, e As EventArgs)
End Sub
End Class End Class