Bootstrap modal in ASP.NET MVC opening the modal only for the first id -


i have created simple crud operation testing bootstrap modal. trying open other views in bootstrap modal. first row details opening edit operation. mean edit form opening first id. modal not working anymore.

here index page-

@model ienumerable<amstest.models.tbl_category> .... <a id="btncreate" data-toggle="modal" href="#mymodal" class="btn btn-primary">create</a>  <table class="table table-hover">     <tr>         <th>@html.displaynamefor(model => model.category_name)</th>         <th>@html.displaynamefor(model => model.category_image)</th>         <th></th>     </tr>  @foreach (var item in model) {     <tr>         <td>@html.displayfor(modelitem => item.category_name)</td>         <td>@html.displayfor(modelitem => item.category_image)</td>         <td>             <a id="btnedit" data-id="@item.category_id" data-toggle="modal" class="btn btn-primary" href="#mymodal">edit</a>              @html.actionlink("details", "details", new { id=item.category_id }) |             @html.actionlink("delete", "delete", new { id=item.category_id })         </td>     </tr> } </table>   <div id="mymodal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mylargemodallabel">     <div class="modal-dialog modal-lg">         <div class="modal-content">             <div class="modal-body">                 <div id="modal-content"></div>             </div>         </div>     </div> </div>  @section scripts{     <script>         $('#btncreate').click(function (eve) {             $('#modal-content').load("/category/create");         });          $('#btnedit').click(function (eve) {             $('#modal-content').load("/category/edit/" + $(this).data("id"));         });          $('#btndetails').click(function (eve) {             $('#modal-content').load("/category/details/" + $(this).data("id"));         });          $('#btndelete').click(function (eve) {             $('#modal-content').load("/category/delete/" + $(this).data("id"));         });     </script> } 

now should do?


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -