Adding Delete View

In Delete View, we use DisplayNameFor instead of TextBoxFor as in Edit View. Just change it and it will be done.

@model PlaylistGenreMvc.Models.SongModel
@{
    ViewBag.Title = "Delete";
}

<h2>Delete</h2>

@using (Html.BeginForm())
{

    <h3>Are you sure you want to delete this?</h3>
    <fieldset>
        <legend>BookModel</legend>
        <div class="display-label">
            @Html.DisplayNameFor(model => model.Title)
        </div>
        <div class="display-field">
            @Html.DisplayFor(model => model.Title)
        </div>

        ..
        ..
        ..
        ..

    </fieldset>

    <p>
        <input type="submit" value="Delete" /> |
        @Html.ActionLink("Back to List", "Index")
    </p>
}

results matching ""

    No results matching ""