In order to prevent my application from crashing due to the error "A potentially dangerous Request.Form value was detected...", I initially disabled page validation. However, I am now reassessing this approach and aiming to resolve it properly.
Is there a recommended strategy for handling this issue? If users are inputting '<' and '>', my understanding is that the most effective way to protect their data is by encoding it using JavaScript. While I have attempted to catch this in the code-behind, it proves to be too late in the process. One solution I am considering is creating a custom textbox that automatically encodes/decodes input with client scripts. Additionally, I need to address any angle brackets that may already be saved in my database.
Do you have any suggestions or personal experiences dealing with this situation?