Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i have a problem . if i want to save html tags icluded text such as <html> i get below problem :

" A potentially dangerous Request.Form value was detected from the client... "
i dont want to disable page ValidationRequest . what i do ?
Posted

 
Share this answer
 
Comments
Tech Code Freak 8-Mar-12 3:53am    
5up!
walterhevedeich 8-Mar-12 3:59am    
Thanks.
You should use JavaScript (or a server-side script) to properly escape any user input. Here's another JavaScript function you could try

JavaScript
String.prototype.escapeHTML = function () {
  return(
    this.replace(/>/g,'&gt;').
         replace(/</g,'&lt;').
         replace(/"/g,'&quot;')
  );
};
var codeEl = document.getElementById('test');
if (codeEl) {
  codeEl.innerHTML = codeEl.innerHTML.escapeHTML();
}
 
Share this answer
 
Comments
Tech Code Freak 8-Mar-12 3:53am    
5up!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900