Home > MVC > Calling a different view from the controller in MVC



Calling a different view from the controller in MVC

In this article, we will explain how to Calling a different view from the controller in MVC with an example and sample code.


In this article, we will explain how to Calling a different view from the controller in MVC with an example and sample code. In this example, we have created a sample login page, and based on Login we are redirecting to another controller action method.

 

Step -1

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

Calling another different view from the controller in MVC

 

Step -2

Select new project type.

Calling another different view from the controller in MVC

 

Login.cshtml

We have provided razor view html below.

 

Models

 

LoginController

we are redirecting to another controller Home action method dashboard .

 

dashboard.cshtml

 

Screenshot

Calling another different view from the controller in MVC

 




Note: All contents are copyright of their authors.



Comments



Leave a Reply

Comment:*
Email ID:*


Name:*