title: K-MVC client and server side validation
body: <p>5 days I spent on problem and can not find an issue.
  I use <a href="http://knockoutmvc.com/" rel="nofollow">K-MVC</a>
  for submit data in my project. Here is simple example: 
  1) Controller</p>
  
  <pre><code>   public class TechnologyController : KnockoutController
  {
       public ActionResult AddTechnology()
      {
          var model=new TechnologyViewModel();
          return View(model);
      }
  
      [HttpPost]
      public ActionResult AddTechnology(TechnologyViewModel viewModel)
      {
          if(ModelState.IsValid)
          {
              _serviceClient.AddTechnology(viewModel);
              viewModel.SavedSaccessfully = true;
          }
          return Json(viewModel);
      }
  }
  </code></pre>
  
  <p>2) Model</p>
  
  <pre><code>    public class TechnologyViewModel
  {
      public int TechnologyId { get; set; }
  
      [Required]
      public string Name { get; set; }
  
      public bool IsActual { get; set; }
  
      public bool SavedSaccessfully { get; set; }
  }
  </code></pre>
  
  <p>3) Razor</p>
  
  <pre><code>    @using PerpetuumSoft.Knockout
  @model Core.ViewDataModel.TechnologyViewModel
  
  @{
      var ko = Html.CreateKnockoutContext();
      ViewBag.Title = "New technology";
  }
  
  @using (ko.If(m =&gt; m.SavedSaccessfully))
  {
      @ko.Html.Span("NEW TECHNOLOGY SAVED TO DATABASE.")
  }
  
  @using (ko.If(m =&gt; m.SavedSaccessfully == false))
  {
       using (ko.Html.Form("AddTechnology", "Technology", ko.Model))
       {
           &lt;p&gt;@Html.Label("Name: ") @ko.Html.TextBox(m =&gt; m.Name).ValueUpdate(KnockoutValueUpdateKind.AfterKeyDown) &lt;/p&gt;
           &lt;p&gt;@Html.Label("Active : ")         @ko.Html.CheckBox(m =&gt; m.IsActual).ValueUpdate(KnockoutValueUpdateKind.Change) &lt;/p&gt;
  &lt;/p&gt;
           &lt;p&gt;
              &lt;input class="submitButton" type="submit" value="Create" /&gt;
           &lt;/p&gt;
       }
  }
  @ko.Apply(Model)
  </code></pre>
  
  <p>It is work fine. Then not valid model receives in controller it will not submit. But if model sends back nothing happens. The validation messages does not appear. I tried to put in like standard MVC:</p>
  
  <pre><code>using (ko.Html.Form("AddTechnology", "Technology", ko.Model))
   {
       Html.EnableClientValidation();
  
       &lt;p&gt;@Html.Label("Name: ")            @ko.Html.TextBox(m =&gt; m.Name, new{name="Name"}).ValueUpdate(KnockoutValueUpdateKind.AfterKeyDown) @Html.ValidationMessageFor(m=&gt;m.Name) &lt;/p&gt;
       &lt;p&gt;@Html.Label("Active : ")         @ko.Html.CheckBox(m =&gt; m.IsActual).ValueUpdate(KnockoutValueUpdateKind.Change) &lt;/p&gt;
  
       &lt;p&gt;
          &lt;input class="submitButton" type="submit" value="Create" /&gt;
       &lt;/p&gt;
   }
  </code></pre>
  
  <p>But It does not work. Help, please! SOS! ---...---...---... :) </p>