PageRenderTime 152ms CodeModel.GetById 147ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/source/app/NOS.Wiki/Register.aspx

http://github.com/agross/netopenspace
ASP.NET | 154 lines | 120 code | 7 blank | 27 comment | 2 complexity | 577b6fef39858dc3317defbbff225f6a MD5 | raw file
  1<%@ Page Language="C#" MasterPageFile="~/MasterPageSA.master" AutoEventWireup="true" Inherits="ScrewTurn.Wiki.Register" Title="Untitled Page" EnableSessionState="True" Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" Codebehind="Register.aspx.cs" %>
  2<%@ Register TagPrefix="st" TagName="Captcha" Src="~/Captcha.ascx" %>
  3
  4<asp:Content ID="CtnRegister" ContentPlaceHolderID="CphMasterSA" Runat="Server">
  5
  6    <script type="text/javascript">
  7    <!--
  8    
  9        function cvPassword_ClientValidate(source, args) {
 10			var txtP1 = __GetServerElementById("txtPassword1").value;
 11			var txtP2 = __GetServerElementById("txtPassword2").value;
 12			var bValid = true;
 13				  
 14			if((txtP1.length > 0) && (txtP2.length > 0) ) {
 15			    bValid = (txtP1 == txtP2);
 16			}
 17				  
 18            args.IsValid = bValid;
 19		}
 20				
 21		function cvEmail_ClientValidate(source, args) {
 22			var txtE1 = __GetServerElementById("txtEmail1").value;
 23			var txtE2 = __GetServerElementById("txtEmail2").value;
 24			var bValid = true;
 25				  
 26			if((txtE1.length > 0) && (txtE2.length > 0) ) {
 27			    bValid = (txtE1 == txtE2);
 28		    }
 29				  
 30            args.IsValid = bValid;
 31		}
 32				
 33    // -->
 34    </script>
 35    
 36    <h1 class="pagetitlesystem"><asp:Literal ID="lblTitle" runat="server" meta:resourcekey="lblTitleResource1" Text="Create a new Account" /></h1>
 37   
 38    <p><asp:Literal ID="lblRegisterDescription" runat="server" Text="Here you can create a new Account for this Wiki.<br /><b>Note</b>: all the fields are mandatory. The Email address will not be published in any way, but it will be visible to the Administrators." meta:resourcekey="lblRegisterDescriptionResource1" /></p>
 39    <br />
 40    <div class="warning"><asp:Literal ID="lblAccountActivationMode" runat="server" meta:resourcekey="lblAccountActivationModeResource1" /></div>
 41    <p><asp:Label ID="lblResult" runat="server" meta:resourcekey="lblResultResource1" /></p>
 42     
 43    <asp:Panel ID="pnlRegister" runat="server" 
 44		meta:resourcekey="pnlRegisterResource1">
 45        <br /><br /> 
 46        <table style="width: 100%;" cellpadding="0" cellspacing="4">
 47			<colgroup>
 48				<col width="30%" />
 49				<col width="*" />
 50			</colgroup>
 51            <tr>
 52                <td><p style="text-align: right;"><asp:Literal ID="lblUsername" runat="server" meta:resourcekey="lblUsernameResource1" Text="Username" />:</p></td>
 53                <td><asp:TextBox ID="txtUsername" runat="server" Width="200px" meta:resourcekey="txtUsernameResource1" ToolTip="Type here your Username" CausesValidation="True" />
 54                    <asp:RequiredFieldValidator ID="rfvUsername" runat="server" 
 55						CssClass="resulterror" Display="Dynamic"
 56						ControlToValidate="txtUsername" EnableTheming="False" ErrorMessage="Username is required" 
 57						meta:resourcekey="rfvUsernameResource1" />
 58				    <asp:RegularExpressionValidator EnableClientScript="False" ID="rxvUserName" 
 59						runat="server" ControlToValidate="txtUsername" EnableTheming="False" CssClass="resulterror" 
 60						Display="Dynamic" ErrorMessage="Invalid Username" 
 61						meta:resourcekey="rxvUserNameResource1" />
 62				    <asp:CustomValidator ID="cvUsername" runat="server"  CssClass="resulterror" Display="Dynamic"
 63						ControlToValidate="txtUsername" EnableTheming="False" ErrorMessage="Username already exists" 
 64						OnServerValidate="cvUsername_ServerValidate" EnableClientScript="False" 
 65						meta:resourcekey="cvUsernameResource1" />
 66				</td>
 67            </tr>
 68            <tr>
 69				<td><p style="text-align: right"><asp:Literal ID="lblDisplayName" runat="server" 
 70						Text="Display Name" meta:resourcekey="lblDisplayNameResource1" />:</p></td>
 71				<td><asp:TextBox ID="txtDisplayName" runat="server" Width="200px" 
 72						ToolTip="Type here a display name for your account" CausesValidation="True" 
 73						meta:resourcekey="txtDisplayNameResource1" />
 74					<asp:RegularExpressionValidator EnableClientScript="False" ID="rxvDisplayName" 
 75						CssClass="resulterror" Display="Dynamic"
 76						runat="server" ControlToValidate="txtDisplayName" EnableTheming="False" 
 77						ErrorMessage="Invalid Display Name" 
 78						meta:resourcekey="rxvDisplayNameResource1" />
 79				</td>
 80            </tr>
 81            <tr>
 82                <td><p style="text-align: right;"><asp:Literal ID="lblEmail1" runat="server" meta:resourcekey="lblEmail1Resource1" Text="Email" />:</p></td>
 83                <td><asp:TextBox ID="txtEmail1" runat="server" Width="200px" meta:resourcekey="txtEmail1Resource1" ToolTip="Type here your Email address" CausesValidation="True" />
 84                    <asp:RequiredFieldValidator ID="rfvEmail1" runat="server" 
 85						CssClass="resulterror" Display="Dynamic"
 86						ControlToValidate="txtEmail1" EnableTheming="False" ErrorMessage="Email is required" 
 87						meta:resourcekey="rfvEmail1Resource1" />
 88					<asp:RegularExpressionValidator ID="rxvEmail1" runat="server" 
 89						CssClass="resulterror" Display="Dynamic" EnableClientScript="false"
 90						ControlToValidate="txtEmail1" EnableTheming="False" ErrorMessage="Invalid Email" 
 91						meta:resourcekey="rxvEmail1Resource1" />
 92				    <asp:CustomValidator ID="cvEmail1" runat="server" ControlToValidate="txtEmail1" 
 93						EnableTheming="False" ClientValidationFunction="cvEmail_ClientValidate" 
 94						CssClass="resulterror" Display="Dynamic"
 95				        ErrorMessage="Emails are not equal" OnServerValidate="cvEmail1_ServerValidate" 
 96						meta:resourcekey="cvEmail1Resource1" />
 97				</td>
 98            </tr>
 99            <tr>
