title: Why is the view model null?
body: <p>I have the following structure: </p>
  
  <p>Controller.cs</p>
  
  <pre><code>public ActionResult PageMain(string param)
  {
      return View();
  }
  </code></pre>
  
  <p>PageMain.cs</p>
  
  <pre><code>namespace project1.Models
  {
      public class PageMain
      {
          public DataTable dtable
          { 
               get {
                         // some code that returns a DataTable
               }
          }
       }
  }
  </code></pre>
  
  <p>and finally in the view:</p>
  
  <pre><code>@using project1.Models
  @model PageMain
  
  var datatable = Model.dtable // but this is throwing an error since the model is null
  </code></pre>
  
  <p>Does anyone know why my model is returning null? How can I access the datatable in the PageMain.cs? I am new to MVC so if I have any logical error in the structure please do not hesitate in warning me :)</p>