Click here to Skip to main content
15,884,006 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi friends
i have use CompareValidator in two date and this validation are work local are perfect but when i check in live project compare validator are not woking plz help me whats a problem
Thanks

my code is

<div class="box_cols_main_stu">
                    <label class="box_cols_lab_wi">
                         Joining Date :</label>
                    <span class="textbox_bg_mn" style="float: left">
                        <asp:TextBox ID="txtDateOfJoining" runat="server" OnTextChanged="txtjoin_TextChanged"
                            AutoPostBack="true">
                    </span><span style="visibility: visible; margin-removed -30px; float: left; margin-removed 408px;">
                        class="red_star">*</span>
                        <span style="text-align: left;">
                            <asp:Label ID="lbl_vali" runat="server" Style="color: #FF0000; margin-left: 140px;">
                            <cc1:CalendarExtender ID="CalendarExtenderjoiningdate" Format="dd/MM/yyyy" PopupPosition="BottomRight"
                                 runat="server" TargetControlID="txtDateOfJoining">
                            
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ForeColor="Red"
                                ControlToValidate="txtDateofJoining" ErrorMessage="Date format in DD/MM/YYYY"
                                ValidationExpression="^(((((0[1-9])|(1\d)|(2[0-8]))\/((0[1-9])|(1[0-2])))|((31\/((0[13578])|(1[02])))|((29|30)\/((0[1,3-9])|(1[0-2])))))\/((20[0-9][0-9])|(19[0-9][0-9])))|((29\/02\/(19|20)(([02468][048])|([13579][26]))))$">
                            
                            <cc1:MaskedEditExtender ID="MaskedEditExtenderjoiningdate"  runat="server" TargetControlID="txtDateOfJoining"
                                Mask="99/99/9999" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                                 önInvalidCssClass="MaskedEditError" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"
                                ErrorTooltipEnabled="True" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1joiningdate" runat="server"
                                ErrorMessage="Please Enter Joining Date...." ControlToValidate="txtDateOfJoining"
                                Display="Dynamic" InitialValue="" CssClass="error_messe">
                            
                            <asp:CompareValidator runat="server" ID="cmp1" ControlToValidate="txtDateOfJoining"
                                ControlToCompare="txtDateOfBirth" Operator="GreaterThan" Display="Dynamic" Type="Date"
                                ErrorMessage="Join date must be after Birth date" CssClass="error_messe">
                            
                        </span>
                </div>
            
        
        <div class="box_cols_main_stu">
            <label class="box_cols_lab_wi">
                 Type of Service :</label>
            <span class="textbox_bg_mn" style="float: left">
                <asp:DropDownList runat="server" ID="ddl_tservice">
                    <asp:ListItem Value="0">Select Type Service
                    <asp:ListItem Value="1">Permanent
                    <asp:ListItem Value="2">Temporary
                    <asp:ListItem Value="3">Part Time
                    <asp:ListItem Value="4">Fix Salary
                    <asp:ListItem Value="5">Other
                
            </span><span style="visibility: visible; margin-removed -30px; float: left; margin-removed 408px;">
                class="red_star">*</span><span style="text-align: left; width: 200px;">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Please Select Service Type..."
                        ControlToValidate="ddl_tservice" Display="Dynamic" CssClass="error_messe" InitialValue="0">
                    
                </span>
        </div>
        <div class="fclear">
             <hr style="width: 880px" />
        </div>
        <div class="box_cols_main_stu">
            <label class="box_cols_lab_wi">
                 Retired Date :</label>
            <span class="textbox_bg_mn" style="float: left">
                <asp:TextBox ID="txtRetairedDate" runat="server">
            </span><span style="visibility: visible; margin-removed -30px; float: left; margin-removed 408px;">
                class="red_star">*</span><span style="text-align: left;">
                    <cc1:CalendarExtender ID="CalendarExtenderretireddate" Format="dd/MM/yyyy" PopupPosition="BottomRight"
                         runat="server" TargetControlID="txtRetairedDate">
                    
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ForeColor="Red"
                        ControlToValidate="txtRetairedDate" ErrorMessage="Date format in DD/MM/YYYY"
                        ValidationExpression="^(((((0[1-9])|(1\d)|(2[0-8]))\/((0[1-9])|(1[0-2])))|((31\/((0[13578])|(1[02])))|((29|30)\/((0[1,3-9])|(1[0-2])))))\/((20[0-9][0-9])|(19[0-9][0-9])))|((29\/02\/(19|20)(([02468][048])|([13579][26]))))$">
                    <cc1:MaskedEditExtender ID="MaskedEditretireddate"  runat="server" TargetControlID="txtRetairedDate"
                        Mask="99/99/9999" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                         önInvalidCssClass="MaskedEditError" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"
                        ErrorTooltipEnabled="True" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorretireddate" runat="server"
                        ErrorMessage="Please Enter Retired Date...." ControlToValidate="txtRetairedDate"
                        Display="Dynamic" InitialValue="" CssClass="error_messe">
                    
                    <%--<asp:CompareValidator runat="server" ID="CompareValidator1" ControlToValidate="txtRetairedDate"
                        ControlToCompare="txtDateOfJoining" Operator="GreaterThan" Display="Dynamic"
                        Type="Date" ErrorMessage="Retaired date must be after Joining  date" CssClass="error_messe">
                    --%>
                </span>
        </div>
Posted
Updated 28-May-13 1:11am
v3
Comments
IpsitaMishra 28-May-13 7:05am    
can you please provide your code,so that it will be easier to help you.

1 solution

please any one do this .....................
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900