title: Simple increment of a local variable in views in ASP.NET MVC3 (Razor)
body: <p>Well, this is just embarrassing.  I can't even figure out a simple increment in one of my views in ASP.NET MVC3 (Razor).  I have done searches and it appears that the documentation for Razor is pretty sparse.  Here is what I have tried and failed miserably:</p>
  
  <pre><code>@{
      var counter = 1;
  
      foreach (var item in Model.Stuff) {
          ... some code ...
          @{counter = counter + 1;}
      }
  }   
  </code></pre>
  
  <p>I have also tried <code>@{counter++;}</code> just for kicks and to no avail =)  I would appreciate it if someone could enlighten me.  Thanks!</p>