Hello, I have a table, in it an IDName column, I need to click on the row to pull out the IDName value and pass this value to the controller.

<table id="example"> <thead> <tr> <th> IDClaim </th> <th> IDname </th> <th> Текущая задача </th> <th> Дата старта </th> </tr> </thead> @foreach (var item in Model) { <tr> <td> @Html .DisplayFor(modelItem => item.IDClaim) </td> <td id="IDName"> @Html .DisplayFor(modelItem => item.IDName) </td> <td style="text-align:left" id="Content"> @Html .DisplayFor(modelItem => item.Content) </td> <td> @Html .DisplayFor(modelItem => item.StartDate) </td> </tr> } </table> ______ <script> $(document).ready(function() ``{ $('#example tbody tr').live('click', function () ``{ var nTds = $('td', this); var sClaim = $(nTds[1]).text(); alert(sClaim) }); }); </script> 

Hike, I did something wrong) Thanks in advance!

  • So what's the problem? - DreamChild
  • Well, I need the value of sClaim to open the form, i.e. each sClaim value will have its own form. - aspnetmvc
  • Well, so I ask again - the problem is what? - DreamChild
  • I can't transfer the sClaim value to the controller. - aspnetmvc
  • one
    and how are you trying to do this? Anyway, I don’t see it in your code - DreamChild

0