<div data-role="content">
<ul data-role="listview" data-split-icon="delete-icon">
<% foreach (MvcApplication.Models.PastVisitListModel item in Model.PastVisitList)
{ %>
<li>
<h3>
<%= Html.ActionLink(item.FirstName + " " + item.LastName, "Complaint", "PastVisit", new {patientId = item.PatientId, visitId = item.VisitId}, null)%> </h3>
<p class="ui-line-aside">
DOB: <%= item.DateOfBirth.ToShortDateString() %> </p>
<p class="ui-line-aside">
Visit Date: <%= item.DateOfVisit.ToShortDateString()%> </p>
<a id="deleteLink" onclick="return confirm('Are you sure you want to delete?');" href="<%= Url.Action("Delete", "PastVisit", new {id = item.VisitId}) %>" >Delete</a>
</li>
<% } %>
</ul>
</div>
To point out the problem even further, why would the href (ie. controller/action) be executed in the following code:
I've tested this code on another button (that wasn't in a list and wasn't a split button) and it works as I expected. So I'm lead to believe it's due to the listview or split button.