У меня есть много продуктов в сетке (таблице).Почтовая кнопка в сетке
В каждой строке есть собственная кнопка для удаления и редактирования продукта.
Теперь мой вопрос: как я могу определить после сообщения сообщения, какая строка таблицы выбрана?
С наилучшими пожеланиями
<table id="tbltraining" class="tblStyle">
<tr class="tblHearerRow">
<th class="tblHearerCell" style="width:50px;">
</th>
<th class="tblHearerCell" style="width:50px;">
</th>
<th class="tblHearerCell" style="width:200px;">
Name
</th>
<th class="tblHearerCell" style="width:100px;">
Price
</th>
<th class="tblHearerCell">
Actions
</th>
</tr>
@foreach (var item in Model.Products)
{
<tr class="tblRow" style="background-color:#c4cbf8">
<td id="itemId" class="itemIdClass tblColumn">
@Html.DisplayFor(modelItem => item.Id)
</td>
<td class="tblColumn" style="font-weight:bold;">
@Html.DisplayFor(modelItem => item.Name)
</td>
<td class="tblColumn">
@Html.DisplayFor(modelItem => item.Price)
</td>
<td class="tblColumn">
<input type="button" value="Edit"
class="buttonEdit btnStyleOne" />
<input type="button" value="Delete"
class="buttonDelete btnStyleOne" />
<input type="button" value="Add Category"
class="buttonDelete btnStyleOne" />
<td>
</tr>
показать свою разметку вида – Shyju
См. Мой ответ .. – Shyju