How to Export Webgrid to Excel in MVC4 Application

In this article I am going to explain how to export tabulated or grid representation of data (webgrid data) to the Excel file.
Customer ID Customer Name Address City Postal Code
1 Jonny Decosta Obere Str. 57 London 5466
2 Suresh Das A/17 Khandala Canada D.A 2455
3 Satish Roy Mataderos 2312 Simla 1245
4 Mr. S. K. Almer 120 bengira Rd. Singapur 1478
5 Benji Dutta 56 chouringi hill Dubai 1456
6 Maria Anders Obere Str. 57 Berlin 98401
7 Ana Trujillo Avda. de la Constitución 2222 México D.F. 98033
8 Antonio Moreno Mataderos 2312 México D.F. 98052
9 Thomas Hardy 120 Hanover Sq. London SW1 8JR
10 Hanna Moos Forsterstr. 57 Mannheim SW1 8JR
11 Robert King Berguvsvägen 8 Mannheim WG2 7LT
Export Data : Excel
How to Export Webgrid to Excel in MVC4 Application

<!DOCTYPE html>
<html lang="en">
        <meta charset="utf-8" />
        <title>@ViewBag.Title - My ASP.NET MVC Application</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
            <div class="content-wrapper">
                <div class="float-left">
                    <p class="site-title">@Html.ActionLink("your logo here", "Index", "Home")</p>
                <div class="float-right">
                    <section id="login">
                        <ul id="menu">
                            <li>@Html.ActionLink("Home", "Index", "Home")</li>
                            <li>@Html.ActionLink("About", "About", "Home")</li>
                            <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
        <div id="body">
            @RenderSection("featured", required: false)
            <section class="content-wrapper main-content clear-fix">
            <div class="content-wrapper">
                <div class="float-left">
                    <p>&copy; @DateTime.Now.Year - My ASP.NET MVC Application</p>

        @RenderSection("scripts", required: false)

Posted By :