Click here to Skip to main content
15,892,697 members
Articles / Web Development / ASP.NET

ASP.NET Application Development Using MVC

Rate me:
Please Sign up or sign in to vote.
4.79/5 (24 votes)
23 Feb 2011CPOL5 min read 150.5K   8.3K   56  
A sample ASP.NET application development using MVC.
@model IEnumerable<ASPNETMVCApplication.Models.Book>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>
            Title
        </th>
        <th>
            ISBN
        </th>
        <th>
            Price
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
        <td>
            @item.Title
        </td>
        <td>
            @item.ISBN
        </td>
        <td>
            @String.Format("{0:F}", item.Price)
        </td>
    </tr>
}

</table>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
Bangladesh Bangladesh
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions