@model MyMusicStore.Models.Album

@{

    ViewBag.Title = "Edit";

}

<h2>Edit</h2>

@using (Html.BeginForm())

{

    @Html.AntiForgeryToken()

    

    <div class="form-horizontal">

        <h4>Album</h4>

        <hr />

        @Html.ValidationSummary(true, "", new { @class = "text-danger" })

        @Html.HiddenFor(model => model.AlbumId)

<div class="form-group">

            @Html.LabelFor(model => model.GenreId, "GenreId", htmlAttributes: new { @class = "control-label col-md-2" })

            <div class="col-md-10">

                @Html.DropDownList("GenreId", null, htmlAttributes: new { @class = "form-control" })

                @Html.ValidationMessageFor(model => model.GenreId, "", new { @class = "text-danger" })

            </div>

        </div>

<div class="form-group">

            @Html.LabelFor(model => model.ArtistId, "ArtistId", htmlAttributes: new { @class = "control-label col-md-2" })

            <div class="col-md-10">

                @Html.DropDownList("ArtistId", null, htmlAttributes: new { @class = "form-control" })

                @Html.ValidationMessageFor(model => model.ArtistId, "", new { @class = "text-danger" })

            </div>

        </div>

<div class="form-group">

            @Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" })

            <div class="col-md-10">

                @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })

                @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })

            </div>

        </div>

<div class="form-group">

            @Html.LabelFor(model => model.Price, htmlAttributes: new { @class = "control-label col-md-2" })

            <div class="col-md-10">

                @Html.EditorFor(model => model.Price, new { htmlAttributes = new { @class = "form-control" } })

                @Html.ValidationMessageFor(model => model.Price, "", new { @class = "text-danger" })

            </div>

        </div>

<div class="form-group">

            @Html.LabelFor(model => model.AlbumArtUrl, htmlAttributes: new { @class = "control-label col-md-2" })

            <div class="col-md-10">

                @Html.EditorFor(model => model.AlbumArtUrl, new { htmlAttributes = new { @class = "form-control" } })

                @Html.ValidationMessageFor(model => model.AlbumArtUrl, "", new { @class = "text-danger" })

            </div>

        </div>

<div class="form-group">

            <div class="col-md-offset-2 col-md-10">

                <input type="submit" value="Save" class="btn btn-default" />

            </div>

        </div>

    </div>

}

<div>

    @Html.ActionLink("Back to List", "Index")

</div>

@section Scripts {

    @Scripts.Render("~/bundles/jqueryval")

}

MVC基架生成的Edit视图的更多相关文章

  1. MVC基架生成的 Details视图

    @model MyMusicStore.Models.Album @{     ViewBag.Title = "Details"; } <h2>Details< ...

  2. MVC基架生成的Index视图

    @model IEnumerable<MyMusicStore.Models.Album> @{     ViewBag.Title = "Index"; } < ...

  3. MVC基架生成的Detele视图

    @model MyMusicStore.Models.Album @{     ViewBag.Title = "Delete"; } <h2>Delete</h ...

  4. MVC基架生成的Create视图

    @model MyMusicStore.Models.Album @{     ViewBag.Title = "Create"; } <h2>Create</h ...

  5. MVC 基架不支持 Entity Framework 6 或更高版本

    MVC 基架不支持 Entity Framework 6 或更高版本.有关详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=276833. PS:新做一个 ...

  6. MVC 基架不支持 Entity Framework 6 或更高版本 即 NuGet的几个小技巧

    MVC 基架不支持 Entity Framework 6 或更高版本.有关详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=276833. 原因:mvc版 ...

  7. MVC之基架

    参考 ASP.NET MVC5 高级编程(第5版) 定义: 通过对话框生成视图及控制器的模版,这个过程叫做“基架”. 基架可以为应用程序的创建.读取.更新和删除(CRUB)功能生成所需的样板代码.基架 ...

  8. 学习《ASP.NET MVC5高级编程》——基架

    基架--代码生成的模板.我姑且这么去定义它,在我学习微软向编程之前从未听说过,比如php代码,大部分情况下是我用vim去手写而成,重复使用的代码需要复制粘贴,即使后来我在使用eclipse这样的IDE ...

  9. MVC 用基架创建Controller,通过数据库初始化器生成并播种数据库

    1 创建MVC应用程序 2 在Model里面创建实体类 using System; using System.Collections.Generic; using System.Linq; using ...

随机推荐

  1. python opencv3 —— findContours

    findContours 是 opencv 下的轮廓提取函数. 1. api 分析 findContours(image, mode, method[, contours[, hierarchy[, ...

  2. 【Z10】引水入城

    [题目链接]:http://noi.qz5z.com/viewtask.asp?id=z10 [题解] 对于第一问:从最上面那m个格子开始进行广搜就可以了: 然后看一下最下面那一行有没有被全部覆盖; ...

  3. 怎样用O2O去改变充满谎言、疑虑和愤慨的维修行业

    为什么千亿级的维修服务市场出不了行业巨头?   据相关统计,我国的整个维修服务市场规模可达每年数千亿元之巨(当中仅家电维修就可达近千亿规模,更遑论手机.数码.家具等维修). 相同是千亿级规模的服务行业 ...

  4. [Angular] Enable router tracing

    To enable router tracing is really simple: RouterModule.forRoot(ROUTES, { enableTracing: true }) Whe ...

  5. new File(String Path)加载资源问题

    2017-12-17   15:07:38  [原创-wx] 一.我们在用IO流加载资源的时候,创建文件资源 1 File file = New File("String Path" ...

  6. Xmem

    http://blog.csdn.net/jthink_/article/details/43302615

  7. BAT实习内推笔试卷(第一场)——个人答案以及分析

    第一题: 给定一个长度不小于2的数组arr. 写一个函数调整arr,使arr中要么全部的偶数位上都是偶数,要么全部的奇数位上都是奇数上. 要求:假设数组长度为N.时间复杂度请达到O(N),额外空间复杂 ...

  8. MySQL复制格式小结

    基于语句级的复制 binlog=statement   优点: (1)binlog文件较小. (2)日志是包含用户执行的原始SQL,方便统计和审计. (3)出现最早可binlog.兼容较好. (4)b ...

  9. 【u030】扑克牌

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 组合数学是数学的重要组成部分,是一门研究离散对象的科学,它主要研究满足一定条件的组态(也称组合模型)的 ...

  10. [Node.js] Identify memory leaks with nodejs-dashboard

    In this lesson, I introduce a memory leak into our node.js application and show you how to identify ...