BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
}); |
<ej-grid id="FlatGrid" allow-paging="true" datasource="ViewBag.dataSource" export-to-excel-action="/Home/ExportToExcel" export-to-pdf-action="/Home/ExportToPdf" >
<e-toolbar-settings show-toolbar="true" toolbar-items="@(new List<string>() {"excelExport","pdfExport" })" />
<e-edit-settings allow-editing="true" edit-mode="Batch"></e-edit-settings>
<e-columns>
<e-column field="OrderID" header-text="Order ID" is-primary-key="true" text-align="Right" width="75"></e-column>
<e-column field="CustomerID" header-text="Customer ID" width="80"></e-column>
<e-column field="EmployeeID" header-text="Employee ID" text-align="Left" width="75"></e-column>
<e-column field="Freight" header-text="Freight" format="{0:C2}" text-align=Right width="75"></e-column>
<e-column field="ShipCity" header-text="Ship City" width="110"></e-column>
</e-columns>
</ej-grid> |
The reported issue has occurred since the URL path wasn’t relative in the project. The action name is to be prepended with the controller name in order to avoid the routing issues. Please refer to the below code example and sample.
<ej-grid id="FlatGrid" allow-paging="true" datasource="ViewBag.dataSource" export-to-excel-action="@Url.Action("ExportToExcel","Home")" export-to-pdf-action="@Url.Action("ExportToPdf","Home")" >
<e-toolbar-settings show-toolbar="true" toolbar-items="@(new List<string>() {"excelExport","pdfExport" })" />
<e-edit-settings allow-editing="true" edit-mode="Batch"></e-edit-settings>
<e-columns>
<e-column field="OrderID" header-text="Order ID" is-primary-key="true" text-align="Right" width="75"></e-column>
<e-column field="CustomerID" header-text="Customer ID" width="80"></e-column>
<e-column field="EmployeeID" header-text="Employee ID" text-align="Left" width="75"></e-column>
<e-column field="Freight" header-text="Freight" format="{0:C2}" text-align=Right width="75"></e-column>
<e-column field="ShipCity" header-text="Ship City" width="110"></e-column>
</e-columns>
</ej-grid> |