Home > MVC > How to Redirect From One View to Another View in MVC



How to Redirect From One View to Another View in MVC

In this article, we will explain how to redirect from one view to another view in MVC with an example and sample code.


In this article, we will explain how to redirect from one view to another view 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 redirect from one view to another view in mvc

 

Step -2

Select new project type.

how to redirect from one view to another view in mvc

 

Login.cshtml

We have provided razor view html below.

 

Models

 

LoginController

 

Screenshot

how to redirect from one view to another view in mvc

 




Note: All contents are copyright of their authors.



Comments



Leave a Reply

Comment:*
Email ID:*


Name:*