gpt4 book ai didi

asp.net - bundle 优先于路由吗?

转载 作者:行者123 更新时间:2023-12-05 00:24:53 25 4
gpt4 key购买 nike

如果我有一个 Bundle,例如:

bundles.Add(new ScriptBundle("~/foo/bar").Include(
"~/Scripts/foo.js"));

以及一条路线,例如:
routes.MapRoute(
"Foo", // Route name
"foo/bar",
new
{
controller = "Foo",
action = "Bar"
});

哪一个会优先?

浏览器是否会返回 ScriptBundleActionResult ?

最佳答案

如果您 read this post , 有人建议捆绑路由 (url) 将优先:

Clearly the default route with /content/css path matches the css action but the bundling framework will override the http handler.



该帖子还推荐了在所有包路径前添加“包”前缀的约定。例如:
bundles.Add(new ScriptBundle("~/bundle/foo/bar").Include(
"~/Scripts/foo.js"));

上面引用的帖子链接在 this tutorial ,其中有一个靠近底部的部分称为“捆绑注意事项”,这可能会引起人们的兴趣。

关于asp.net - bundle 优先于路由吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25566031/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com