Adding Create View

Always remember, for every view that we created, we need to define the model in order to display the data dynamically.

@model PlaylistGenreMvc.Models.SongModel
@{
    ViewBag.Title = "Create";
}
<h2>Create</h2>

And, to perform CRUD function in MVC, we use Html.BeginForm

@using (Html.BeginForm())
{
    <fieldset>
        <legend>SongModel</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
        </div>

        ..
        ..
        ..
        ..

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

results matching ""

    No results matching ""