【问题标题】:Remove .aspx from "Link To Document" in Umbraco 6从 Umbraco 6 的“链接到文档”中删除 .aspx
【发布时间】:2015-04-20 13:11:41
【问题描述】:

我在很多项目中都使用过 Umbraco 7,但从未使用过 Umbraco 6。该项目确实是一个 MVC 项目。

我之前在这个项目中遇到过关于模板的类似问题。创建模板时,它将创建一个 .aspx 页面,而不是视图。我将 /Config/umbracoSettings.config 中的配置设置从 Webforms 更改为 Mvc

<templates>
<!-- If you want to switch to Mvc then do NOT change useAspNetMasterPages to false -->
<!-- This (old!) setting is still used to control how macros are inserted into your pages -->
<useAspNetMasterPages>true</useAspNetMasterPages>

<!-- To switch the default rendering engine to MVC, change this value from WebForms to Mvc -->
<!-- Do not set useAspNetMasterPages to false, it is not relevant to MVC usage -->
<defaultRenderingEngine>Mvc</defaultRenderingEngine>

但是,在创建内容节点时,属性页面上的默认“链接到文档”确实是.aspx 扩展名。如何删除它并只使用默认视图名称,而不是扩展名?

我知道有重写,但如果它是一个 MVC 项目,那为什么还要首先在那里有扩展?在 Umbraco 7 中我不必这样做。

【问题讨论】:

    标签: asp.net asp.net-mvc umbraco


    【解决方案1】:

    在您的 web.config 文件中,在您的 AppSettings 部分中查找设置“umbracoUseDirectoryUrls”。将其设置为“true”,.aspx 部分不应出现在 URL 中,您将获得文件夹样式的 URL。

    【讨论】:

    • 欣赏! - 永远不会发现。
    猜你喜欢
    • 1970-01-01
    • 2011-08-17
    • 2011-04-30
    • 1970-01-01
    • 2010-11-08
    • 1970-01-01
    • 2021-02-21
    • 2013-01-27
    • 1970-01-01
    相关资源
    最近更新 更多