how to encode the CSS text on web application pages

Oct 9 2019 9:11 AM
Hi team
 
working on css attacks validation code c# and they injecting the script in this way
 
%uff1cscript%uff1ealert%uff08123456%uff09%uff1c/script%uff1e and from the server side how to encode this text
 
to find out the it contans html code or not i am using following way to encode but its not working 
 
System.Web.HttpUtility.HtmlDecode or  HttpContext.Current.Server.HtmlEncode 
 
let us know how to validate it
 
Thanks in advance  

Answers (2)