title: Razor View rendered as text
body: <p>I have the Template MVC 4 change password view returning text instead of html:</p>
  
  <p>Password View:</p>
  
  <pre><code>@model Heelp.ViewModels.LocalPasswordViewModel
  
  &lt;p&gt;@ViewBag.StatusMessage&lt;/p&gt;
  
  @if(Model.HasLocalPassword)
  {
      @Html.Partial(MVC.Account.Views._ChangePasswordPartial)
  }
  else
  { 
      @Html.Partial(MVC.Account.Views._SetPasswordPartial)
  }
  </code></pre>
  
  <p>And the ChangePartial View:</p>
  
  <pre><code>@model Heelp.ViewModels.LocalPasswordViewModel
  
  @if (!String.IsNullOrEmpty(Model.Result))
  {
      &lt;div class="result"&gt;
          @Model.Result
      &lt;/div&gt;
  }
  @if (!Model.ChangePasswordSucceeded)
  {
      using (Html.BeginForm(MVC.Account.Password())) 
      {
          @Html.AntiForgeryToken()
  
          @Html.LabelFor(m =&gt; m.OldPassword)
          @Html.PasswordFor(m =&gt; m.OldPassword)
          @Html.ValidationMessageFor(m =&gt; m.OldPassword)
          &lt;br /&gt;
          @Html.LabelFor(m =&gt; m.NewPassword)
          @Html.PasswordFor(m =&gt; m.NewPassword)
          @Html.ValidationMessageFor(m =&gt; m.NewPassword)
          &lt;br /&gt;
          @Html.LabelFor(m =&gt; m.ConfirmPassword)
          @Html.PasswordFor(m =&gt; m.ConfirmPassword)
          @Html.ValidationMessageFor(m =&gt; m.ConfirmPassword)
          &lt;br /&gt;
          &lt;input type="submit" value="@HeelpResources.ChangePasswordPartialSubmitButtonLabel" /&gt;
      }
  }
  </code></pre>
  
  <p>And finally the controller:</p>
  
  <pre><code>    [HttpPost]
      [ValidateAntiForgeryToken]
      public virtual ActionResult Password(LocalPasswordViewModel model)
      {
          // Has this information is lost in the roundtrip between the Controller and the Action, we need to get this information again
          model.HasLocalPassword = OAuthWebSecurity.HasLocalAccount(WebSecurity.GetUserId(User.Identity.Name));
  
          if (model.HasLocalPassword)
          {
              if (ModelState.IsValid)
              {
                  // It's a local account so update the new password
                  model.ChangePasswordSucceeded = WebSecurity.ChangePassword(User.Identity.Name, model.OldPassword, model.NewPassword);
              }
  
              // Send back to the View the results of the operation
              model.Result = model.ChangePasswordSucceeded ? HeelpResources.AccountManagePasswordChangeSucessMsg : HeelpResources.AccountManagePasswordChangeErrorMsg;
  
              return View(model);
          }
          else
          {
              try
              {
                  // It's not a local account so create the account based on the external information and the password
                  WebSecurity.CreateAccount(User.Identity.Name, model.NewPassword);
                  model.ChangePasswordSucceeded = true;
              }
              catch (Exception)
              {
                  model.ChangePasswordSucceeded = false;
              }
  
              // User does not have a local password so remove any validation errors caused by a missing OldPassword field
              ModelState state = ModelState["OldPassword"];
              if (state != null)
              {
                  state.Errors.Clear();
              }
  
              // Send back to the View the results of the operation
              model.Result = model.ChangePasswordSucceeded ? HeelpResources.AccountManagePasswordSetSucessMsg : HeelpResources.AccountManagePasswordSetErrorMsg;
          }
  
          return View(model);
      }
  </code></pre>
  
  <p>And when I submit the Password Change Form I get the page in text format:</p>
  
  <pre><code>&lt; !DOCTYPE html &gt;
  &lt; html xmlns="http://www.w3.org/1999/xhtml" &gt;
  &lt; head &gt;
    &lt; meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
    &lt; title&gt;izigo | tudo fica mais fácil&lt;/title&gt;
    &lt; meta name="viewport" content="width=960, user-scalable=yes"/&gt;
  </code></pre>
  
  <p>//REST OF THE TEXT PAGE</p>
  
  <p>Any ideas why is this happening?</p>
  
  <p>Thanks.</p>