如何设置默认页面asp.net
|
参见英文答案 >
Set Default Page in Asp.net8个
<system.webServer>
<defaultDocument>
<files>
<add value="Pages/Home.aspx" />
</files>
</defaultDocument>
</system.webServer>
解决方法ASP.NET WebForms在web.config文件中,尝试以前使用clear标签: <system.webServer>
<defaultDocument>
<files>
<clear />
<add value="Pages/Home.aspx" />
</files>
</defaultDocument>
</system.webServer>
看看这里:http://www.iis.net/configreference/system.webserver/defaultdocument ASP.NET MVC 根据您正在使用的asp.net mvc版本,您可以将其放在不同的文件(v3或更旧版本的/ Global.asax.cs或v4或更新版本的App_Start / RouteConfig.cs中).在这两种情况下,您将看到一些注册路由的东西,因为asp.net mvc使用路由,而不是Webforms等文件.因此,您可以更改默认值: public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",url: "{controller}/{action}/{id}",defaults: new
{
controller = "Home",// default controller
action = "Index",// default action on the controller
id = UrlParameter.Optional
}
);
}
看看这里:http://www.codeproject.com/Articles/624181/Routing-Basics-in-ASP-NET-MVC (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- asp.net-mvc – 如何全局化ASP.NET MVC视图(特别是小数分隔
- asp.net-mvc-3 – 如何根据当前页面和/或主页在Orchard CMS
- ASP.NET MVC中的“Generic”OpenID 5
- asp.net – 配置转换和“TransformXml任务失败”错误消息
- asp.net – IIS Express(WebMatrix)打开外部连接
- asp.net-mvc – 如何在ASP.NET MVC 3应用程序中处理未捕获的
- 如何在ASP.NET MVC模型中为POST保存选定的DropDownList值?
- Plone和Asp.Net集成
- asp.net – 将样式应用于CheckBoxList中的ListItems
- asp.net – 为什么IIS Express使用而不是?
- asp.net – 手动更新表单认证券:
- asp.net-mvc-3 – ViewBag- MVC3-ASP.NET
- asp.net-mvc – 在ASP.NET MVC中从相同的路由URL
- ASP.NET Web.config AppSettings性能
- asp.net成员资格 – 在Application_Authenticati
- asp.net-mvc – 如何拦截视图渲染以在所有部分视
- asp.net – DNN vs Composite C1 – Pro and Con
- asp.net – 使用OLEDB读取CSV文件,即使连接字符串
- asp.net-mvc – 为现有的基于MVC的网站创建REST
- .net – 索引和长度必须指向字符串中的位置?
