title: JqGrid, give ID of the grid as parameter
body: <p>I'd like to dynamically generate some JqGrid. To do so I loop over a list in order to create the HTML content.</p>
  
  <pre><code>     @foreach(string clientCode in ViewBag.Codes)
       {
          &lt;table class="jqgCode" id="jqgCode+@clientCode" cellpadding="0" cellspacing="0"&gt;&lt;/table&gt;
          &lt;div id="pjqgCode+@clientCode" style="text-align:center;"&gt;&lt;/div&gt;
       }
  </code></pre>
  
  <p>I dynamically generate the id of the grid with the value of the code which is unique.</p>
  
  <p>Basically the grid will have the same format only the data will change, and the code is the parameter that will change the SQL Request. So what I want to do is to retrieve the grid id in order to give to my action in my Controller.</p>
  
  <p>Here is what I'm trying to do:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function () {
      $('.jqgCode').jqGrid({
          //url from wich data should be requested
          url: '@Url.Action("CodeDetail")',
          //type of data
          datatype: 'json',
          //url access method type
          mtype: 'POST',
          postData: {code: $(this).attr('id')},
          .........
        });
   });
  </code></pre>
  
  <p>When I'm looking in the action method "Code Detail" in debug mode, I see that I have a null value in the "code" parameter. </p>
  
  <p>How can I do to have the grid id in my controller. Maybe there is a better way to do what I want to do, so all advice is good to have.</p>
  
  <p>Thanks in advance!</p>