<%@ Page Language="C#" AutoEventWireup="true" CodeFile="connexion.aspx.cs" Inherits="connexion" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Connexion</title>
    <script>
        function verif_saisie(sender, args) {
            if (document.forms[0].txt_pwd.value == "")
                args.IsValid = false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">            
            <table align="center" border="0">
                <tr>
                    <td colspan="3">
                        <h2>
                        Connexion</h2>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>Utilisateur</td>
                    <td>
                        <asp:TextBox ID="txt_user" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="req_user" runat="server" ErrorMessage="Le nom d'utilisateur est obligatoire" ControlToValidate="txt_user"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="reg_email" runat="server" ControlToValidate="txt_user"
                            ErrorMessage="Utilisateur n'est pas un email" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator></td>
                    <td>
                        <asp:Button ID="cmd_login" runat="server" Text="Connexion" OnClick="cmd_login_Click" /></td>
                </tr>
                <tr>
                    <td>Mot de passe</td>
                    <td>
                        <asp:TextBox ID="txt_pwd" runat="server" TextMode="Password"></asp:TextBox>
                        <asp:CustomValidator ID="cust_pwd" runat="server" ClientValidationFunction="verif_saisie"
                            ControlToValidate="txt_pwd" ErrorMessage="Le mot de passe doit être saisi" ValidateEmptyText="True">*</asp:CustomValidator>
                        <asp:CustomValidator ID="cust_login" runat="server" ControlToValidate="txt_user"
                            ErrorMessage="CustomValidator" OnServerValidate="cust_login_ServerValidate">*</asp:CustomValidator></td>                    
                    <td>
                        <asp:LinkButton ID="cmd_pwd_oublie" runat="server" CausesValidation="False">Mot de passe oublié</asp:LinkButton></td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
                    </td>
                    <td>
                        
                    </td>
                </tr>
            </table>        
    </form>
</body>
</html>
