Im filling a table with Razor in my view:

<tbody>
@{
    foreach (var item in this.Model)
    {
        <tr role="row" >
            <td class="sorting_1" tabindex="0">@item.Name</td>
            <td>@item.Description</td>
            <td></td>
        </tr>
    }
}
</tbody>

My model object has the following properties:

  • Name
  • Description
  • Phone
  • Email
  • Active

I won't show all those properties in the table.

I want to click on a table row and get the object item so I can fill a form with all the values inside object item.

I don't know if this is possible or I need to add attributes to <tr> element for adding all the properties that object item has and then get all those manually with jQuery.

Any clue?

Related posts

Recent Viewed