Display PartialView as popup

Mr-Ice-Man

New Member
In my View I have;\[code\]@foreach (var item in Model){ <li>@Html.ActionLink("click me", "popup", "SomeData", new{id = item.ID}, new {@class = "PopUp"})</li>}\[/code\]I then have a controller that looks like this;\[code\]public ActionResult popup(Guid id){ var singelData = http://stackoverflow.com/questions/15876993/db.SomeRandomData.Find(id); return PartialView(singelData);}\[/code\]And a partialView that looks like this;\[code\]<div>This a popup</div>@Model.metadata1\[/code\]So far so good, when I click on a link I get redirected to a partialView.Now to the part where I'm not comfortable, the script section, here is my attempt;\[code\]<script src="http://stackoverflow.com/questions/15876993/~/Scripts/jquery-ui-1.8.20.js"></script><script type="text/javascript"> $(function () { $('.PopUp').click(function () { $('<div/>').appendTo('body').dialog({ close: function (event, ui) { dialog.remove(); }, modal: true }).load(this.href, {}); return false; }); });</script>\[/code\]But it still just returns a view. Where do i go wrong?
 
Top