<ejs-grid id="DocGrid" allowExcelExport="true" toolbarClick="toolbarClick" toolbar="@(new List<string>() { "ExcelExport" })" allowPaging="true" allowSorting="true" allowFiltering="true" gridLines="Both">
<e-data-manager url='/api/ArticlesApi' adaptor="WebApiAdaptor" crossdomain="true"></e-data-manager>
<e-grid-editSettings allowAdding="false" allowDeleting="false" allowEditing="false" showConfirmDialog="true" showDeleteConfirmDialog="true"></e-grid-editSettings>
<e-grid-textwrapsettings wrapMode="Both"></e-grid-textwrapsettings>
<e-grid-pagesettings pageSize="10"></e-grid-pagesettings>
<e-grid-filterSettings type="Excel"></e-grid-filterSettings>
<e-grid-columns>
<e-grid-column headerText="Article Pic" template="#template" textAlign="Center" width="150"></e-grid-column>
<e-grid-column field="Id" headerText="Article Id" isPrimaryKey="true" isIdentity="true" visible="false" textAlign="Right" width="125"></e-grid-column>
<e-grid-column field="Name" headerText="Name" width="120"></e-grid-column>
<e-grid-column field="Description" headerText="Description" width="170"></e-grid-column>
<e-grid-column field="Cost" headerText="Cost" type="number" format="N2" validationrules='@(new Dictionary<string, object> { { "required", true } })' width="120"></e-grid-column>
<e-grid-column field="IdString" headerText="Id string" width="120"></e-grid-column>
<e-grid-column headertext="" Template="#Edit" allowediting="false" width="40"></e-grid-column>
<e-grid-column headertext="" Template="#Delete" allowediting="false" width="40"></e-grid-column>
</e-grid-columns>
</ejs-grid>
<script id="template" type="text/x-template">
<div class="image">
<img src="@Url.Action("GetPic", "Home", new { Id = "${Id}"})" alt="${Id}" />
</div>
</script>
this doesn't work, I get an error that the string is malformed then I also tried :
<img src="@Url.Action("GetPic", "Home", new { Id = ${Id}})" alt="${Id}" />
but then the ${Id} is not even highlighted in purple in visual studio editor, meaning it is a syntaxe error, I have spent several hours trying all sorts of hacks to no avail.
The database functions are all working very well and tested because when I hardcode the Id like below :
<img src="@Url.Action("GetPic", "Home", new { Id = 2})" alt="${Id}" />
I get the expected normal behaviour for that record.
Please help me find a solution to this problem. Thnak you