Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Razor if-else statement

@if(DateTime.Now.Year >= 2042)
{
    <span>The year 2042 has finally arrived!</span>
}
else
{
    <span>We're still waiting for the year of 2042...</span>
}
Source by asp.mvc-tutorial.com #
 
PREVIOUS NEXT
Tagged: #Razor #statement
ADD COMMENT
Topic
Name
6+9 =