I put together a simple example:
I have a list of thumbnails and I want to display a bigger image when an image from the list is selected:
@if (Model.GalleryIcon.Any())
{
foreach (var cell in Model.GalleryIcon)
{
<a href="/Logo/MobileImage?url=@cell.TargetImagePath" data-rel="dialog" data-transition="pop" ><img src="@cell.ThumbInvPath" /></a>
}
}
/Logo/MobileImage?url=@cell.TargetImagePath returns a partial view where @Model is a imagePath string:
@model string
<div id="logo-image-wrap">
<img src='@Model' id="logo-wrap-mobile-image"/>
<br />
<a href="#" data-role="button" data-rel="back" data-icon="arrow-l">Back</a>
</div>
This works is I set rel=”external” on the anchor and simply opens an image in new, separate page but it doesn’t work as a Dialog box.
When an thumbnail image is selected from the list a blank dialog box comes up with “Undefined”
How can I mage my Partial view load with image details in a Dialog when a thumbnail is selected from the list?
Thank you.
Detailed solution is posted here:
http://usnitch.blogspot.com/2012/08/jquery-mobile-how-to-dynamically-load.html