How can you get the “real” HttpContext within an ASP.NET MVC application?

前端 未结 2 1287
情书的邮戳
情书的邮戳 2020-12-30 18:40

Unfortunately, I need to do this. I\'m using ELMAH for my error log. Before I route to my error.aspx view, I have to grab the default ELMAH error log so I can log the exce

相关标签:
2条回答
  • 2020-12-30 18:57
    this.HttpContext.ApplicationInstance.Context
    
    0 讨论(0)
  • 2020-12-30 19:01

    Try System.Web.HttpContext.Current. It should do the trick.

    Gets HTTP-specific information about an individual HTTP request.

    MSDN

    0 讨论(0)
提交回复
热议问题