Home/MVC/Confirmation message after clicking the ActionLink in MVC

Confirmation message after clicking the ActionLink in MVC

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

Leave A Comment