locked
Redirect is the date reached 31 Mar 2018 RRS feed

  • Question

  • User810354248 posted

    In my asp.net+VB=SQL web i want to redirect to another page if the current date is 31 Mar 2018.

    I tried this but it is not working

    If (value.Day >= "31" And MonthName(value.Month, True) >= "Mar" And value.Year >= "2018") Then
                Response.Redirect("user_read_me.aspx")
            End If

    Monday, September 25, 2017 4:08 AM

Answers

  • User-1838255255 posted

    Hi Baiju EP,

    Through your needs, please try the following code:

    Sample Code:

    Dim dateTime As New DateTime(2018, 4, 30)
    If dateTime.Year = 2018 AndAlso dateTime.Month = 4 AndAlso dateTime.Day = 30 Then
    	Response.Redirect("Page1.aspx")
    Else
    	Response.Write("NO meet condition")
    End If

    Best Regards,

    Eric Du

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 25, 2017 8:41 AM