1
Answer

Script Attack

Gaurav Tomar

Gaurav Tomar

16y
9.7k
1

How would you stop users to post script or any other malicious tags to your site before postback, Also I don't want to use javascript for that.

Thanks

Answers (1)
0
Gaurav Tomar

Gaurav Tomar

NA 638 1.5m 16y

Here is an answer:

We just need to explicitly encode the content before we display it using the Server object.

For eg : If we need to control text of some particular textbox than use server object like this:

Server.HtmlEncode(TextBox.text)

This simple code will disarmed script attack to your site.

Hope you got, what you need!!