100                <td><p style="text-align: right;"><asp:Literal ID="lblEmail2" runat="server" meta:resourcekey="lblEmail2Resource1" Text="Email (repeat)" />:</p></td>
101                <td><asp:TextBox ID="txtEmail2" runat="server" Width="200px" meta:resourcekey="txtEmail2Resource1" ToolTip="Repeat your Email address" CausesValidation="True" />
102                    <asp:RequiredFieldValidator ID="rfvEmail2" runat="server" EnableClientScript="false"
103						ControlToValidate="txtEmail2" EnableTheming="False" CssClass="resulterror" Display="Dynamic"
104					    ErrorMessage="Email is required" meta:resourcekey="rfvEmail2Resource1" />
105					<asp:CustomValidator ID="cvEmail2" runat="server" ControlToValidate="txtEmail2" 
106						CssClass="resulterror" Display="Dynamic"
107						EnableTheming="False" ClientValidationFunction="cvEmail_ClientValidate"
108					    ErrorMessage="Emails are not equal" OnServerValidate="cvEmail2_ServerValidate" 
109						meta:resourcekey="cvEmail2Resource1" />
110			    </td>
111            </tr>
112            <tr>
113                <td><p style="text-align: right;"><asp:Literal ID="lblPassword1" runat="server" meta:resourcekey="lblPassword1Resource1" Text="Password" />:</p></td>
114                <td><asp:TextBox ID="txtPassword1" runat="server" TextMode="Password" Width="200px" meta:resourcekey="txtPassword1Resource1" ToolTip="Type here your Password" CausesValidation="True" />
115                    <asp:RequiredFieldValidator ID="rfvPassword1" runat="server" 
116						CssClass="resulterror" Display="Dynamic"
117						ControlToValidate="txtPassword1" EnableTheming="False"
118					    ErrorMessage="Password is required" meta:resourcekey="rfvPassword1Resource1" />
119					<asp:RegularExpressionValidator EnableClientScript="False" ID="rxvPassword1" 
120						CssClass="resulterror" Display="Dynamic"
121						runat="server" ControlToValidate="txtPassword1" EnableTheming="False" 
122						ErrorMessage="Invalid Password" meta:resourcekey="rxvPassword1Resource1" />
123					<asp:CustomValidator ID="cvPassword1" runat="server" CssClass="resulterror" Display="Dynamic"
124						ControlToValidate="txtPassword1" EnableTheming="False" ClientValidationFunction="cvPassword_ClientValidate"
125					    ErrorMessage="Passwords are not equal" OnServerValidate="cvPassword1_ServerValidate" 
126						meta:resourcekey="cvPassword1Resource1" />
127			    </td>
128            </tr>
129            <tr>
130                <td><p style="text-align: right;"><asp:Literal ID="lblPassword2" runat="server" meta:resourcekey="lblPassword2Resource1" Text="Password (repeat)" />:</p></td>
131                <td><asp:TextBox ID="txtPassword2" runat="server" TextMode="Password" Width="200px" meta:resourcekey="txtPassword2Resource1" ToolTip="Repeat your Password" CausesValidation="True" />
132                    <asp:RequiredFieldValidator ID="rfvPassword2" runat="server" 
133						CssClass="resulterror" Display="Dynamic"
134						ControlToValidate="txtPassword2" EnableTheming="False" ErrorMessage="Password is required" 
135						meta:resourcekey="rfvPassword2Resource1" />
136					<asp:CustomValidator ID="cvPassword2" runat="server" CssClass="resulterror" Display="Dynamic"
137						ControlToValidate="txtPassword2" EnableTheming="False" ClientValidationFunction="cvPassword_ClientValidate"
138					    ErrorMessage="Passwords are not equal" OnServerValidate="cvPassword2_ServerValidate" 
139						meta:resourcekey="cvPassword2Resource1" />
140			    </td>
141            </tr>
142            <tr style="display: none;">
143                <td style="vertical-align: top;"><p style="text-align: right;"><asp:Literal ID="lblCaptcha" runat="server" Text="Control Text (case sensitive)" meta:resourcekey="lblCaptchaResource1" />:</p></td>
144                <td><st:Captcha ID="captcha" runat="server" /></td>
145            </tr>
146            <tr>
147                <td>&nbsp;</td>
148                <td><asp:Button ID="btnRegister" runat="server" Text="Create Account" OnClick="btnRegister_Click" meta:resourcekey="btnRegisterResource1" ToolTip="Click here to create your Account" /></td>
149            </tr>
150       </table>
151   </asp:Panel>
152     
153</asp:Content>
154