title: grab IDs from list items to update div with ajax
body: <p>I'm a little stuck here. I have a page that displays three different views by loading with jQuery: a view of all categories associated with the user, the image and name of all the items within the category that is selected and a full detail view of all the properties of the item selected. HOw to get the id of the category selected than display the items and same with the item to display the full details. Ajax isn't the problem, so I think.</p>
  
  <p>When the user clicks on an <code>&lt;li&gt;</code> within the <code>test &lt;div&gt;</code> this fires to retrieve items for that category</p>
  
  <pre><code>$(document).ready(function() {
  $('#test li').click(function() {
      //get id of cat selected
      $.ajax({
          url: "",
          type: "POST",
          data: {//return all the item info},
          success: function(data) {
              //when returns display updated results
          }
      });
  });
  </code></pre>
  
  <p>I figure it would be the same as when you click an item. But how to write the query for the controller. Right now I'm just displaying all:</p>
  
  <pre><code>//Item Controller
  //two queries; one for displaying items when certain cat is selected and
  // another to display full details when an item is selected
  
  public ActionResult Partial(Item item)
      {
  
          //var query = from i in db.Items
          //            orderby i.dateAdded
          //            where i.user_id==4
          //            select i;
          //var results = query;
  
  
           var model = db.Items;
  
  
          return PartialView("_Partial1", model);
  
      }
      public ActionResult PartialTwo() //pass in the catId??
      {
          var query = from d in db.Items
                      // how to get catID which is in the item table?
                      select d;
          var results = query;
  
  
          return PartialView("_FullInfoPartial", results);
  
      }
      //Category controller
      //get the categories from 
      public ActionResult GetCats( Category cat)
      {
          var query = from c in db.Cats where c.user_id == 4 orderby c.catId select c;
          var results = query;
          return PartialView("_PartialGetCats", results);
      }
  </code></pre>
  
  <p>Am I on the right track?</p>