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

Posted by DaveDev on Stack Overflow See other posts from Stack Overflow or by DaveDev
Published on 2010-03-29T11:17:00Z Indexed on 2010/03/29 12:13 UTC
Read the original article Hit count: 196

Filed under:
|
|
|

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 anyone point me in the right direction? Thanks..

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about widgets