html-encoding

where should i encode this html data in an asp.net mvc site

here is my view code: <%=Model.HtmlData %> here is my controller code: public ActionResult GetPage() { ContentPageViewModel vm = new ContentPageViewModel(); vm.HtmlData = _htmlPageRepository.Get("key"); return View(vm); } my repository class basically queries a database table that has the fields:...

Content type vs HTML encoding

Hello! I'm bulding a site and I've set its content type to use charset UTF-8. I'm also using HTML encoding for the special characters, ie: instead of having á I've got &aacute;. Now I wonder (still bulding the site) if it was really necesary to do both things. Looking for the answer I found this: http://www.w3.org/International/questi...