In ASP.NET MVC 4, where is the connection between controller and view stored? -
new asp.net mvc, understand that, if right-click in action within controller, context menu gives me add view, , go view. app store connection? have searched files in app name of 1 of views (cshtml files), , haven't seen anywhere particular 1 connected particular controller, let alone controller method.
i know newbie question, have searched around answer , haven't come one.
the answer doesn't store 'connection'. mvc uses concept known "convention on configuration". means mvc "infers" various things based on conventions. in case, convention view automatically found if it's in folder in views directory same name controller, , same name method.
you can override this, passing view name in view() call, otherwise figures out @ runtime.
the ide uses convention, , has parsed code file , knows "go to" file specified convention.
Comments
Post a Comment