We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid custom template not rendering asp net core tag helpers

Thread ID:





149383 Nov 24,2019 07:06 PM UTC Nov 25,2019 01:43 PM UTC ASP.NET Core - EJ 2 4
Tags: DataGrid
Asked On November 24, 2019 07:06 PM UTC

Hi there,

I'm trying to use a custom template for a grid column which contains ASP.NET Core tag helpers like this:

<e-grid-column field="Name" headerText="Name" template="#nameAnchor"/>

<script id="nameAnchor" type="text/template">
        <a asp-page="./Detail" asp-route-id="${Id}">${Name}</a>

The asp tags are not rendered to html when using type="text/template",  and the ${} tags are not rendered to html when using type="text/html".

Could you please assist?


Replied On November 25, 2019 03:34 AM UTC

Just to give some more context:

Rendered html when using type="text/template": <a asp-page="./Detail" asp-route-id="001">SomeName</a>
Rendered html when using type="text/html": <a rel='nofollow' href="/Detail?id=$%7BId%7D">SomeName</a>

Expected html: <a rel='nofollow' href="/Detail?id=001">SomeName</a>

.Net Core 3.0
Syncfusion.EJ2.AspNet.Core Version=

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On November 25, 2019 10:15 AM UTC

Hi Customer, 

Thanks contacting Syncfusion support, 

We have checked your query and ASP.Net Core Anchor Tag Helper cannot use template literals like ${Id}. So we have achieved your requirement  by using html Anchor tag instead of asp Achor tag. Please refer the below code example and sample for more information. 


<ejs-grid id="Grid" dataSource=" ViewBag.DataSource" allowPaging="true">     
        <e-grid-column field="OrderID" width="110" isPrimaryKey=true></e-grid-column> 
        <e-grid-column field="CustomerID" headerText="CustomerID" width="110" template="#nameAnchor"></e-grid-column> 
    .   .    .    . 
<script id="nameAnchor" type="text/x-template"> 
        <a rel='nofollow' href="/Detail?id=${EmployeeID}" class='btn btn-primary'>${CustomerID}</a> 

Please get back to us, if you need further assistance. 

Seeni Sakthi Kumar S 

Replied On November 25, 2019 01:32 PM UTC


That's what I ended up doing.
Thanks for confirming.

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On November 25, 2019 01:43 PM UTC

Hi Customer,

Thanks for the update. Please get back to us, if you require further assistance on this.

Seeni Sakthi Kumar S 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon