title: ASP.NET MVC Passing DataTime to View a
body: <p>I have a asp.net MVC4 web project it shows a list of production data for that day. I have added a datetime picker which allows the user to select a date that they want to show information for.</p>
  
  <p>The problem i am having is i am not sure how to go about passing the information back to the view from the method i have inside the controller.</p>
  
  <p>I have the date passing back to the controller. Inside the controller i am doing a LINQ statement that allows me to select only the production data for that day.</p>
  
  <pre><code>  [HttpPost]
      public ActionResult GetProductionDateInfo(string dp)
      {
          DateTime SelectedDate = Convert.ToDateTime(dp);
          DateTime SelectedDateDayShiftStart = SelectedDate.AddHours(7);
          DateTime SelectedDateDayShiftEnd = SelectedDate.AddHours(19);
  
          var ProductionData =
  
              from n in db.tbl_dppITHr
              where n.ProductionHour &gt;= SelectedDateDayShiftStart
              where n.ProductionHour &lt;= SelectedDateDayShiftEnd
              select n;
  
  
          return View();
  </code></pre>
  
  <p>I am looking to get the Var ProductionData passed back to the view so that display it inside a table.</p>