want if dates selected are in between textbox2 dates and textbox3 dates then textbox1.text=“sumit” else textbox1.text=“No dates”

If i have three textboxes in my vb.net webform ..

Textbox1.text="Sumit"

Textbox2.text="4-Dec-2010"

Textbox3.text="1-Jan-2011"

I want if dates selected are in between textbox2 dates and textbox3 dates then textbox1.text="sumit" else textbox1.text="No dates"

Answers


Put the following in your TextChanged method of your textboxes. Set Textbox1.Text = CheckDates().

Function CheckDates
    'Checks to make sure dates were entered'
    If Not IsDate(Textbox2.text) or Not IsDate(Textbox3.text) Then
        Return "No Dates"
        Exit Function
    End If

    If CType(Textbox2.text,Date) >= #12/4/2010# and CType(Textbox3.text,Date) <= #1/1/2011# then
        Return "Submit"
    Else
        Return "No Dates"
    End If
End Function

Need Your Help

if else if in while loop were else if test is defined in the first cycle

c# datetime if-statement while-loop nullable

Somewhat confusing, especially when trying to describe in a title. Here's some example code. I'm hoping this is possible (I haven't found a way to do it just yet.)

Insert datas from a JavaScript array to another one

javascript arrays arraylist

I have defined two JavaScript variables that are arrays into an array like:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.