Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7088251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:46:38+00:00 2026-05-28T07:46:38+00:00

Is it possible to determine whether the current request is an asynchronous postback (partial

  • 0

Is it possible to determine whether the current request is an asynchronous postback (partial page update) from within the Application_Error event?

What’s the best way to handle application errors when asynchronous postbacks are used?

In Application_Error, we are redirecting to different error pages but that doesn’t work properly when the error is thrown during an asynchronous postback. We noticed that this holds true even when AllowCustomErrorsRedirect = false and we have an OnAsyncPostBackError handler to set the AsyncPostBackErrorMessage. During asynchronous postbacks, our AsyncPostBackErrorMessage is overwritten and the client receives a generic web page error instead.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:46:38+00:00Added an answer on May 28, 2026 at 7:46 am

    In the Application_Error method you no longer have direct access to the <asp:ScriptManager> control on the page. So it’s too late to handle its AsyncPostBackError event.

    If you want to prevent a redirect, you should check the request to see if it is in fact an asynchronous request. The <asp:UpdatePanel> causes a post back with the following HTTP header:

    X-MicrosoftAjax:Delta=true
    

    (also see: ScriptManager Enables AJAX In Your Web Apps)

    A check for this header would look something like this:

    HttpRequest request = HttpContext.Current.Request;
    string header = request.Headers["X-MicrosoftAjax"];
    if(header != null && header == "Delta=true") 
    {
      // This is an async postback
    }
    else
    {
      // Regular request
    }
    

    As to what would be an appropriate way to handle the exception is a different question imho.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to determine if an ASP.NET page is a postback from javascript?
I would like to determine, from a .NET application, whether the current user (from
It is possible for an operating system to determine whether a page of memory
Is it possible to determine whether a user is active on the current web
In C# 3.0, is it possible to determine whether an instance of Type represents
Does anyone know if it is possible to reliably determine (programattically C/C++...) whether or
Is it possible to determine whether or not a given registry key is redirected?
Possible Duplicate: How to get the URL of the current page in C# If
is it possible to determine whether google talk uses tcp or udp packets for
I'm trying to determine whether it's possible to create css for an element that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.