HTML encode decode c# MVC4

前端 未结 3 534
渐次进展
渐次进展 2020-12-15 07:04

I am in a process of upgrading a c# MVC2 project into c# MVC4.

Here is the scenario in MVC2

Input string(from database)

   M         


        
3条回答
  •  无人及你
    2020-12-15 07:17

    If you don't want your text get encoded, that text should be of type IHtmlString. String texts are encoded by default.

    In your case,

    Model.text = MvcHtmlString.Create("

    Hi
    hello!
    you there

    ");

    would do the trick as well.

提交回复
热议问题