What code does Visual Studio add (and where is it put?) when you right-click the controller method to link to the view?
How can one do this (link the controller & view) without Visual Studio?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is all by convention.
You place your views in the Views/ControllerName folder for every controller and that’s the default location for framework to look for. But it is not a must in any way.
When in your controller you write
Framework assumes you want the view with the same name as action name and looks for it in Views/Controller/ folder. Then Views/Shared.
But in your actions you can write
Framework will look for a View named “ViewName” then in same folders.
So default name for a view would be the name of action being executed. And that’s a convention.