首页 > 解决方案 > How to render "&" operator sign in ASP.NET MVC

问题描述

On my main page, I get "Account Set Up & Goal Setting" from API. I want to render a string like "Account Set Up & Goal Setting". but render like "Account Set Up & Goal Setting" in MVC, How i can fix that issue.

标签: asp.netasp.net-mvcrazor

解决方案


问题是您正在&呈现为文本而不是呈现为 html。试试下面的代码,我希望这会对你有所帮助。

利用Html.Raw("Account Set Up & Goal Setting")


推荐阅读