0

I want to open edit.cshtml into the index html with bootstrap modal popup.

I tried that in the modal-body @html.partial("edit") but it is not working.

I changed the html.action to url.action but it is not still working.

Please help me ?

@model IEnumerable<Microsoft.AspNet.Identity.EntityFramework.IdentityRole>
@{
    ViewBag.Title = "Index";
}

<div class="panel panel-primary">
    <div class="panel-heading">
        Roller
    </div>
    <table class="table table-striped">
        <tr>
            <th>Id</th>
            <th>Name</th>
            <th></th>
        </tr>

        @if (Model.Count() == 0)
        {
            <tr>
                <td colspan="3">Rol Yok</td>
            </tr>
        }
        else
        {
            foreach (var role in Model)
            {
                <tr>
                    <td>@role.Id</td>
                    <td>@role.Name</td>
                    <td>
                        @using (Html.BeginForm("Delete", "RoleAdmin", new { id = role.Id }))
                        {
   @Html.ActionLink("Güncelle", "Edit", new { id = role.Id }, new { @class = "btn btn-primary btn-sm" })

<button type="submit" class="btn btn-danger btn-sm">Delete</button>
                        }
                    </td>
                </tr>
            }
        }
    </table>
</div>
Al Foиce ѫ
  • 4,195
  • 12
  • 39
  • 49
  • 1
    You need to use ajax to call you server method that returns a partial view (or `JsonResult`) and then update the DOM –  Sep 13 '18 at 11:34
  • I'm rookie yet. can explain it please ? – Ali Kursat Erol Sep 13 '18 at 17:21
  • There are tens of thousands of examples on the web. Refer [this Q/A](https://stackoverflow.com/questions/11231862/using-bootstrap-modal-window-as-partialview) for a simple example –  Sep 13 '18 at 21:32

0 Answers0