title: passing id to ajax call
body: <p>I have a link like this
  <code>&lt;a class="viewp" href="#"&gt;@data.name&lt;/a&gt;</code></p>
  
  <p>and I would like to call a jquery ajax this way</p>
  
  <pre><code>    $(document).ready(function ()
      {
          $('.viewp').click(function (id)
          {
              var responseUrl="~/click?id="+id;                    
              $.ajax(
              {
                  type: "GET",
                  data:id,
                  url:responseUrl,
                  success:success
              });
          });
      });
  </code></pre>
  
  <p>But I don't know how the <code>id</code> of the <code>@data.name</code> is passed into the jquery function.
  If I replace the above link's <code>href</code> with <code>href="~/click?id=@data.id"</code>
  then that is supposed to load the whole page not some specific region and clearly ajax doesn't work also.</p>
  
  <p>[<strong>UPDATE</strong>]</p>
  
  <p>By <code>id</code> I would mean the <code>id</code> primary key of my sql table and I am using webmatrix to code my simple web page. My database table looks like this <code>create table x(id, name)</code></p>