извините, но я новичок в asp. net и MVC. У меня есть программа, которая считывает данные из базы данных и отображает результат на странице индекса с флажком рядом с каждой строкой:
<table class="table">
<tr>
<th>
Select
</th>
<th>
@Html.DisplayNameFor(model => model.Rep_Id)
</th>
<th>
@Html.DisplayNameFor(model => model.Rep_Lot_Id)
</th>
<th>
@Html.DisplayNameFor(model => model.Rep_PDFToCreate)
</th>
<th>
@Html.DisplayNameFor(model => model.Rep_PDFCreated)
</th>
<th>
@Html.DisplayNameFor(model => model.Rep_Status)
</th>
<th>
@Html.DisplayNameFor(model => model.Rep_Type)
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.CheckBox("pdf", true)
</td>
<td>
@Html.DisplayFor(modelItem => item.Rep_Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.Rep_Lot_Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.Rep_PDFToCreate)
</td>
<td>
@Html.DisplayFor(modelItem => item.Rep_PDFCreated)
</td>
<td>
@Html.DisplayFor(modelItem => item.Rep_Status)
</td>
<td>
@Html.DisplayFor(modelItem => item.Rep_Type)
</td>
</tr>
}
</table>
<script>
function Obtain_Lot() {
var name=...
}
</script>
Моя цель - создать кнопку, которая при нажатии получает " model.Rep_Lot_Id "элемента, проверяемого как строка. Только один элемент может быть проверен. Как я могу это сделать?