Click here to Skip to main content
16,010,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm creating a web application and I'm using compare validator with dates in my application.
It will work when normal testing.

But when creating web setup of that application and then start the setup and then run application then comapre validator is not properly working.

Please solve my problem
Posted
Updated 19-Oct-10 22:46pm
v2
Comments
DaveAuld 12-Oct-10 5:27am    
Maybe you should show us some code you have written, e.g. the function that is failing? or perhaps give us an idea of what Not working means, any errors? without additional information, nobody can help
Dalek Dave 20-Oct-10 4:46am    
Edited for Grammar.

1 solution

This is my html code which is shown below.


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

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!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">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </cc1:ToolkitScriptManager>
    <asp:Label ID="Label1" runat="server" Text="From Date"></asp:Label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="TxtBoxFromDate" runat="server"></asp:TextBox>
    <cc1:CalendarExtender ID="TxtBoxFromDate_CalendarExtender" runat="server"
        Enabled="True" TargetControlID="TxtBoxFromDate" Format="dd/MM/yyyy"
        TodaysDateFormat="dd/MM/yyyy">
    </cc1:CalendarExtender>
    <br />
    <br />
    <asp:Label ID="Label2" runat="server" Text="To Date"></asp:Label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="TxtBoxToDate" runat="server"></asp:TextBox>
    <cc1:CalendarExtender ID="TxtBoxToDate_CalendarExtender" runat="server"
        Enabled="True" TargetControlID="TxtBoxToDate" Format="dd/MM/yyyy"
        TodaysDateFormat="dd/MM/yyyy">
    </cc1:CalendarExtender>
    <br />
    <br />
    <asp:CompareValidator ID="CompareValidator1" runat="server"
        ControlToCompare="TxtBoxToDate" ControlToValidate="TxtBoxFromDate"
        ErrorMessage="CompareValidator" Operator="LessThanEqual" Type="Date"
        ValueToCompare="dd/MM/yyyy">To Date must be greater than From Date</asp:CompareValidator>

    </form>
</body>
</html>
 
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