Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 20. jQuery > Creating the Project

20.1. Creating the Project

To demonstrate the key jQuery features, we have created a simple MVC Framework application that lists mountain summits and their heights. Given that jQuery is a client-side technology, we will focus on the Razor view and HTML that this application generates. Listing 20-1 shows the view.

Example 20.1. The Sample Application Index.cshtml View

@using MvcApp.Models;
@model IEnumerable<Summit>
@{
    ViewBag.Title = "List of Summits";
}

<h4>Summits</h4>

<table>
    <thead>

<tr><th>Name</th><th>Height</th><th></th></tr>
    </thead>
    @foreach (Summit s in Model) {
        <tr>
            <td>@s.Name</td>
            <td>@s.Height</td>
            <td>
                @using (Html.BeginForm("DeleteSummit", "Home")) {
                    @Html.Hidden("name", @s.Name)
                    <input type="submit" value="Delete" />
                }
            </td>
        </tr>
    }
</table>

@Html.ActionLink("Add", "AddSummit")
@using (Html.BeginForm("ResetSummits", "Home")) {
    <input type="submit" value="Reset" />
}


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint