Home > MVC > Display a view from another controller in ASP.NET MVC



Display a view from another controller in ASP.NET MVC

In this article, we will explain how to display a view from another controller in ASP.NET MVC with an example and sample code.


In this article, we will explain how to display a view from another controller in ASP.NET 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 .

Display a view from another controller in ASP.NET MVC

 

Step -2

Select new project type.

Display a view from another controller in ASP.NET 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

Display a view from another controller in ASP.NET MVC

 




Note: All contents are copyright of their authors.



Comments



Leave a Reply

Comment:*
Email ID:*


Name:*