Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Check if IsCallback on Application_BeginRequest

Posted on 2009-07-10
1
Medium Priority
?
1,079 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

636 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