简体   繁体   English

mvc3调用不带Application_BeginRequest()的Application_EndRequest

[英]mvc3 invokes Application_EndRequest without Application_BeginRequest()

I have a MVC3 App with DevExpress MVC Controls and the default 我有一个带有DevExpress MVC控件的MVC3应用,默认

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

in RegisterRoutes , but the following URLs from DevEx includes: RegisterRoutes中 ,但是来自DevEx的以下URL包括:

/DXR.axd?r=1_3,1_4...
/DXR.axd?r=1_42,1_41,14_18,14_2,...

just invoke the Application_EndRequest() without an invoke of Application_BeginRequest() before. 只需调用Application_EndRequest()即可,而无需先调用Application_BeginRequest()

At the moment, this leads to strange workarounds for bind/unbind the nHibernate CurrentSessionContext...Probably there are better ways to exclude these URLs as a string compare in Application_EndRequest() ? 目前,这导致绑定/取消绑定nHibernate CurrentSessionContext的奇怪解决方法...可能有更好的方法将这些URL排除为Application_EndRequest()中的字符串比较?

( Ref: (参考:

In what situation Application_EndRequest is called but Application_BeginRequest is not called? 在什么情况下调用Application_EndRequest但不调用Application_BeginRequest?

I could not find any Exeption and it only concerns the above DevEx URLs ) 我找不到任何Exeption,它只涉及上述DevEx URL)

I'm not sure if this will work for you, but I had some strange behaviours with DevEx for other things and I solved all the hassle by removing this line from the web.config from the httphandlers and leaving it only in system.webServer -> handlers 我不确定这是否对您有用,但是我在DevEx上有一些其他奇怪的行为,并且通过从httphandlers的web.config中删除此行并将其仅留在system.webServer解决了所有麻烦。 > handlers

  <add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v11.1, Version=11.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule" />

Maybe it will help 也许会有所帮助

Make sure that you are using the special DX Project Template and all required entries are registered. 确保您正在使用特殊的DX项目模板,并且所有必需的条目都已注册。

Check whether or not the issue still persists without the use DX with the standard ASP.NET MVC Project Template. 如果不将DX与标准ASP.NET MVC项目模板一起使用,请检查问题是否仍然存在。

If this issue related to DX only, I guess it is better to contact their Support Team. 如果此问题仅与DX有关,我想最好与他们的支持团队联系。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM