Compare validator and link button not working

Posted by Jeena under ASP.NET on 6/28/2012 | Points: 10 | Views : 2039 | Status : [Member] | Replies : 4
Hi all

I have a web application,in which user has the option to enter dates from calendar to text boxes.

I have to check whether the user entered dates are in valid range,Its working perfectly in some machines ,but not working in some other

code
=============================================================================================================================
Start Date&nbsp;<asp:TextBox ID="txtStarttDate" Width="50px" Enabled="false" runat="server"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtStarttDate" ToolTip="StartDate Required" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>

&nbsp;<asp:ImageButton ID="imgstardate" ImageUrl="~/Images/calenderIcon.jpg" runat="server" />

&nbsp;End Date <asp:TextBox ID="txtEndDate" Enabled="false" Width="50px" runat="server" ></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtEndDate" ToolTip="EndDate Required" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>

<asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="*" ControlToCompare="txtStarttDate" ControlToValidate="txtEndDate" Operator="GreaterThan" Type="Date" ToolTip="Invalid Range"></asp:CompareValidator>

&nbsp;<asp:ImageButton ID="imgEnddate" ImageUrl="~/Images/calenderIcon.jpg" runat="server" />

<cc1:CalendarExtender ID="CalendarExtender1" BehaviorID="startDate" PopupButtonID="imgstardate" PopupPosition="TopLeft" TargetControlID="txtStarttDate" runat="server">


</cc1:CalendarExtender>
<cc1:CalendarExtender ID="CalendarExtender2" BehaviorID="endDate" PopupButtonID="imgEnddate" PopupPosition="TopLeft" TargetControlID="txtEndDate" runat="server">
</cc1:CalendarExtender>

======================================================================================================================================


I have removed the compare validator and tried to test the code.Its working for me except date comparison
But when i hosted and tested the same application in same machine ,one link button which i need to process to
get the desired result (in which the dates are using entered by user)not working am getting the following error in IE...

Error: Sys.WebForms.PageRequestManagerServerErrorException:
String was not recognized as a valid DateTime

I need some immediate help please..
Thanks,
Jennifer




Responses

Posted by: Gemamgall on: 6/28/2012 [Member] Starter | Points: 25

Up
0
Down
Please ensure that JavaScript is enabled on the browser of machine you are testing this .
It doesn't varies on machines it varies from browser to browser

Thanks and Regards,

Vinay Gandhi
www.quadtechindia.com

Jeena, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jeena on: 6/29/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

I have removed the compare validator and tried to test the code.Its working for me except date comparison
But when i hosted and tested the same application in same machine ,one link button which i need to process to
get the desired result (in which the dates are using entered by user)not working am getting the following error in IE...

Error: Sys.WebForms.PageRequestManagerServerErrorException:
String was not recognized as a valid DateTime

Can you help me to solve this issue??

Thanks
Jennifer

Jeena, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jeffie on: 6/29/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Once check the system's calender date format settings and the format you are trying to compare
Problem with DateFormat

Thanks
http://www.alacraft.com.au/

Jeena, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jeena on: 6/29/2012 [Member] Starter | Points: 25

Up
0
Down
hi

Its working in machine(code),not working while hosting (Hosted in same machine)

Thanks
Jenni

Jeena, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response