Home > MVC > How to Call Controller Action Method in MVC



How to Call Controller Action Method in MVC

In this article, we will explain how to call Controller Action method in MVC with an example and sample code.


In this article, we will explain how to call Controller Action method in MVC with an example and sample code. In this example, we have created a sample login page, there are two buttons on the login page. based on button click we are redirecting to respective action methods.

 

Step -1

Open Visual Studio. Click on the file in the menu and select new Project .

How to call controller Action method in MVC

 

Step -2

Select new project type.

How to call controller Action method in MVC

 

Login.cshtml

We have provided razor view html below.

 

Models

 

LoginController

 

Screenshot

How to call controller Action method in MVC

 




Note: All contents are copyright of their authors.



Comments



Leave a Reply

Comment:*
Email ID:*


Name:*