Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to do if statement based on date in asp net c#

@{var date = DateTime.Now; 

        if (date>= 12/1/2021 && date<= 1/15/2021)
        {
            @Styles.Render("~/Content/css")
        }
        else
        {
            @Styles.Render("~/Content/css1")
        }

    }
 
PREVIOUS NEXT
Tagged: #statement #based #date #asp #net
ADD COMMENT
Topic
Name
5+8 =