how will i load a page or a partial view in the popup window in jquery. i am using jquery popup but it is not loading with javascript
+3
A:
To load it into a placeholder:
$("#idOfPartialViewContainerOnPage").load("/ControllerName/PartialViewName");
Where the Action looks something like:
public ActionResult PartialViewName()
{
return PartialView(GetModelForMyPartialView());
}
To make it a popup window, use something like jQuery UI dialog:
var ph = $("#idOfPartialViewContainerOnPage");
ph.load("/ControllerName/PartialViewName", function() {
ph.dialog({
// set dialog options here
});
});
Craig Stuntz
2010-07-09 13:34:36