title: MVC3 - Value cannot be null or empty. Parameter name: contentType
body: <p>I am currently using Steven Sanderson book Pro ASP.NET MVC 2 Framework. But I am using MVC 3 framwork. This question is related to my previous question. I am getting the following error...</p>
  
  <p>Value cannot be null or empty. Parameter name: contentType pointing at line...<br>
  return File(product.Picture1, product.ImageMimeType);. </p>
  
  <p>In the book he says...</p>
  
  <blockquote>
    <p>We don’t want either of these properties to be directly visible in the product-editing UI. We can use [ScaffoldColumn(false)] to exclude ImageMimeType from the automatically generated UI. We don’t need to give any hints about ImageData because ASP.NET MVC’s built-in object editor template won’t scaffold byte[] properties anyway—it only scaffolds properties of “simple” types like string, int, and DateTime.5. </p>
  </blockquote>
  
  <p>So I have done that and still getting the same error message? If possible how could this be solved. </p>
  
  <p>Index.cshtml</p>
  
  <pre><code>@foreach (var item in Model) 
  &lt;td&gt;
        &lt;img src="@Url.Action("GetImage", "ProductCategoryL2", new { id =  
        @item.SubProductCategoryID })" alt="" height="100" width="100" /&gt; 
      &lt;/td&gt;
  </code></pre>
  
  <p>Edit.cshtml</p>
  
  <pre><code>@using (Html.BeginForm("ProductCategoryL2", "GetImage", FormMethod.Post, 
  new { @enctype = "multipart/form-data" }))
  {
    &lt;div class="editor-field"&gt;
       &lt;img src="@Url.Action("GetImage", "ProductCategoryL2", new { id = 
        @Model.SubProductCategoryID })" alt="" /&gt; 
        @Html.ValidationMessage("Picture1", "*")
       &lt;input type="file" name="Image" size="23"/&gt;
    &lt;/div&gt;
  }
  </code></pre>
  
  <p>cs file</p>
  
  <pre><code>public FileContentResult GetImage(int id)
      {
          var product = db.SubProductCategory2.First(x =&gt; 
          x.SubProductCategoryID == id);
          return File(product.Picture1, product.ImageMimeType); //Value cannot be null or empty. Parameter name: contentType 
      }
  </code></pre>
  
  <p>another cs file </p>
  
  <pre><code>   [ScaffoldColumn(false)]
     public string ImageMimeType { get; set; }
  </code></pre>
  
  <p>I have setup the field for ImageMimeType in the SQL Server 2008R2 exactly same was as in the book. I am using VS 2010 ASP.NET 4.0 MVC3. Thanks in advance. Table name is SubProductCategory2.</p>