I have a cshtml page (index) that displays a Grid.MVC with rows of data. When the user clicks on the ID row I need to display a popup window that provides more detail information. I have a break point in my JavaScript code but it is never hit. Right now the code calls the controller instead of the function.
cshtml code:
<div class="container-fluid">
@Html.Grid(Model).Columns(columns =>
{
columns.Add(c => c.task_id).Encoded(false).Titled("ID").Sanitized(false).Sortable(true).RenderValueAs(c => @Html.ActionLink(c.task_id.ToString(), "viewTransfers", new { taskId=c.task_id }, new { @onclick = "getTransfers('" + c.task_id + "')"}));
columns.Add(c => c.company).Titled("Company");
})Filterable(false).WithPaging(int.Parse(EPH.Common.Util.GetConfigSetting("PageSize"))).Selectable(true)
</div>
<script type="text/javascript">
$(function() {
$('#getTransfers').click(function (e) {
e.preventDefault();
$(this).modal();
});
});
</script>
Controller:
public ActionResult ViewTransfers(int taskId)
{
var myQuery = from transfers in db.fals_ftp_watcher_transfers
where transfers.task_id == taskId
orderby transfers.imp_date ascending
select transfers;
return View(myQuery);
}