Dumb Programming Advice

ASP.NET Potentially Dangerous Request.Form Value

My app threw this error the other day, and every piece of advice in the world said "here's how you turn this off!" Um, isn't this like turning off your brakes because they "make noise when you slow down"?

Here's how to fix it... any place you are outputting values directly from a DB or user input, it needs to be encoded.

MyCoolTextbox.Text = HttpUtility.HtmlEncode(your variable here);