0
當前,我已經編寫了以下json搜索方法。使用HTML包含對象屬性並返回JSON
[HttpPost]
public JsonResult Search(string videoTitle)
{
var auth = new Authentication() { Email = "[email protected]", Password = "abc" };
var videoList = server.Search(auth, videoTitle);
String html = "";
foreach(var item in videoList){
var video = (Video)item;
html += "<b>"+video.Title+"</b>";
}
return Json(html, JsonRequestBehavior.AllowGet);
}
在屏幕上,它返回這個。
"\u003cb\u003eAge of Conan\u003c/b\u003e"
我該怎麼辦?我想這樣做的原因是,我可以使用CSS來標記樣式,以便在項目從搜索輸入中下拉時使其看起來更美觀。
感謝