tags:

views:

1939

answers:

3

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!

A: 

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.

Jared
+1  A: 

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.

annakata
A: 

you save it in your desktop and then open it to overcome this error

alex