title: Binding conflict between a property named Title in my Model and View.Title in my View (in MVC)
body: <p>My Model contains a property named <code>Title</code>, and in my <code>Create</code> view I set the page title using <code>ViewBag.Title</code>.</p>
  
  <p>This creates the following problem: the form generated by <code>Html.Editor</code> will display the text from <code>ViewBag.Title</code>, instead of the model's <code>Title</code> value.</p>
  
  <p>The only workaround I have found is first calling <code>Html.Editor</code>, and then setting the <code>View.Title</code>.</p>
  
  <p>Does anyone have a better solution?</p>
  
  <p>Edit 1: I am using MVC 3.</p>
  
  <p>Edit 2: This is my <code>DisplayTemplates/Object.cshtml</code>:</p>
  
  <pre><code>@model dynamic
  @using Iconum.VS10CS040.Library.Web.MVC3.Helpers
  
  @if (ViewData.TemplateInfo.TemplateDepth &gt; 1) {
      &lt;span class="editor-object simple"&gt;@ViewData.ModelMetadata.SimpleDisplayText&lt;/span&gt;
  } else {
      foreach (var prop in ViewData.ModelMetadata.Properties.Where(
              pm =&gt; 
                  pm.ShowForEdit 
                  &amp;&amp; !ViewData.TemplateInfo.Visited(pm)      
                  &amp;&amp; pm.ModelType != typeof(System.Data.EntityState)
                  &amp;&amp; !pm.IsComplexType             
              )
          ) 
          {
          if (prop.HideSurroundingHtml) {
              &lt;text&gt;@Html.Editor(prop.PropertyName)&lt;/text&gt;
          } else {
              string css = "";
              if (prop.Model != null &amp;&amp; prop.Model.GetType() != null)
              {
                  css += " " + prop.Model.GetType().ToString().ToLower().Replace('.', '-');
              }
              if (prop.DataTypeName != null)
              {
                  css += " " + prop.DataTypeName.ToLower();
              }
              if (prop.IsRequired &amp;&amp; prop.ModelType.FullName != "System.Boolean")
              {
                  css += " required";
              }
  
              &lt;div class="editor-container @css"&gt;
                   &lt;div class="editor-label"&gt;
                      @if (!String.IsNullOrEmpty(Html.Label(prop.PropertyName).ToHtmlString()))
                      {
                          // Use LabelWithForThatMatchesTheIdOfTheInput instead of Label because of a bug (fixed in MVC 3)
                         @Html.LabelWithForThatMatchesTheIdOfTheInput(prop.PropertyName)
                      }
                      @if (prop.IsRequired &amp;&amp; prop.ModelType.FullName != "System.Boolean")
                      {
                          @Html.Raw(" &lt;span class=\"required\"&gt;*&lt;span&gt;");
                      }
                  &lt;/div&gt;
                  &lt;div class="editor-field"&gt;
                      @* This the line that causes my problem *@
                      @Html.Editor(prop.PropertyName) 
                      @Html.ValidationMessage(prop.PropertyName)
                  &lt;/div&gt;
              &lt;/div&gt;
          }
          } //foreach
  
      // Loop though all items in the Model with an TemplateHint (UIHint)
      foreach (var prop in ViewData.ModelMetadata.Properties.Where(
             pm =&gt; pm.ShowForEdit
             &amp;&amp; !ViewData.TemplateInfo.Visited(pm)
             &amp;&amp; pm.ModelType != typeof(System.Data.EntityState)
             &amp;&amp; !pm.IsComplexType
             &amp;&amp; pm.TemplateHint != null
             &amp;&amp; (
              pm.TemplateHint == "jWYSIWYG0093"
              ||
              pm.TemplateHint == "jQueryUIDatepicker"
              ||
              pm.TemplateHint == "CKEditor"
             )
             )
         )
      {
          // TODO: check for duplicate js file includes
          @Html.Editor(prop.PropertyName, prop.TemplateHint + "-Script")
      }    
  
  }
  </code></pre>