asp.net - HTML Encoding Server side vs Client side -


I want to enable comment posting on my page, so I need to execute some HTML encoding before that mail Is sent and dumped into the database.

What is the ideal side for this?
saver side (i work with asp.net) or client side (javascript)?

If you are configuring user input, then only is safe for you. Server-side form. You can not be sure that the customer-side has been done, it is very easy to bypass the customer-side code.

This is like data verification: the data is valid for validation, the form fills with valid values, for example) on the client because the immediate response creates a good user experience, but doing so There is no alternative to doing so on the server, because it is very difficult to bypass client-side verification.

But with the signifying input, you do not even want to try to do that client-side; Suppose it is non-clear and modify it on the server.

In ASP.Net, if you are configuring the infrastructure, it is a string that you are going to display in the HTML page later and you want to make sure that it has its own HTML tag If not, you can use the string to encode (basically, in & amp; lt; and so on).


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -