質問

I'm having prolemas with accents when they step values ​​to ViewData.

In Controller:

ViewData["mensagem"] = "Não Esta Correto"

In View:

@Html.Encode(ViewData["mensagem"])

appears the : Não Esta Correto

Only the string that is passed by the ViewData have this problem, how to fix .

役に立ちましたか?

解決

@ already encodes. This is the main diff between razor and aspx ... You are double encoding.

@ViewData["mensagem"]

To NOT encode:

@Html.Raw(ViewData["mensagem"])
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top