是HttpContext.Current在Web应用程序自从空?

编程入门 行业动态 更新时间:2024-10-23 21:24:29
本文介绍了是HttpContext.Current在Web应用程序自从空?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

时HttpContext.Current在Web应用程序不断为空(未使用假设线程)?更具体地说,它会永远是空的无效Application_OnError(对象发件人,EventArgs五)?

Is HttpContext.Current ever null in a web Application (assuming threads are not being used)? More specifically, would it ever be null in void Application_OnError(object sender, EventArgs e)?

推荐答案

看this另一个问题

会议未初始化,直到AcquireRequestState事件添加,所以这点之前发生的任何错误将不会有会话变量。

Session is not initialized until the AcquireRequestState event, so any error occurring before this point will not have session variables available.

我认为同样适用于HttpContext.Current为HttpContext.Current.Session

I think the same applies to HttpContext.Current as HttpContext.Current.Session

所以,是的,我认为HttpContext.Current有时是空的Application_OnError

So yes, I think HttpContext.Current can sometimes be null in Application_OnError

更多推荐

是HttpContext.Current在Web应用程序自从空?

本文发布于:2023-11-09 15:50:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1572777.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   HttpContext   Current   Web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!