<script id="rowtemplate" type="text/x-template">
<tr>
<td class="photo"> // you can convert and apply the corresponding HTML code here
<form id="verifyform${OrderID}" name="VerificationForm" method="post">
<button name="compilationId" value="${OrderID}" class="btn-primary" type="submit" formaction="/Home/About?area=xxx">
Edit
</button>
</form>
</td>
</tr>
</script> |
I'm using asp.net core 3.1 and latest version of syncfusionapp.UseEndpoints(routes =>{routes.MapAreaControllerRoute("Officer","Officer","Officer/{controller=Home}/{action=Index}/{id?}");routes.MapDefaultControllerRoute();});
<ejs-grid id="Grid" rowTemplate="#rowtemplate" width="600px" allowPaging="true">
. . .
<script id="rowtemplate" type="text/x-template">
<tr style="border: 2px dotted">
<td class="details">
<div>
<form id="viewform${OrderID}" name="ViewForm" method="post">
. . .
Areaname/Controller name/ action
formaction= "/Products/Home1/formActionHandler"
type="submit"
class="btn-primary">
View
</button>
. . . |
[Areas/Products/Controllers/HomeController.cs]
. . .
namespace aspnetcore_3._0.Controllers
{
[Area("Products")]
public class Home1Controller : Controller
{
private readonly ILogger<Home1Controller> _logger;
public Home1Controller(ILogger<Home1Controller> logger)
{
_logger = logger;
}
public IActionResult Index()
{
var Order = OrdersDetails.GetAllRecords();
ViewBag.DataSource = Order;
return View();
}
// here we have redirected the form action
public string formActionHandler(formData data)
{
return "Form submitted, values are \n " + data.OrderID + '\n' + data.CustomerID;
}
. . .
public class formData
{
public string CustomerID { get; set; }
public string OrderID { get; set; }
}
}
|