Получить значение идентификатора в модели
всем привет,
I want to set in parameter of my Onclick function the value of the ID of each data recovered in my model
когда я пытаюсь, что у меня есть ошибка, как :
Invalid or unexpected token
Что я уже пробовал:
<pre>@model List<sotels.smartretail.common.Tenant.SaleDetailVM> <div class="row"> <div class="col-md-4"> <form class="kt-form kt-form--label-right" id="zone_form"> @Html.AntiForgeryToken() <div class="modal fade show" id="m_modal_1" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" style="display: block;"> <div class="modal-dialog modal-dialog-centered modal-xl " role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel"> Details Vente </h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> </button> </div> <div class="modal-body"> <div class="alert alert-success" role="alert" id="success" style="display: none"> <div class="alert-text">L'enregistrement effectué avec success !</div> </div> <div class="alert alert-danger" role="alert" id="danger" style="display: none"> <div class="alert-text">un problème est survenue !</div> </div> <div class="modal-body"> <div class="kt-portlet__body"> </div> <div class="kt-separator kt-separator--border-dashed kt-separator--space-md"></div> <table class="table table-striped- table-bordered table-hover table-checkable" id="sale_table"> <thead> <tr> <th> ID Vente </th> <th> ID Produit </th> <th> Quantité</th> <th> En Cadeau </th> <th> Raison </th> </tr> </thead> @foreach (var items in Model) { <tr> <td> @Html.DisplayFor(model => items.SaleId) </td> <td> @Html.DisplayFor(model => items.ProductId) </td> <td> @Html.DisplayFor(model => items.Quantity) </td> <td> @Html.DisplayFor(model => items.IsGift) </td> <td> @Html.DisplayFor(model => items.GiftReason) </td> <td> <div class="dropdown dropdown-inline"> <button type="button" class="btn btn-hover-brand btn-elevate-hover btn-icon btn-sm btn-icon-md btn-circle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> </button> <div class="dropdown-menu dropdown-menu-right"> <a class="dropdown-item" onclick="onDiscountClick(@(Html.DisplayFor(model => items.SaleDetailId)))"> Remises </a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#" onclick=""> taxes</a> </div> </div> </td> </tr> } </table> </div> </div> <div class="modal-footer"> <div class="form-group"> <button type="button" class="btn btn-primary" data-dismiss="modal">Fermer</button> </div> </div> </div> </div> </div> </form> </div> </div>