Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

ajaxToolkitCalender Update itselef even if I delete the info from the box

$
0
0

Hi

I have 

<asp:Label ID="litlblFrom" Font-Bold="true" CssClass="LabelFilterSelection" runat="server" Text="<%$ Resources:GlobalResources, LabelFrom %>" />
<asp:TextBox CssClass="DateTextFilterSelection" runat="server" ID="FromDateTextBox"></asp:TextBox>
<img class="ImageFixedSize" id="FromCalendarButton" src="../../images/calendar.jpg"
alt="" />
<ajaxToolkit:CalendarExtender ID="FromCalendarExtender" runat="server" TargetControlID="FromDateTextBox"
PopupButtonID="FromCalendarButton">
</ajaxToolkit:CalendarExtender>

<asp:Label ID="litlblTo" CssClass="LabelFilterSelectionNoWidth" runat="server" Font-Bold="true" Text="<%$ Resources:GlobalResources, LabelTo %>" />
<asp:TextBox CssClass="DateTextFilterSelection" runat="server" ID="ToDateTextBox" ></asp:TextBox>
<img class="ImageFixedSize" id="ToCalendarButton" src="../../images/calendar.jpg"
alt="" />
<ajaxToolkit:CalendarExtender ID="ToCalendarExtender" runat="server" TargetControlID="ToDateTextBox"
PopupButtonID="ToCalendarButton">
</ajaxToolkit:CalendarExtender>

and I have four Validators :

<asp:CompareValidator runat="server" ID="CheckFromDate" ControlToValidate="FromDateTextBox"
Operator="DataTypeCheck" SetFocusOnError="true" Display="Dynamic" CssClass="ErrorLabel"
ErrorMessage="<%$ Resources:GlobalResources, StartDateNotValid %>" Type="Date"></asp:CompareValidator>
<br />
<asp:CompareValidator ID="CheckToDate" runat="server" ControlToValidate="ToDateTextBox"
ControlToCompare="FromDateTextBox" SetFocusOnError="true" Display="Dynamic" Operator="GreaterThan"
CssClass="ErrorLabel" ErrorMessage="<%$ Resources:GlobalResources, EndDateNotValid %>"
Type="Date"></asp:CompareValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidatorFrom" runat="server" CssClass="ErrorLabel"
ControlToValidate="FromDateTextBox" ValidationGroup="FormSubmit" Display="Dynamic" ErrorMessage="<%$ Resources:GlobalResources, StartDateRequired %>">
</asp:RequiredFieldValidator>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidatorTo" runat="server" CssClass="ErrorLabel"
ControlToValidate="ToDateTextBox" Display="Dynamic" ErrorMessage="<%$ Resources:GlobalResources, EndDateRequired %>">
</asp:RequiredFieldValidator>

and this is my Button asp code and also I have 2 combobox that when the last one is selected, it will check if the To and the From texts are full also and then activate the button

btnStartExportRPT.Enable="true";

<asp:Button ID="btnStartExportRPT" EnableTheming="true" CssClass="ButtonFilterSelectionL"
Text="<%$ Resources:GlobalResources, cmdStartExecute %>" runat="server" />

my problem is that when I remove the date, for instance from the FromDateTextBox I want to deactivate my button instantly but

  1- when I delete the From text (for instance) it shows me the error but it does not trigger any event to be able to control the button from the C# based on this error

  2- each time I empty the To or From box as soon as I change sth from the comboboxes it reloads a default date and I do not want it to be reload

Thanks for the help in advance


Viewing all articles
Browse latest Browse all 5678

Trending Articles