title: MVC controller view binding
body: <p>Am new to MVC and am trying below scenario but am struck how to proceed.</p>
  
  <p>In my webpage i have several section and each section has comments below it. and for fetching the comments i have written a function  inside the controller as below </p>
  
  <pre><code>public ActionResult ShowPreviousComments()
          {
              Comments com = new Comments();
  
              LstComments savedComments = new LstComments();
  
              ///Entity code here
  
  
              foreach (var item in comments)
              {
                  com.comments = item.Comments;
                  com.dTime = item.Time;
  
                  savedComments.lstCommet.Add(com);
  
              }
  
              return View();
          }
  </code></pre>
  
  <p>and model data below so i can get the list in the view</p>
  
  <pre><code>public class Comments
      {
          public string comments { get; set; }
  
          public DateTime? dTime { get; set; }
  
          public int airPortId { get; set; }
  
      }
  
      public class  LstComments
      {
          public List&lt;Comments&gt; lstCommet { get; set; }
      }
  </code></pre>
  
  <p>My doubt is how i can hit the controller during the pageload for each sections ?</p>
  
  <p>Sorry if it sounds silly or some error. Please post if i can do it in  a better way </p>
  
  <p>Thanks</p>