Sunday, 25 November 2012

Al Validation ,reg expression,valid no.

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="img/themes/calendar.js" type="text/javascript"></script>
    <%-- <script src="Images/ProtectImage.js" type="text/javascript"></script>  --%>
    <link href="img/themes/forest.css" rel="stylesheet" type="text/css" />
    <link href="img/themes/layouts/small.css" rel="stylesheet" type="text/css" />
    <script src="img/themes/calendar-en.js" type="text/javascript"></script>
    <title></title>
 

 <script type="text/javascript">
       function isNumeric(keyCode) {
           // return ((keyCode >= 48 && keyCode <= 57) || keyCode == 8)
           return (((keyCode >= 48 && keyCode <= 57) || (keyCode >= 96
             && keyCode <= 105)) || keyCode == 8)
       }
    </script>

    <style type="text/css">
        .style1
        {
            width: 61%;
        }
        .style2
        {
        }
        .style3
        {
            color: #FF0000;
        }
        .style4
        {
            width: 25px;
        }
        .style5
        {
            width: 25px;
            height: 21px;
        }
        .style6
        {
            height: 21px;
            width: 219px;
        }
        .style7
        {
            width: 25px;
            height: 31px;
        }
        .style8
        {
            height: 31px;
            width: 219px;
        }
        .style9
        {
            width: 25px;
            height: 23px;
        }
        .style10
        {
            height: 23px;
            width: 219px;
        }
        .style11
        {
            width: 25px;
            height: 30px;
        }
        .style12
        {
            height: 30px;
            width: 219px;
        }
        .style13
        {
            width: 219px;
        }
        .style14
        {
            width: 1384px;
        }
        .style15
        {
            height: 26px;
            width: 1384px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <table class="style1">
            <tr>
                <td class="style2" colspan="2">
                   
                    <span class="style3">&nbsp;&nbsp; Registration Form &nbsp;</span></td>
            </tr>
            <tr>
                <td class="style9">
                    Name
                </td>
                <td class="style10">
                    <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
                    <td class="style14">
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
                      ErrorMessage="*" ControlToValidate="TextBox4" ForeColor="#FF0066"></asp:RequiredFieldValidator>
                   
                    </td>
                  </td>
              

            </tr>
            <tr>
                <td class="style4">
                    LoginId</td>
                <td class="style13">
                    <asp:TextBox ID="TextBox3" runat="server"
                         ></asp:TextBox>
                    <td class="style14">                    
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                      ErrorMessage="*" ControlToValidate="TextBox3" ForeColor="#FF0066"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox3"
                                ErrorMessage="LoginId is only alphabets and Underscore" Font-Names="Arial" Font-Size="Small"
                                Height="17px" Style="position: static;" ValidationExpression="^[a-zA-Z]\w{3,14}$"
                                Width="300px" ForeColor="#FF0066"></asp:RegularExpressionValidator>
                   
                   
                   
                    </td>
                </td>     
               
            </tr>
            <tr>
                <td class="style4">
                    EmailId</td>
                <td class="style13">
                    <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
                    <td class="style15">
                            <asp:RequiredFieldValidator
                                ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEmail"
                                ErrorMessage="RequiredFieldValidator" Style="position: relative; vertical-align: top;
                                text-align: left; left: -2px; top: 1px; width: 8px;" Height="18px"
                                ForeColor="#FF0066">*</asp:RequiredFieldValidator>
                               <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtEmail"
                                ErrorMessage="Email not in proper format" Font-Names="Arial" Font-Size="Small"
                                Height="17px" Style="position: static;" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                Width="156px" ForeColor="#FF0066"></asp:RegularExpressionValidator>
                                                                                                      
                  </td>
                </td>
            </tr>
            <tr>
                <td class="style5">
                    Phoneno</td>
                <td class="style6">
                    <asp:TextBox ID="TextBox1" onkeydown = "return isNumeric(event.keyCode);" autocomplete="off" runat="server"></asp:TextBox>
                    <td class="style14">
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                      ErrorMessage="*" ControlToValidate="TextBox1" ForeColor="#FF0066"></asp:RequiredFieldValidator> 
                   
                    </td>
                </td>
            </tr>
            <tr>
                <td class="style7">
                    Services</td>
                <td class="style8">
                    <asp:CheckBoxList ID="CheckBoxList1" runat="server" Height="54px" Width="294px">
                        <asp:ListItem>vbvbv</asp:ListItem>
                        <asp:ListItem>dds</asp:ListItem>
                        <asp:ListItem>cvcxxcx</asp:ListItem>
                    </asp:CheckBoxList>
                    <%-- <td>
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
                      ErrorMessage="*" ControlToValidate="CheckBoxList1" ForeColor="#FF0066"></asp:RequiredFieldValidator>
                    </td>--%>
                </td>
            </tr>
            <tr>
                <td class="style4">
                    DOB</td>
                <td class="style13">
                    <asp:TextBox ID="TxtDate" runat="server"></asp:TextBox>
                    <asp:Button ID="trigger2" runat="server" Text="----"  ToolTip="Please clik here"/>
                          <script type="text/javascript">//<![CDATA[
                              Zapatec.Calendar.setup({
                                  firstDay: 1,
                                  weekNumbers: false,
                                  showOthers: true,
                                  electric: false,
                                  inputField: "TxtDate",
                                  button: "trigger2",
                                  ifFormat: "%m/%d/%Y",
                                  daFormat: "%Y/%m/%d"
                              });

                                      //]]></script>
                       

                    </td>
                    <td class="style14">
                        &nbsp;</td>
            </tr>
            <tr>
                <td class="style4">
                    Photo</td>
                <td class="style13">
                    <asp:FileUpload ID="imgUpload" runat="server" />
                    <td class="style14">
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                      ErrorMessage="*" ControlToValidate="imgUpload" ForeColor="#FF0066"></asp:RequiredFieldValidator>
                    </td>
                </td>
            </tr>
            <tr>
                <td class="style11">
                </td>
                <td class="style12">
                    <asp:Button ID="Button1" runat="server" Text="Save" onclick="Button1_Click" />
                    <asp:Button ID="Button2" runat="server" Text="Exit" />
                </td>
            </tr>
            <tr>
                <td class="style9">
                </td>
                <td class="style10">
                </td>
            </tr>
            <tr>
                <td class="style4">
                    &nbsp;</td>
                <td class="style13">
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style4">
                    &nbsp;</td>
                <td class="style13">
                    &nbsp;</td>
            </tr>
        </table>
   
    </div>
    </form>
</body>
</html>

No comments:

Post a Comment