Response.write exception in try catch statement

Posted on 2009-02-18
Last Modified: 2012-05-06
Trying to learn how to do exception handling in .net c#. I wanted to just raise an error to the page but get the error below when I try this statement. Can anyone tell me why? How can I simply display the error (preferrably in a message box) on a web form?

 catch (Exception ex)

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Question by:ChiBella
    LVL 27

    Expert Comment


    Author Comment

    Yes...and I also cannot update a label which is outside of the updatepanel.
    LVL 27

    Accepted Solution

    Did you go through the link? It details on how to avoid this error.

    See if you can move the label inside the update panel.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    746 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

    14 Experts available now in Live!

    Get 1:1 Help Now