asp.net mvc3 return raw html to view

后端 未结 7 693
时光说笑
时光说笑 2020-12-13 08:01

Are there other ways I can return raw html from controller? As opposed to just using viewbag. like below:

public class HomeController : Controller
{
    publ         


        
7条回答
  •  庸人自扰
    2020-12-13 08:32

    Simply create a property in your view model of type MvcHtmlString. You won't need to Html.Raw it then either.

提交回复
热议问题