最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - How to implement an Html.Action helper using only the RouteName and parameters without querying the entire RouteTable? - St

programmeradmin3浏览0评论

I’m looking to implement something similar to the Html.Action helper, but instead of using the controller and action names, I want to provide the RouteName and route parameters.

In our project, the RouteTable is very large (around 7500 routes), and every call to Url.Action or Html.Action takes around 600ms just to find the correct route in the RouteTable.

We’ve already moved from Url.Action to Url.RouteUrl to avoid the overhead of querying the entire RouteTable, but now I need to know how to do something similar with Html.Action.

Is there a way to retrieve the action’s HTML using the RouteName directly, without having to go through the entire RouteTable lookup for every request?

Thanks for your help!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论