Ramco Ramco

Ramco Ramco

  • 1.4k
  • 577
  • 28.7k

How to open Partial View in Modal Popup on click of button.

Jun 21 2021 5:10 AM

Hi

How to open Partial View in Modal Popup on click of button.. Can we pass Action ("Delete") & Controller ("Location") thru variables

so that same Delete Partial View can be used whereever it is required.

Partial View

*************

@using (Html.BeginForm("Delete", "Location", FormMethod.Post))
{

<div class="modal" tabindex="-1" role="dialog" id="deleteModal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-danger">Delete Confirmation</h4>
            </div>
            <div class="modal-body">
                <p>Are you sure you want to delete this record ?</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
                <button type="submit" class="btn btn-danger">Delete</button>
            </div>
        </div>
    </div>
</div>

}


Answers (15)