Check if IsCallback on Application_BeginRequest
Posted
by user136405
on Stack Overflow
See other posts from Stack Overflow
or by user136405
Published on 2009-07-10T17:06:58Z
Indexed on
2010/05/17
18:20 UTC
Read the original article
Hit count: 119
I have a web application (.NET 3.5) that has this code in Global.asax:
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
LinkLoader()
PathRewriter()
PathAppender()
End Sub
I want all those functions inside to get called except for when it's an AJAX call back. So, ideally I would have it changed to:
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
If not Page.IsCallback then
LinkLoader()
PathRewriter()
PathAppender()
End If
End Sub
But there is not access to the page object here. So, basically my question is:
How do I check if the request is an AJAX call back inside Application_BeginRequest?
Thank you very much for any feedback.
© Stack Overflow or respective owner