1
在Asp.net MVC中,我想在JSON中返回HTML,以便我可以在Android應用程序中訪問此HTML。如何使用Mvc返回純HTML JsonResult
public ActionResult GetContactText()
{
string str = "";
CM cms = objcms.GetCMSData();
if (cms != null)
{
str = cms.ContactUs;
}
return Json(str, JsonRequestBehavior.AllowGet);
}
我的數據庫中值是"<p>Hare Krsna !</p>"
,但是當我在瀏覽器中看到或從其他平臺調用它返回
"\u003cp\u003eHare Krsna !\u003c/p\u003e\r\n"
這個結果。如何用Asp.net MVC 3返回純html。
請幫忙!
如何使用JsonResult而不是ActionResult? – Mitul
@Mitul同樣的結果。 –