ActionLink pass parameter to Bootstrap Modal
<p>Started from the beginning, I have a list view in my MVC5 App. I have links to action like Edit and Delete. If I click on Delete I want to show Bootstrap Modal Popup, which I already have. But the problem is I have Html.ActionLink which promperly redirects my Modal Popup to the method that I specified in ActionLink. I want to just show popup and then click submit or something else and then do the action. But there was another problem - in what way I can pass parameter from my list view to modal popup ? </p>

<p>Some code below:</p>

<pre><code>@model IEnumerable&lt;SupportStudentSystem.Models.Category&gt;

@{
    ViewBag.Title = "List of Categories";
}

&lt;h1 class="text-center"&gt;Categories&lt;/h1&gt;

&lt;div style="margin-top:1%"&gt;
    &lt;a href="AddCategory" type="button" class="btn btn-lg btn-success"&gt;&lt;i class="glyphicon glyphicon-plus"&gt;&lt;/i&gt; Add Category&lt;/a&gt;
&lt;/div&gt;
&lt;table class="table" style="margin-top:2%"&gt;
    &lt;tr&gt;
        &lt;th&gt;
            @Html.DisplayNameFor(model =&gt; model.CategoryName)
        &lt;/th&gt;
        &lt;th&gt;
            @Html.DisplayNameFor(model =&gt; model.Description)
        &lt;/th&gt;
        &lt;th&gt;
            @Html.DisplayNameFor(model =&gt; model.RequiredAge)
        &lt;/th&gt;
        &lt;th&gt;&lt;/th&gt;
    &lt;/tr&gt;

    @foreach (var item in Model)
    {
        &lt;tr&gt;
            &lt;td&gt;
                @Html.DisplayFor(modelItem =&gt; item.CategoryName)
            &lt;/td&gt;
            &lt;td&gt;
                @Html.DisplayFor(modelItem =&gt; item.Description)
            &lt;/td&gt;
            &lt;td&gt;
                @Html.DisplayFor(modelItem =&gt; item.RequiredAge)
            &lt;/td&gt;
            &lt;td&gt;
                @Html.ActionLink("Edit", "EditCategory", "Admin", new { item.CategoryID }, null) |
                 @Html.ActionLink("Delete", "DeleteCategory", "Admin", new { item.CategoryID }, new {data_toggle = "modal", data_target = "#Delete" })                &lt;/td&gt;
        &lt;/tr&gt;
    }
&lt;/table&gt;
</code></pre>

<p>And here is my modal:</p>

<pre><code>&lt;div class="modal active" id="Delete" role="dialog" style="overflow-y:auto"&gt;
    &lt;div class="modal-header"&gt;
        &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
        &lt;h3 style="text-align:center"&gt;Delete Category&lt;/h3&gt;
    &lt;/div&gt;
&lt;div class="modal-body"&gt;
    &lt;p style="text-align:center"&gt;&lt;strong&gt; Do you want to delete this category ? &lt;/strong&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;div class="modal-footer"&gt;
    &lt;button type="submit" onclick="location.href='@Url.Action("DeleteCategory", "Admin")'" class="btn btn-default"&gt;Delete category&lt;/button&gt;
    &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Cancel&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>In DeleteCategory method I delete category which has a specified CategoryID passed like a parameter, and then delete it also from database.</p>

<p>Can anyone help me solve this problem? </p>