This is a migrated thread and some comments may be shown as answers.

vb/aspx view - want to user html.actionlink inside client template.

1 Answer 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shash
Top achievements
Rank 1
Shash asked on 22 Nov 2013, 03:57 PM

I am a newbie and have been doing a lot of reading and trying. The following code works to some degree.  Here's what I would like to address:
1. change the anchor tag in the clientTemplate to an html.Actionlink as in the .template

2. my datafield is not being encoded in the clientTemplate - most likely just syntax

3. if I must use the anchor tag - how do I pass parameters?

Thank you for any help.

<%  Html.Telerik().Grid(Model.DocketList).
       Name("RenderedDockets").HtmlAttributes(New With {.style = "width:1200px; font-size:10px;"}).
       Columns(Sub(columns)
                   columns.Template(Function(d) Ajax.ActionLink(d.DocketNumber.ToString, "../Forms/DocketImageRendPage.aspx", New With {.id = d.DocketNumber}, New AjaxOptions With {.HttpMethod = "Get"})).Title("Docket").
                       ClientTemplate("<a class='mgGoto' href='../Forms/DocketImageRendPage.aspx'>#=model.DocketNumber#</a>").Title("Docket")
                         Pageable().
      DataBinding(Function(b) b.Ajax().OperationMode(GridOperationMode.Client)).
      Sortable().BindTo(Model.DocketList).Render()%>

1 Answer, 1 is accepted

Sort by
0
Shash
Top achievements
Rank 1
answered on 22 Nov 2013, 07:56 PM

got it to work... here is code:

ClientTemplate(Html.ActionLink("<#= DocketNumber #>", "../Forms/DocketImageRendPage.aspx", New With {.id = "<#= DocketNumber #>"}, New With {.target = "_blank"}).ToHtmlString).Title("Docket")
Tags
Grid
Asked by
Shash
Top achievements
Rank 1
Answers by
Shash
Top achievements
Rank 1
Share this question
or