简体   繁体   中英

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

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??????

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

:-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM