Looping and branching in Razor view

In this article we will learn looping and branching concept
in Razor view engine in MVC application. This article assumes that the reader has basic understanding of
MVC design pattern. Let’s start with simple example each one of them.

For Loop

Let’s have a look how to implement for loop in Razor view
engine. It’s very similar with normal for loop in C#. Only we have to specify @
symbol in front of loop.