the From date should be lesser than To Date

 

In my application i have two textboxes.One for From date and the other one 
for To date.

I need to check whether the From date is lesser than To Date..Date formats will be either
(DD-MM-YYYY) or (DD/MM/YYYY).and i have used calendar extender for selecting date

I need the script code to do this...
Thanks in advance
0
usha
3/19/2009 5:49:32 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

2 Replies
1106 Views

Similar Articles

[PageSpeed] 17

DateTime.Compare(t1,t2);

Value Type

Condition

Less than zero 

t1 is earlier than t2.

Zero

t1 is the same as t2.

Greater than zero

t1 is later than t2.


"Object reference not set to an instance of an object"
0
che3358
3/19/2009 7:09:07 PM

from date :(i am using Ajax Calendar Extender )

<td>
                            <asp:TextBox ID="TextBox1" runat="server" Height="19px" Width="116px"></asp:TextBox>
                            <asp:Image ID="Image1" runat="server" ImageUrl="~/images/Calendar.png" />
                            <cc1:CalendarExtender ID="CalendarExtender1" runat="server" PopupButtonID="Image1"
                                Format="dd/MM/yyyy" TargetControlID="TextBox1">
                            </cc1:CalendarExtender>
                        </td>

to date :

<td>
                            <asp:TextBox ID="TextBox2" runat="server" Height="19px" Width="116px" Style="font-family: Verdana"></asp:TextBox>
                            <asp:Image ID="Image2" runat="server" ImageUrl="~/images/Calendar.png" />
                            <cc1:CalendarExtender ID="CalendarExtender2" runat="server" PopupButtonID="Image2"
                                Format="dd/MM/yyyy" TargetControlID="TextBox2">
                            </cc1:CalendarExtender>
                        </td>

 user CompareValidator  Control to validate :

<td>                   
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                            ErrorMessage="Enter Date" ControlToValidate="TextBox1"></asp:RequiredFieldValidator>
                            <br />
                            <asp:CompareValidator ID="CompareValidator1" runat="server"
                            ErrorMessage="Select Right Date Interval" ControlToCompare="TextBox1"
                            ControlToValidate="TextBox2" Operator="GreaterThan" Type="Date"></asp:CompareValidator>
                           
                    </td>


Sagnik Mukherjee,
Thanks.
0
sagnikmukh
3/19/2009 7:11:21 PM
Reply:

Similar Artilces:

Dates, Dates, Dates!
Hello all... I am in the process of building an appointment system, and I am trying to see if I can get some pointers on which way to go on this. The first version of this appointment system was very lo-tech, and it stored all of the possible dates/times in the database. Once a user booked an appointment, their information was logged to that date/time, and then that date/time would no longer show in the list of possible openings. This was great for a temporary fix, but with having to pre-populate all of the dates/times, the system would eventually have to be updated to continue on pa...

How to convert a chinese date to english date in web form?
Hi ASP.NET Proz,  I try to convert a chinese charater date (18-一月-2008) to english date (18-Jan-2008) from a web form. Is that possible?  Thanks in advance for the Proz!  * .NET Proz always make impossible to possible Try this one:   System.Globalization.CultureInfo nlCulture = new System.Globalization.CultureInfo("zh-CHT"); // Chinese Traditional DateTime date = DateTime.MinValue; DateTime.TryParseExact(chineseDateString, "dd-MMM-yyyy", nlCulture, System.Globalization.DateTimeStyles.None, out date); ...

from date to date
I am working on a form for livestock. one of the things in the form is a checkbox to let me know if they qualify or not. the second is I have a created record field entered into the database... now my question is I am doing a search on this and cant figure it out since i am new to all this...i have a query that selects the qualification checkbox (where qualify = 'true') then another query that selects the created record date... and the search is that I want to get the information in the livestock that are qualifyed (have the checkbox qualify = to 'true') between  one dat...

From Date and To Date
 In my application i have two textboxes.One for From date and the other one for To date.I need to check whether the From date is lesser than To Date..Date formats will be either(DD-MM-YYYY) or (DD/MM/YYYY).and i have used calendar extender for selecting dateI need the script code to do this...Thanks in advance See this thread: http://forums.asp.net/t/1346328.aspxMohsin Naeem"Please mark as answer if it helped you"  <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </...

convert date christian date to persian date
hi, I need to convert christain date that was produced in my Sql database to persian date like" دوشنبه 21 مرداد 1378" in a datalist.Could you recommend me any function.I use VisualStudio 2005 & VB. thanks in advance Sepid Take a read of http://www.codeproject.com/KB/database/PersianDateInSQLServer.aspx or maybe a javascript route like http://www.codeproject.com/KB/gadgets/PersianDateViewerGadge.aspx Hope it helpsRegardsJeremyIf this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.That way future readers will ...

dates between date ranges
hi, i need 1 help regarding query, i have Startdate and Enddate using SELECT statement i need all the dates between these 2 dates, is it possible or i had to do it programatically, or i had insert data only please helpThanksParthvisit for some interesting articals at www.parthrawal.blogspot.comMark as Answer if it helps you  declare @temp table ( [date] datetime ) declare @startdate datetime,@enddate datetime set @startdate = getdate() -- here you can write a select stmt as "select startdate from tablename" set @enddate = getdate() + 10 -- here you can write a ...

