Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing CompareValidator and CalenderExtender with unsupported date-format
    primarykey
    data
    text
    <p>I have a start date and end date field in a form. I have specified format for calender extender. since then, the compare validator is not working. It is always displaying the error message. Please help. I need to show the date in the format "Fri 04 May 2012".</p> <p>Start date field:</p> <pre><code>&lt;asp:TextBox ID="txtStartDate" ReadOnly="true" runat="server" CssClass="textBoxWidth TPRValue" Text='&lt;%#DataBinder.Eval(Container.DataItem, "StartDate", "{0: ddd MM dd, yyyy}")%&gt;'&gt; &lt;/asp:TextBox&gt; &lt;asp:ImageButton ID="imgBtnStartDate" runat="server" ImageUrl="~/Common/Images/Calendar.GIF" CausesValidation="false" ImageAlign="AbsMiddle" /&gt; &lt;ajax:CalendarExtender ID="StartDateCalendar" TargetControlID="txtStartDate" PopupButtonID="imgBtnStartDate" runat="server" Format="ddd MM dd, yyyy"&gt; &lt;/ajax:CalendarExtender&gt; &lt;asp:CompareValidator ID="startDateCompareValidator" runat="server" ControlToValidate="txtStartDate" ControlToCompare="txtEndDate" Enabled="true" Type="Date" Display="Dynamic" Operator="LessThanEqual" Text="Startdate should be &lt;= enddate"&gt; &lt;/asp:CompareValidator&gt; </code></pre> <p>EndDate field:</p> <pre><code>&lt;asp:TextBox ID="txtEndDate" ReadOnly="true" runat="server" CssClass="textBoxWidth TPRValue" Text='&lt;%#DataBinder.Eval(Container.DataItem, "EndDate", "{0: ddd MM dd, yyyy}")%&gt;'&gt; &lt;/asp:TextBox&gt; &lt;asp:ImageButton ID="imgBtnEndDate" runat="server" ImageUrl="~/Common/Images/Calendar.GIF" CausesValidation="false" ImageAlign="AbsMiddle" /&gt; &lt;ajax:CalendarExtender ID="EndDateCalendar" TargetControlID="txtEndDate" PopupButtonID="imgBtnEndDate" runat="server" Format="ddd MM dd, yyyy"&gt; &lt;/ajax:CalendarExtender&gt; </code></pre> <p>Compare validator: </p> <pre><code>&lt;asp:CompareValidator ID="startDateCompareValidator" runat="server" ControlToValidate="txtStartDate" ControlToCompare="txtEndDate" Enabled="true" Type="Date" Display="Dynamic" Operator="LessThanEqual" Text="Startdate should be &lt;= enddate"&gt; &lt;/asp:CompareValidator&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload