我有以下代碼:public ActionResult SomeAction(){ return new JsonpResult { Data = new { Widget = "some partial html for the widget" } };}我想對(duì)其進(jìn)行修改,以便可以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ā)布解決方案之前編輯了問題。
請(qǐng)問如何將部分視圖呈現(xiàn)為字符串
慕運(yùn)維8079593
2019-11-03 04:04:27