Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC How do I point a controller action to a different view?

I have a controller with a method that points to a view. How do I change the view that the action is mapped to? Like I want it to call ViewB instead of ViewA? Where do these mappings exist and how can I modify them? Thanks for any tips.

Thanks,
~ck in San Diego

like image 927
Hcabnettek Avatar asked Dec 01 '22 04:12

Hcabnettek


1 Answers

Instead of:

return View(someModel);

use

return View("ViewYouWant", someModel);
like image 107
John Farrell Avatar answered Dec 03 '22 16:12

John Farrell