开发者

How to Generate Embeddable Widgets, and Return PartialView, JS & CSS as JSONP?

I found this question which is a great starting point towards creating embedded widgets that enable showing dynamic content on remote sites (i.e. a different domain).

One problem I'm having is with the following code:

public ActionResult SomeAction()
{
    return new JsonpResult
    {
        Data = new { Widget = "some partial html for the widget" }
    };
}

It says Widget = "some partial html for the widget" but this doesn't really mean anything to me. I assume that Widget would contain the HTML representing what the user wants to see on the screen, but How do I get the contents of my Partial View into Widget?

Can anyo开发者_运维知识库ne point me in the right direction? Thanks..


the solution to this issue exists here:

How to Render Partial View into a String

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