Site icon Dotnet Helpers

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.

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:

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

Exit mobile version