Last active
June 29, 2020 13:28
-
-
Save corespider/1bc086a6f07a52806442940ea9f438ed to your computer and use it in GitHub Desktop.
CoreSpider- Export to Excel in ASP .NET MVC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model IEnumerable<ExportExcel_ASPNETMVC.Models.Customer> | |
@{ | |
ViewBag.Title = "Index"; | |
} | |
<h2>Index</h2> | |
<p> | |
@Html.ActionLink("Create New", "Create") | |
</p> | |
@using (Html.BeginForm("Export", "Customer", FormMethod.Post)) | |
{ | |
<div class="container"> | |
<input type="submit" value="Export to Excel" class="btn btn-primary" /> | |
</div> | |
<table class="table"> | |
<tr> | |
<th> | |
@Html.DisplayNameFor(model => model.CustomerName) | |
</th> | |
<th> | |
@Html.DisplayNameFor(model => model.CustomerAddress) | |
</th> | |
<th> | |
@Html.DisplayNameFor(model => model.CustomerMobile) | |
</th> | |
<th></th> | |
</tr> | |
@foreach (var item in Model) | |
{ | |
<tr> | |
<td> | |
@Html.DisplayFor(modelItem => item.CustomerName) | |
</td> | |
<td> | |
@Html.DisplayFor(modelItem => item.CustomerAddress) | |
</td> | |
<td> | |
@Html.DisplayFor(modelItem => item.CustomerMobile) | |
</td> | |
<td> | |
@Html.ActionLink("Edit", "Edit", new { id = item.CustomerId }) | | |
@Html.ActionLink("Details", "Details", new { id = item.CustomerId }) | | |
@Html.ActionLink("Delete", "Delete", new { id = item.CustomerId }) | |
</td> | |
</tr> | |
} | |
</table> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment