Solved

Check if IsCallback on Application_BeginRequest

Posted on 2009-07-10
1
1,069 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

730 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