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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

RowTemplate with a button to post an id

Thread ID:

Created:

Updated:

Platform:

Replies:

147675 Sep 19,2019 09:31 AM UTC Sep 20,2019 05:41 AM UTC ASP.NET Core - EJ 2 1
loading
Tags: DataGrid
John Stephen Mangam
Asked On September 19, 2019 09:31 AM UTC

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)
        {
...
}

Pavithra Subramaniyam [Syncfusion]
Replied On 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. 


CONFIRMATION

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