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

Answers


the solution to this issue exists here:

How to Render Partial View into a String


Need Your Help

Remove the Legend from nvd3 pie chart

javascript d3.js pie-chart nvd3.js

Im working on creating a pie chart using nvd3. I successfully got the pie chart but when the number of slices increase the legends tend to take up lot of space and the pie shrinks. I have decided to

Cordova app form input fields lagging in showing data while entering

javascript angularjs cordova

I have created a cordova app using node, angular, sqlite. The app consist of multipage form. When i fill the form then input fields are lagging means they are taking time to show the entered data. ...