Question: Is there any property or any function is giving which is prevent above issue..

i made a one register form.. and my friend inserted tag into username.. and it will raise a error at server side.. i tried to prevent it. with validation but.. it cant..

i did it.. check out this line.. 

```
txt_countryname.Text = HttpUtility.HtmlEncode(txt_countryname.Text);

```

but its not working ... – Sikender 0 secs ago [delete this comment]

help me...

Answer: 
You will want to, for that page to disable Script-validation. The reason why you are getting that error is because ASP.NET by default validates incoming posts.

[Read more about it](http://www.asp.net/learn/whitepapers/request-validation/)
I would take a look at [HttpServerUtility.HtmlEncode](http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.htmlencode.aspx).