In many scenario, it necessary to pop up the confirm alert box while deleting ,saving and editing ย information in Asp .Net MVC application. So let us discuss about how can we achieve using JQuery code .

Controller

Create simple controller and generatingย view based on the controller as shown below.

Confimation message after click in mvc - dotnet-helpers

Confimation message after click in mvc view - dotnet-helpers

View (index)

As shownย belowย code, we had createdย ConfirmationDialog function using javascript to show the popup with alert message. Next creating aย AcionLink controlย which will show the popupย by calling the javascript method in theย onclick event.

OUTPUT:

Confimation message after click in mvc Output- dotnet-helpers

If you click ok, it will redirect to the Confirmation view