outputting html in runtime in asp.net

Posted by madness800 on Stack Overflow See other posts from Stack Overflow or by madness800
Published on 2010-04-24T12:39:48Z Indexed on 2010/04/24 12:43 UTC
Read the original article Hit count: 336

Filed under:
|
|
|

Hi all,

I'm building a website at the moment, I've some html fragment that is being stored into the database, I've been reading around that inserting HTML at runtime poses security risks by using the InnerHTML property of any html tag with runat server on it.

So, my question is there any alternative way to safely display the html code and won't pose security risks and is it best to assume any textboxes on any given page is dangerous and process the text in the textboxes with Server.HtmlEncode before I store it to database?

Cheers

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about security