0
我開發與asp.net的MVC應用程序我如何使用MVC框架標籤與Html.Raw
我如何使用MVC框架標籤與Html.Raw。
這是我的代碼,但notworking
@Html.Label("txtLoginMail", Html.Raw((string)ViewBag.reqRegisterLastName))
我開發與asp.net的MVC應用程序我如何使用MVC框架標籤與Html.Raw
我如何使用MVC框架標籤與Html.Raw。
這是我的代碼,但notworking
@Html.Label("txtLoginMail", Html.Raw((string)ViewBag.reqRegisterLastName))
正如斯蒂芬和塞達特,要做到這一點是使用編碼最簡單的方法的註釋中提到。
@{
byte[] bytes = Encoding.Default.GetBytes(ViewBag.reqRegisterLastName);
var reqRegisterLastName = Encoding.UTF8.GetString(bytes);
}
@Html.Label("txtLoginMail", reqRegisterLastName)
Thx克里斯我現在的代碼正在工作 –
什麼是你想在這種情況下使用'Html.Raw'的原因是什麼? – Shyju
'reqRegisterLastName'的值是什麼?你試圖輸出什麼? –
ViewBag.reqRegisterLastName =「Seçiniz」,但我有一個特殊字符問題 –