Pass 2 parameters to function in ClientTemplate of Telerik grid in Asp.net mvc3

5.3k Views Asked by At

I want to send two parameters to a function in a ClientTemplate of a Telerik Grid in Asp.net MVC3.

I did something like this:

 columns.Bound(m => m.ID).Title("Delete").ClientTemplate("<a href='#' title='Delete' onclick='return DeleteData(<#=ID#>,<#=Name#>)'><SPAN class='delete'></SPAN></a>").Width(53);

But this is not working.

In this ID field is an int field and Name is a string type field. How can I accomplish this task? Can anyone please help me??????

1

There are 1 best solutions below

2
On BEST ANSWER

I resolved my question myself. It can be done like:

columns.Bound(m => m.ID).Title("Delete").ClientTemplate("<a href='#' title='Delete' onclick=\"return DeleteData(<#=ID#>,'<#=Name#>')\"><SPAN class='delete'></SPAN></a>").Width(53);

And its working

:-)