Should I use html.Raw in every application?

Asked

Viewed 545 times

-1

Hello in all Partialview of my site, I had to put Html.Raw to solve problems with accent ( even in Head put UTF-8 and in web.config globalization ) only with Html.Raw solved, my question is can I put in all fields ( Title,Description and etc ) without compromising performance, since you’re still an Htmlhelpers??? grateful.

1 answer

0

When I had accentuation problem in Asp Net MVC Views, I simply saved the specific files that were having this problem with encoding UTF-8 with GOOD.

See a small example:

Salvar arquivo com codificação específica no VS Studio

Here at that link explains how to save or open a document with a specific encoding.

Particularly, I find horrible the idea of using any function to fix encoding, having the possibility to fix by saving the file with the correct encoding, since you will have to swap each snippet of code in hand.

  • So Wallace I had already checked the encoding this way and are all a UTF-8 that only happens in Partialview in Views does not happen this, so I decided to put an HTML.Raw in the return of the Bank just so solved. Thanks !!

  • @Webersp UTF-8 with BOM or without BOM? That’s why I made a point to mention this in the answer. When I had the problem, some of my views (especially those generated by scaffolding) were left with UTF-8 UNWORTHY. I needed to save as UTF-8 with GOOD to solve. GOOD is Byte Order Marker.

  • Wallace Maxters thanks for the tip he didn’t know this form of coding without and with, but still didn’t solve... even using Notepad++ and Save Visual. Hugs.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.