Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET SQL-Server
<asp:Gridview ID="GridView01" runat="server" Width='100%' ShowFooter="true" AutoGenerateColumns="false">
<asp:BoundField DataField="SI" HeaderText="SI" />

<asp:TemplateField HeaderText="From Time">

<asp:TextBox ID="txtFromTime" CssClass="txtLeftNormal" autocomplete="off" size="5" MaxLength="6" runat="server" text='<%#Container.dataitem("FromTime")%>'>
 
<ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtFromTime" Mask="99:99" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus" önInvalidCssClass="MaskedEditError" MaskType="Time" AcceptAMPM="false" ErrorTooltipEnabled="True" />
<ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator2" runat="server" ControlExtender="MaskedEditExtender2" ControlToValidate="txtFromTime" ValidationGroup="ValidGroup1" IsValidEmpty="true" EmptyValueMessage="Time is required" InvalidValueMessage="Time is invalid" Display="Dynamic" CssClass='lblValidate' TooltipMessage="Railway Time" EmptyValueBlurredText="*" InvalidValueBlurredMessage="ERROR : Invalid Time!! " />
 
<asp:requiredfieldvalidator id="Requiredfieldvalidator2" runat="server" ControlToValidate="txtFromTime" CssClass="lblValidateGroup" ErrorMessage="#" ValidationGroup="ValidGroup1" Text="#">

 

<asp:label id="Label15" Width="30" Runat="server" ForeColor='Red' CssClass='lblValidateGroup'>#


 
<asp:TemplateField HeaderText="To Time">

<asp:TextBox ID="txtToTime" CssClass="txtLeftNormal" autocomplete="off" size="5" MaxLength="6" runat="server" text='<%#Container.dataitem("ToTime")%>'>
 
<ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="txtToTime" Mask="99:99" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus" önInvalidCssClass="MaskedEditError" MaskType="Time" AcceptAMPM="false" ErrorTooltipEnabled="True" />
<ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator3" runat="server" ControlExtender="MaskedEditExtender3" ControlToValidate="txtToTime" IsValidEmpty="true" ValidationGroup="ValidGroup1" EmptyValueMessage="Time is required" InvalidValueMessage="Time is invalid" Display="Dynamic" CssClass='lblValidate' TooltipMessage="Railway Time" EmptyValueBlurredText="*" InvalidValueBlurredMessage="ERROR : Invalid Time!! " />
<asp:requiredfieldvalidator id="Requiredfieldvalidator3" runat="server" ControlToValidate="txtToTime" CssClass="lblValidateGroup" ErrorMessage="#" ValidationGroup="ValidGroup1" Text="#">




 

 

I want to Compare FromTime and ToTime
 
regards,
Nirmal.M
Posted 9-Jul-13 23:30pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Use  the asp:RangeValidator
  Permalink  

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



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 14 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100