hhh3112
hhh3112

Reputation: 2187

Submitting html code without setting ValidateRequest to false

I have a textbox and i want the user to be able to submit a youtube embed code. Is this possible without setting 'ValidateRequest' to false?

Upvotes: 1

Views: 1155

Answers (2)

Magnus
Magnus

Reputation: 46977

Html encode the text and put it in a hidden input before submit, and then decode it on the server after submit.

Upvotes: 1

Adeel
Adeel

Reputation: 19228

No, you must turn it False to allow users to enter youtube embed code. you just have to encode your code to prevent cross site scripting.

Upvotes: 2

Related Questions