其中,在MVC3的默认页? [英] where is the default page in mvc3?
问题描述
我不能肯定域如何加载测试时,
还有像根的Default.aspx没有默认文档。在Global.asax中?
哪里是默认页中MVC3?
I am not certain how a domain can load a test when there is no default document like default.aspx in root. Is in the "global.asax" ? where is the default page in mvc3?
推荐答案
你会发现,在查看/主页/
You're gonna find that in Views/Home/
索引页
工作的mvc通过控制器 - 模型 - 视图模型
Mvc works through the controller - model - view model
当您创建一个默认的项目,你会发现在Global.asax有以下code:
When you create a default project you will find that the global.asax has the following code:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
这意味着,默认页面是在Home控制器的Index操作。
This means that the Default page is the Index action in the Home controller.
您可以通过这个例子访问其他网页:
如果你有一个登录视图中的AccountController,这意味着你可以进入/帐号/登录访问登录页面。
You can access other pages by this example: If you have an AccountController with a Login view, it means you can access the login page by going to /Account/Login.
这篇关于其中,在MVC3的默认页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!