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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:15:28+00:00 2026-05-10T14:15:28+00:00

ValidateEvents is a great ASP.net function, but the Yellow Screen of Death is not

  • 0

ValidateEvents is a great ASP.net function, but the Yellow Screen of Death is not so nice. I found a way how to handle the HttpRequestValidationException gracefully here, but that does not work with ASP.net AJAX properly.

Basically, I got an UpdatePanel with a TextBox and a Button, and when the user types in HTML into the Textbox, a JavaScript Popup with a Error message saying not to modify the Response pops up.

So I wonder what is the best way to handle HttpRequestValidationException gracefully? For ‘normal’ requests I would like to just display an error message, but when it’s an AJAX Request i’d like to throw the request away and return something to indicate an error, so that my frontend page can react on it?

  • 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. 2026-05-10T14:15:28+00:00Added an answer on May 10, 2026 at 2:15 pm

    Found it and blogged about it. Basically, the EndRequestHandler and the args.set_errorHandled are our friends here.

    <script type='text/javascript' language='javascript'> var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(EndRequestHandler);  function EndRequestHandler(sender, args) {     if (args.get_error() != undefined)     {         var errorMessage;         if (args.get_response().get_statusCode() == '200')         {             errorMessage = args.get_error().message;         }         else         {             // Error occurred somewhere other than the server page.             errorMessage = 'An unspecified error occurred. ';         }         args.set_errorHandled(true);         $get('<%= this.newsletterLabel.ClientID %>').innerHTML = errorMessage;     } } </script> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.Net hosted website which displays a list of results as a
I am trying to add a Delete button to my product-page, but I am
I am working on some code to organize our event definition/category mapping. Our goal
I have a User Control for typical CRUD like actions on my WinForm app.
I have an application that makes use of Django's UserProfile to extend the built-in
I'm having problem with FS controller page template. I had this Plone2 base product
So I get the exception Invalid postback or callback argument. Event validation is enabled
I have a nested repeater with a delete button in it. This button deletes

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.