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

RowTemplate with a button to post an id

Hi,

Here is my code that is not working. Please let me know how I could correct the code.

<script id="rowTemplate" type="text/x-template">
    <tr>
      ....
        <td class="details">
           @Html.ActionLink("Verify", "VerifyBook", "Verfiy", new {bookId="${Id}"}, new { @class = "btn-primary" })
        </td>
    </tr>
</script>


  [HttpPost]
        public ActionResult VerifyBook(string bookId)
        {
...
}

1 Reply

PS Pavithra Subramaniyam Syncfusion Team September 20, 2019 05:41 AM UTC

Hi John, 
 
Thanks for contacting Syncfusion support. 
 
For creating routing button with row template we suggest to use the below way. Please refer to the below code example for more information. 
 
[index.cshtml] 
<ejs-grid id="Grid" dataSource="ViewBag.data" height="335" width="auto" rowTemplate="#rowtemplate"> 
    <e-grid-columns> 
        .  .  . 
    </e-grid-columns> 
</ejs-grid> 
 
 
<script id="rowtemplate"> 
    <tr> 
        <td class="details"> 
            <a rel='nofollow' href="/Home/VerifyBook/bookId=${OrderID}" class="btn-primary"> Verify</a> 
        </td> 
    </tr> 
</script> 
 
Please get back to us if you need any further assistance on this. 
 
Regards, 
Pavithra S. 


Loader.
Up arrow icon