or

<div data-role="popover" id="popover-locations" data-popup='{"height": 230, "width": 350}'> <div data-role="view" data-title="Clinic Locations"> <div data-role="header"> <div data-role="navbar"> <span data-role="view-title"></span> <a data-role="button" data-align="right" data-click="updateSelectedLocation">Close</a> </div> </div> <ul data-role="listview"> @{ var locs = (List<Location>) Session["Locations"]; foreach (var l in locs) { if (l.IsActive) { <li><label>@l.DisplayText<input data-ident="@l.Identifier" type="checkbox" checked="checked" name="chbx-location"/></label></li> } else { <li><label>@l.DisplayText<input data-ident="@l.Identifier" ype="checkbox" name="chbx-location"/></label></li> } } } </ul> </div> </div>$(document).ready(function () { // bind the location popover close event to the updateSlectedLocation function. var locPopover = $('#popover-locations'); locPopover.bind('close', updateSelectedLocation);});