I have this code:
$("#allphotos").click(function () {
$("<div></div>")
.addClass("dialog")
.appendTo("body")
.dialog({
close: function() { $(this).remove(); },
modal: true,
height: 1000,
width: 1000
})
.load("/Home/AllPhotos", data);
});
And this method:
public ActionResult AllPhotos()
{
var listofPhotos =
RavenSession.Query<ContentPage>()
.Where(o => o.Template.ContentPageType == "aPhoto_web.Models.Photography, aPhoto_web")
.AsProjection<Photography>()
.ToList();
var avm = new AdminViewModel();
avm.Photographys = listofPhotos;
return PartialView("_allPhoto", avm.Photographys);
}
The method returns a list of photographys that i would like the Jquery to display in a dialog. Im pretty sure this line:
.load("/Home/AllPhotos", data);
Is the problem. Any ideas of what to try?
VIEW:
@model aPhoto_web.Models.AdminPages.AdminViewModel
<h1>Test to see if dialog is empty...and it is</h1>
@foreach (var item in Model.Photographys)
{
<img src="@item.ImgUrl"/>
}
.load("/Home/AllPhotos");