title: comma decimal seperator in asp.net mvc 5
body: <p>im desperately trying to make asp.net work with the comma symbol as the decimal seperator but this seems to be a lot harder then necessary... </p>
  
  <p>i've done everything that's in this tutorial <a href="http://www.asp.net/mvc/overview/getting-started/introduction/examining-the-edit-methods-and-edit-view" rel="nofollow noreferrer">http://www.asp.net/mvc/overview/getting-started/introduction/examining-the-edit-methods-and-edit-view</a></p>
  
  <p>tried this in the root web config</p>
  
  <pre><code>&lt;system.web&gt;
      &lt;globalization culture="de-DE" uiCulture="de-DE" /&gt;
  &lt;/system.web&gt;
  </code></pre>
  
  <p>stepped through the jQuery code - the globalization there seems to work. </p>
  
  <p>i'm using a get request with a model view Controller that looks like this </p>
  
  <pre><code>public class SearchCalcViewModel
  {
          public SearchCalcViewModel() { }
  
          public IEnumerable&lt;Calculation&gt; Calculations { get; set; }
          [Display(Name="Name")]
          public string Name { get; set; }
          [Display(Name="Height")]
          public decimal? Height { get; set; }
  }
  </code></pre>
  
  <p>the get request is called in the in the maincontroller - so that strengthens my assumption that the jquery culture dependent validation is working and something in the .net culture is awry even though Thread.CurrentTHread.CurrentCulture / CurrentUICulture is set correctly too. </p>
  
  <p>When i try to fill in 3,0 as a height I get the following error message:</p>
  
  <p>The value '3,0' is not valid for Height.</p>
  
  <p>This is the import part of my view:</p>
  
  <pre><code>@using (Html.BeginForm("Search", "Main", FormMethod.Get))
  
  &lt;div class="form-group"&gt;
           @Html.LabelFor(m =&gt; m.Height, new { @class = "col-md-2 control-label" })
          &lt;div class="col-md-10"&gt;
               @Html.TextBoxFor(m =&gt; m.Height, new { @class = "form-control"})
               @Html.ValidationMessageFor(m =&gt; m.Height)
          &lt;/div&gt;
       &lt;/div&gt;
  }
  </code></pre>
  
  <p>this is my MainController:</p>
  
  <pre><code>public ActionResult Search(SearchCalcViewModel searchViewModel)
      {
          searchViewModel.Products = db.Products;
          searchViewModel.Calculations = from c in db.Calculations select c;
  
  
          if (searchViewModel.Height.HasValue)
          {
              searchViewModel.Calculations =  searchViewModel.Calculations.Where(c =&gt; c.Length == searchViewModel.Height);
          }
  
  
          return View(searchViewModel);
      }
  </code></pre>
  
  <p>i've stepped into the modelstate and somehow the culture is different from my current culture</p>
  
  <p><img src="https://i.stack.imgur.com/xkvkT.png" alt="wrong culture"></p>