我有以下代碼:public ActionResult SomeAction(){ return new JsonpResult { Data = new { Widget = "some partial html for the widget" } };}我想對其進行修改,以便可以public ActionResult SomeAction(){ // will render HTML that I can pass to the JSONP result to return. var partial = RenderPartial(viewModel); return new JsonpResult { Data = new { Widget = partial } };}這可能嗎?有人可以解釋一下嗎?注意,我在發(fā)布解決方案之前編輯了問題。
如何將部分視圖呈現(xiàn)為字符串
慕工程0101907
2019-10-11 14:09:46