No date in Date field
I have just installed thunderbird on my system. I migrated from outlook express. All the mail that was there before shows both the date and the time in the date field. However, all mail received by thunderbird only has a time stamp, no date. How do I correct this?? Thanks, Roger _Roger Bailey_ spoke thusly on 29/08/2006 10:09 PM: > I have just installed thunderbird on my system. I migrated from outlook > express. All the mail that was there before shows both the date and the > time in the date field. However, all mail received by thunderbird only has ...

compare date to a date
I have in a where clause the following statement. SELECT "sales"."sale_date", "sales"."ling_no", "sales"."course_no", "sales"."product_no", "sales"."service_no", "sales"."quantity", "sales"."amount", "payment"."amount", "payment"."payment_form" FROM "payment", "sales" WHERE ( "sales".&...

calendar date span (date start : date end)
Hi! Can anyone help me with this? Say, I have these two textboxes. Date Start:        Date End:             What I wanted to do is to put dates on it using the calendar. My problem is I do not know what to do to keep the "Date Start" not way after the set "Date End", and for "Date End" not way before the set "Date Start".   example: Date Start: July 1, 2008              &nb...

Date() == new Date()
Ecma wise, what's the expected return from the above, true or false? I know 'Date()' called as a function returns a string, while 'new Date()' returns an object. I also know Date.toString() is getting called (SM) for 'new Date()' before the '==' equality operator is evaluated (to 'true'). What's the expected return for Date() === new Date()? Thanks for the attention! Celso Celso Aguiar wrote: > Ecma wise, what's the expected return from the above, true or false? > I know 'Date()' called as a function returns a string...

search date TO date
Hii all...haii..im still beginner in asp.net..here i want to know how to create search date until date?here is my example:- Hi, I don't see your code------------------------if an answer, mark it so. Hi yanz_shi, As mentioned, we couldn't see your example. Please check the thread after you've created it so that we can help you better. Also, for searching between two dates, you could do it like this: select * from tab where dt between date1 and date2 Thanks.David QianMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark ...

How to convert Julian date into Calendar date (VB.Net)
Hi all, I have some dates which are in Julian format and I need to convert them into calendar dates  for example if the Julian date is 1, I need to be able to convert it into 1/1/2007, If the julian date is 66 then I would need to convert it to 3/7/2007 and so on. Every year would start with 1 and end with 365365 = 12/31/2007. Is there a vb.net function or tutorial somewhere ? thanks for any help.    1) Your dates aren't in Julian format!! 2) How do you know which year you are referring to? 3) Have you tried the AddDays function of the Date/DateTim...

date field = date
i made an news table and i made and option to add and update and delete news from it i need one thing that when someone try to add news the time that he insert the news will be in teh date field of the table and dont the costumer write it   hope that u understand me Hi, did you mean you want to add a column that get current date as its value automaticly? If so, you can do the following in Access2003: 1. add a column with 'Date/Time' data time 2. In the 'Field Properties'->'General' pannel, add a 'Default Value' for it, 3. In the 'Expression Builder', double cli...

Filter for null dates, dates less than other specific date
Hi, I want to get those rows from a datawindow which has date value as null or the date value is less than some other specific date. I need to do this after the data is retrieved using filter. Its equivalent in SQL would be like my_date < TO_DATE('11/20/2007','MM/DD/YYYY') OR my_date IS NULL Please let me know how this can be achieved to filter data in datawindow. DaysAfter() and IsNull() are your friends. <prabhakar.narvekar@gmail.com> wrote in message news:8be40319-722a-4dca-bba2-9e076a41ac5f@s19g2000prg.googlegroups.com... > Hi, > I ...

Web resources about - the From date should be lesser than To Date - asp.net.web-forms

South Korea resumes propaganda broadcasts hated by North
South Korea on Friday resumed high-decibel propaganda broadcasts into North Korea as the United States ramped up pressure on China to bring Pyongyang ...

Asian equities swing as China tries to settle markets
Chinese equities led another day of volatility across Asia on Friday as investors were panicked by Beijing's attempts to stabilise its beleaguered ...

A rollable TV, an exoskeleton and more: Stories from the second day of CES
As CES reaches its halfway point, we talk about what's hot, what's happening and what's wowing us.

Paris Police Kill Attacker Wearing Fake Explosive Vest
On Thursday, the Associated Press reports , outside a police station, in Paris, police officers shot and killed a man waving a knife and wearing ...

List of Golden Globe nominees
Los Angeles (AFP) - Here are the nominees in key categories for the 73rd Golden Globe Awards, which will be handed out on Sunday in Beverly Hills: ...

'Game of Thrones' is Nearing a Renewal for Seasons 7 & 8
Fans of Game of Thrones probably saw this coming already, but it’s exciting to hear that it’s almost official! The hit HBO series is close to ...

Obama Takes Anderson Cooper To Task For Defending Conspiracy Theorists
At the end of tonight's CNN special, Guns in America, President Obama took a moment to address the conspiracy theories that always swirl whenever ...

Nina Dobrev & Ruby Rose in Talks to Join Vin Diesel's 'XXX 3'
Nina Dobrev and Ruby Rose are both in talks to join the upcoming movie xXx: The Return of Xander Cage alongside Vin Diesel ! While a sequel ...

T-Mobile Binge On gets 14 more services, Legere speaks up
T-Mobile's Binge On near unlimited video streaming feature has become the carrier's most popular Un-carrier moves. At least according to the ...

The £100million lottery weekend with two jackpots on Friday and Saturday
The weekend of massive cash prizes has triggered a rush to buy tickets, with sales running at up to 200 a second. There was no winner of the ...

Resources last updated: 1/8/2016 5:24:40 AM