Solved

Check if IsCallback on Application_BeginRequest

Posted on 2009-07-10
1
1,061 Views
Last Modified: 2012-08-13
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.
0
Comment
Question by:InfobitSystems
1 Comment
 

Accepted Solution

by:
InfobitSystems earned 0 total points
ID: 24826380
Ok, found a solution. Need to check Request.Form("__ASYNCPOST"). It is set to "true" if it is a Callback, otherwise it is "nothing"
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to get statistic's from a competitors website?! 1 85
Best Practice CSS floating images 2 32
Stupid git question 2 58
Cordova Camera plugin fails 2 93
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now