title: Using HTML.EditorFor Vs using HTML.CheckBox
body: <p>I have the following model class which contains a bool value:-</p>
  
  <pre><code>Public class Server
  {
          public bool IsIPUnique { get; set; }
  }
  </code></pre>
  
  <p>Currently i am using the following to display the check box inside my Razor view:-</p>
  
  <pre><code>&lt;input type="CheckBox" name="IsIPUnique" value="true" @(Html.Raw(Model.IsIPUnique ? "checked=\"checked\"" : ""))/&gt; IP Unique.
  </code></pre>
  
  <p>but i read about the EditorFor template, and it can automatically create the check box and check/uncheck it based on the model values so i tried the following  :-</p>
  
  <pre><code>@Html.EditorFor(model=&gt;model.IsIPUnique)&lt;span&gt;test&lt;/span&gt;
  </code></pre>
  
  <p>so my question is if i can replace my old code with the new one that uses the EditorFor ?, or asp.net mvc might deal with these values differently ?
  Thanks</p>