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 6218015
In Process

The Archive Base Latest Questions

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

This thing is drive me crazy. I’m trying to intercept an exception server-side, during

  • 0

This thing is drive me crazy. I’m trying to intercept an exception server-side, during a partial postback, setting an error message to show on the client in a javascript alert.

But I just receive the following error on the firefox console:

uncaught exception: [Exception... "'Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Tentativo di divisione per zero.' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "JS frame :: resource://firebug_rjs/net/spy.js :: callPageHandler :: line 796" data: no]

and no alert at all.

I got this problem on a complex project that involves Telerik components, but I’ve reduced the problem to its fundamentals, following this simple example, and the problem still exists.

The case:

Default.aspx

<form id="form1" runat="server">
<asp:ScriptManager ID="scriptManager" runat="server" OnAsyncPostBackError="scriptManager_OnAsyncPostBackError"></asp:ScriptManager>
<div>
    <asp:UpdatePanel ID="upd" runat="server">
        <ContentTemplate>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
            <asp:Button ID="btnSend" runat="server" Text="Send" OnClick="btnSend_OnClick" />
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
</form>

Default.aspx.cs

protected void scriptManager_OnAsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e) 
{
    scriptManager.AsyncPostBackErrorMessage = e.Exception.Message;
}

protected void btnSend_OnClick(object sender, EventArgs e) 
{
    // this will throw and Exception
    int aa = Convert.ToInt32(TextBox1.Text) / Convert.ToInt32(TextBox2.Text);
}

I’ve tried with VS2010/.NET 4.0 and with VS2008/.NET 3.5, in Firefox and Internet Explorer, the problem is the same.

Please, anyone has some idea?

  • 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-24T07:31:39+00:00Added an answer on May 24, 2026 at 7:31 am

    In addition to handling logic on server side you have to add script in order to handle error on client side.

     <script>
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
            function EndRequestHandler(sender, args) {
                if (args.get_error() != undefined) {
                    alert(args.get_error());
                }
            }
        </script>
    

    This script is handling end_Request event, and if there was some error fires alert.

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

Sidebar

Related Questions

OK this is starting to drive me crazy! I am trying to do some
I'm trying to get this thing to work in IE (any version - works
Hey guys this thing drives me crazy. I defined in my stylesheet: ul#menuCnt li
those reqular expressions drive me crazy. I'm stuck with this one: test1:[[link]] test2:[[gold|silver]] test3:[[out1[[inside]]out2]]
I know this is crazy, but IE can drive one to do crazy things.
This problem has driven me crazy, it's been 5 days I'm trying to solve
I am using the SQL Server PHP Driver, I think this question can be
This is a self-explanatory question: Why does this thing bubble into my try catch's
I have this thing working mostly. What I don't get is, if I have
Why is this thing not working? [Database(Name=Relationships_Test)] [Table(Name = Order)] public class Order {

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.