1

I want to create a code/knowledge base where I can save my vb.net/c#.net/sqlserver code snippets for use later.

I've tried setting the ValidateRequest property to false in my page directive, and encoding the value with HttpUtility.HtmlEncode (c#.net), but I still get errors.

thoughts?

0

1 Answer 1

1

The HttpUtility.HtmlEncode will happen too late, assuming you are getting the exception on postback of code from the client. You can run some javascript on the client to pre-encode the server Postback.

See the following link for a quick example: Comparing escape(), encodeURI(), and encodeURIComponent()

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.