Bob Jones
Bob Jones

Reputation: 475

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error

I have created a text area that allows users to enter html code. When I attempt to post this code back to the server, I get a popup window that says "Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occured while processing the request on the server. The status code returned from the server was: 500".

I believe this has something to do with the fact that what I am posting back contains html.

How do I do this safely and without causing this error message?

Thanks!

Upvotes: 3

Views: 2964

Answers (2)

annakata
annakata

Reputation: 75872

It's a very generic error seemingly caused by any number of things unfortunately, from app recycling, corrupted cookies, RoleManager, anything..

For reference:

I would strongly advise against turning validation off, that's not fixing the problem it's merely hiding the symptom and it's opening the door to XSS to do so.

Upvotes: 2

Jared
Jared

Reputation: 7243

You could use validateRequest="false" on the page and then validate the fields that you need to to ensure the safety of the data using Server.HtmlEncode and Server.HtmlDecode.

Upvotes: 0

Related Questions