17
|
Paul Kearney - pk · 技术社区 · 14 年前 |
![]() |
1
9
这是一个涉及私有实现细节的奇怪的解决方法,但添加以下内容:
这样可以避免在中进行内部检查
|
![]() |
2
2
工作溶液 是在Url.Content/UrlHelper.GenerateContentUrl之前插入一行(最佳位置在应用程序_BeginRequest中):
我在大学里学过源代码 https://github.com/aspnet/AspNetWebStack/blob/master/src/ 我的堆栈跟踪中的两个类(System.Web.WebPages.Utils.UrlRewriterHelper.cs和System.Web.WebPages.Utils.UrlUtil.cs)中:
System.Web.WebPages.Utils.UrlUtil.cs-GenerateClientUrlInternal方法中有代码:
您可以看到作者对url重写路径的注释中出现奇怪的行。另外,原始客户端路径位于HttpContext.Request.RawUrl中,但在Url中它被重写。 期待System.Web.WebPages.Utils.UrlRewriterHelper.cs:
所以Url.Content现在起作用了。 |
![]() |
3
0
|
![]() |
Mike · html助手-我如何摆脱name属性? 10 年前 |
|
user3902826 · 显示mvc2视图 10 年前 |
![]() |
Baxter · 将带有List<T>的视图模型发布到控制器操作方法 10 年前 |
![]() |
yoozer8 · 将类应用于某些链接文本 12 年前 |