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
|
![]() |
Semicolon · htaccess合并301 www和https 7 年前 |
![]() |
twan · 如何仅重写特定URL而不影响其他文件 7 年前 |
![]() |
yarz-tech · Angular 5 URL重写问题 7 年前 |
![]() |
Peekyou · IIS重写2个角度应用程序 7 年前 |