S
S
slav4ik514932016-12-15 10:55:15
ASP.NET
slav4ik51493, 2016-12-15 10:55:15

The modal window is not called from the partial view, but a new window is opened, why is that?

I call the modal from the `Guns.cshtml` partial view, the `Guns.cshtml` partial view is loaded via Ajax into the `Main.cshtml` partial view.

@using (Ajax.BeginForm("Guns", "Admin", new AjaxOptions { UpdateTargetId = "active" }))
        {
            <input class="btn btn-success btn-lg adminbtn" type="submit" value="Оружия" />   
        }


After I have a table with products and there is a button for each product:
@Html.ActionLink("Редактировать", "Edit", "Admin", new { id = 1 }, new { @class = "gunitem btn btn-info" })


On click, a new page opens with my "Edit" partial view.
BUT!
If I put my button in _Layout.cshtml then it works great. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question