0

What am trying to achieve is to get a jquery modal popup from the existing code - through ActionLink in telerik grid, but am missing the syntax, if someone could help out please

this actionlink works perfectly bringing out the Modal.

<%: Html.ActionLink("Edit", "DemoEdit", new { xid = item.Userid }, new { @class = "abookModal", title = "Edit Person" })%>

and so I embedded this into telerik grid, as in client side.

.Columns(columns =>
{
    columns.Bound(e => e.Userid);
    columns.Bound(e => e.Name);
    columns.Bound(e => e.Email);
    columns.Bound(e => e.Userid)
      .ClientTemplate(Html.ActionLink("Edit", "DemoEdit", new {xid = "<#= Userid #>"}).ToString(), new { @class = "abookModal", title="Edit Person"});

the very last part starting from new { @class = "abookModal", title="Edit Person"} wouldn't be taken in because "No overload for method 'ClientTemplate' take 2 arguments.

Any solution to this?

Tassadaque
  • 8,129
  • 13
  • 57
  • 89
Darren
  • 1
  • 2

2 Answers2

0

You may use anchor tag instead of html.actionlink

.ClientTemplate("<a href='"+Url.Action("DemoEdit","controllername",new {xid = "<#=Userid #>"})+ "' class='abookModal'>Edit</a>")`
Tassadaque
  • 8,129
  • 13
  • 57
  • 89
0

I think the parentheses on your ClientTemplate might be off

.ClientTemplate(Html.ActionLink("Edit", "DemoEdit", new {xid = "<#= Userid #>"}).ToString(), new { @class = "abookModal", title="Edit Person"});

should be

.ClientTemplate(Html.ActionLink("Edit", "DemoEdit", new {xid = "<#= Userid #>"}, new { @class = "abookModal", title="Edit Person"}).ToString());
mymex1
  • 148
  • 3