asp.net WebForm和MVC设置网站默认文档

在Web.config文件中configuration节中添加如下配置:

<!--设置默认文档-->
<system.webServer>
<modules>
</modules>
<directoryBrowse enabled="true" />
<defaultDocument>
<files>
<!--这里设置具体默认文档-->
<add value="Test/Index.cshtml" />
</files>
</defaultDocument>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>

配置完后如下:

asp.net WebForm和MVC设置网站默认文档

 

asp.net WebForm和MVC设置网站默认文档

上一篇:一篇文章带你了解CSS 分页实例


下一篇:mybatis-plus报错解决:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)