I’m trying to add a new view, ‘Graph’, to my asp.net mvc3 under the ‘Home’ folder.
When ia dd the view in and try to browse to the new view in a browser (xxx/Home/Graph) I get a URL not found error.
Not sure what I’m doing wrong to cause this, there is another view called ‘About’ in the same folder and that one is visible to the browser..
Views are not directly accessible in MVC. You need a controller and action method to serve up the view. Try adding an action method called
Graphto yourHomeController:Also, if you want to serve up a view that doesn’t have the same name as the action method, you can specifiy it directly:
ASP.NET MVC works, by convention, by matching the action method’s name to the view’s name—unless you specify the view as in my second example.