title: Parser error in mvc3 razor code
body: <p>I'm getting this error in my cshtml file   near this code</p>
  <pre><code>@{      
      var options = new OpenIdSelector();
      options.TextBox.LogOnText = &quot;Log On&quot;;
  }
  </code></pre>
  <p>Parser Error</p>
  <blockquote>
  <p>Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.</p>
  <p>Parser Error Message: Unexpected &quot;{&quot; after &quot;@&quot; character. Once inside the body of a code block (@if {}, @{}, etc.) you do not need to use &quot;@{&quot; to switch to code.</p>
  </blockquote>
  <hr />
  <pre><code>@using DotNetOpenAuth.Mvc
  @using DotNetOpenAuth.OpenId.RelyingParty
  @{ 
   ViewBag.Title = &quot;Log On&quot;; 
  }
  &lt;div id=&quot;login-oauth&quot;&gt;
          &lt;h3&gt;via 3rd Party (recommended)&lt;/h3&gt;
          
          @{ Html.RenderPartial(&quot;LogOnContent&quot;);}
  
  
      &lt;/div&gt;
      &lt;div id=&quot;or&quot;&gt;OR&lt;/div&gt;
      &lt;div id=&quot;login-account&quot;&gt;
          &lt;h3&gt;using a account&lt;/h3&gt;
           &lt;/div&gt;
      @using (Html.BeginForm())
      {
          &lt;div&gt;
              &lt;p&gt;
                  &lt;label for=&quot;username&quot;&gt;Username:&lt;/label&gt;
                  @(Html.TextBox(&quot;username&quot;))
                  @(Html.ValidationMessage(&quot;username&quot;, &quot;*&quot;))
              &lt;/p&gt;
              &lt;p&gt;
                  &lt;label for=&quot;password&quot;&gt;Password:&lt;/label&gt;
                  @(Html.Password(&quot;password&quot;))
                  @(Html.ValidationMessage(&quot;password&quot;, &quot;*&quot;))
              &lt;/p&gt;
              &lt;p&gt;
                  @(Html.CheckBox(&quot;rememberMe&quot;)) &lt;label class=&quot;inline&quot; for=&quot;rememberMe&quot;&gt;Remember me?&lt;/label&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  &lt;input class=&quot;classiclogon&quot; type=&quot;submit&quot; value=&quot;Log On&quot; /&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  Please enter your username and password. @(Html.ActionLink(&quot;Register&quot;, &quot;Register&quot;)) if you don't have an account.
              &lt;/p&gt;
          &lt;/div&gt;
     
      
          
   @{     
       {
              var options = new OpenIdSelector();
              options.TextBox.LogOnText = &quot;Log On&quot;;
  }
          }
         @MvcHtmlString.Create(Html.OpenIdSelectorScripts(options, null))
     @* @(Html.OpenIdSelectorScripts(this.Page, options, null))*@
      
      }
  </code></pre>