I have MVC Grid and i want to render a actionlink so that onclick of the link a javascript function should call.I have tried this code but its not working please help here.. not working means on view click the page is without layout
@Html.Grid(Model).Named("receipt").Columns(columns =>
{
columns.Add(c => c.PaymentDate).Format("{0:dd/MM/yyyy}").Titled("Date").Filterable(true);
columns.Add(c => c.CustomerName).Titled("Customer").Filterable(true);
columns.Add(c => c.TotalAmountApplied).Titled("Amount").Filterable(true);
columns.Add().Encoded(false).Sanitized(false).Titled("View").Filterable(false).RenderValueAs(o => Html.ActionLink("see", null,null, new { onclick = "ViewReceipts('"+o.PayReceved_ID+"');" }));
}).WithPaging(@ViewBag.paging).Sortable(true)
<script type="text/javascript">
function ViewReceipts(recId)
{
//do something here
}
</script>