- How to increment local variable inside Razor Syntax, MVC3
- <Div>
- @Code
- Dim i = 1
- End Code
- ....
- some where, i want to increment i's value, expect 'i' value should be incremented by 1 for subsequent use.
- @i = @i + 1
- ..
- </div>
- @{i = i + 1;}
- @Code
- i = i + 1
- End Code
- @Code
- ViewData("Title") = "Index"
- Dim i = 0
- End Code
- <h1>@i</h1>
- <h2>Index</h2>
- @Code
- i = i + 1
- End Code
- <h1>@i</h1>