Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Razor support elseif?

Intellisense makes it look like probably not.

like image 664
justSteve Avatar asked Dec 25 '10 16:12

justSteve


People also ask

Does ASP.NET MVC use razor?

Razor has no ties to ASP.NET MVC because Razor is a general-purpose templating engine. You can use it anywhere to generate output like HTML. It's just that ASP.NET MVC has implemented a view engine that allows us to use Razor inside of an MVC application to produce HTML.

What are Razor expressions used for?

Razor provides expression encoding to avoid malicious code and security risks. In case, if user enters a malicious script as input, razor engine encode the script and render as HTML output.

What is Razor engine in mvc?

Razor View Engine is a markup syntax which helps us to write HTML and server-side code in web pages using C# or VB.Net. It is server-side markup language however it is not at all a programming language.


1 Answers

Since you didn't specify a language I'll give you both. :)

CSharp

@if (true) {
    AlwaysDoStuff();
} else if (false) { 
    NeverDoThis();
}

Visual Basic

@If True Then
    AlwaysDoStuff()
ElseIf False Then
    NeverDoThis()
End If
like image 142
Buildstarted Avatar answered Sep 30 '22 22:09

Buildstarted