UrlRewriting.Net模块+ IIS7等于Page.User == NULL? [英] UrlRewriting.Net Module + IIS7 Equals Page.User == null?
问题描述
我用UrlRewriting.Net模块几年,现在在没有Windows XP和Windows 2003中的任何问题我最近刚刚升级我的家用电脑到Windows 7,并开始开发一个新的网站。
I've used the UrlRewriting.Net module for a couple years now without any problems in Windows XP and Windows 2003. I just recently upgraded my home PC to Windows 7 and started developing a new website.
该计划是使用HTML扩展并重写使用UrlRewriting.Net模块他们的.aspx同行。一切完美的作品在2008年VWD ,但是当我试图通过IIS7运行它是一个不同的故事。
The plan was to use .html extensions and rewrite them to their .aspx counterparts using the UrlRewriting.Net module. Everything works flawlessly in VWD 2008, but when I try running it through IIS7 it is a different story.
当我尝试通过将.html重写访问的页面我再也不能访问Page.User;它一直返回null。如果我使用它的.aspx扩展击中页面,Page.User正确填充。我还要提到的是我有一个LoginView控制器在我的母版页和它相同的症状缺陷:当通过.html扩展访问它显示了AnonyousTemplate;当使用.aspx扩展它正确显示显示LoggedInTemplate。我猜这两个是相关的。
When I try to access a page via the .html rewrite I can no longer access Page.User; it keeps returning null. If I hit the page using it's .aspx extension, Page.User is correctly populated. I should also mention that I have a LoginView controller in my Master Page and it suffers from the same symptoms: When accessing via .html extension it shows the AnonyousTemplate; When using .aspx extension it properly shows the LoggedInTemplate. I'm guessing the two are related.
[注:我也尝试扩展名的URL,他们表现出了同样的问题]
[Note: I've also tried extensionless URLs and they exhibit the same problem]
我已经得到了它的工作的唯一办法是切换应用程序池为经典,然后要求我加一个ASP.Net DDL处理程序.html扩展[否则它是由StaticFileHandler处理,并且出现作为一个404错误。不过,我想我的web应用程序的正常运行的人,无需摆弄IIS。
The only way I've gotten it to work is to switch the application pool to Classic, which then requires me to add an ASP.Net ddl handler for the .html extension [otherwise it is handled by the StaticFileHandler and comes up as a 404 error]. However, I'd like my web app to run properly for people without having to fiddle around with IIS.
所以我留下了几个问题:
So I am left with several questions:
- 有没有人有想法,为什么Page.User始终的.html =>的.aspx页面改写等于null?
- 为什么它在2008年VWD工作,但不是IIS7?
- 从什么IIS6 =>,可能导致此?李IIS7改变>
- 在解决方法没有其他的想法?
[注:我只是尝试了的.aspx => .ASPX重写,并没有出现问题。不是真的我想要的,但我认为应该提到它。]
[Note: I just tried a .aspx => .aspx rewrite and it did not exhibit the problem. Not really what I want, but thought I should mention it.]
推荐答案
刚曾与UrlRewriting.Net模块的突破。这使得它在集成模式下的IIS7工作:
Just had a breakthrough with the UrlRewriting.Net module. This makes it work in Integrated Mode in IIS7:
<模块runAllManagedModulesForAllRequests =真正的>
计算出来后,我做了搜索的runAllManagedModulesForAllRequests,并且弹出是的斯科特Guthrie的博客实际上如何使用它用于此目的的会谈。
After figuring it out I did a search on "runAllManagedModulesForAllRequests" and the first thing that popped up was Scott Guthrie's blog which actually talks about using it for this purpose.
这篇关于UrlRewriting.Net模块+ IIS7等于Page.User == NULL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!