@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. [Git] How to rename your remote branch

    Rename your local foo branch with bar: git branch -m foo bar Remember this will add the new branch w ...

  2. iOS开发之Quzrtz2D 一:认识Quzrtz2D

    一:什么是Quzrtz2D 二:Quzrtz2D实例: 三:图形上下文 四:Quzrtz2D在ios开发中的实际价值 1.什么是Quartz2D? 他是一个二维的绘图引擎,同时支持iOS和Mac系统 ...

  3. php实现求扑克牌顺子(*****)(AC)(分类:把问题分小,利于排错)

    php实现求扑克牌顺子(*****)(AC)(分类:把问题分小,利于排错) 一.总结 分类(那就可以把问题分小而逐步完成每个板块,这样是很简单的) 分类还有助于查错 二.php实现求扑克牌顺子 题目描 ...

  4. 解决Centos7 下 root账号 远程连接FTP,vsftpd 提示 530 Login incorrect 问题

    原文:解决Centos7 下 root账号 远程连接FTP,vsftpd 提示 530 Login incorrect 问题 三步走: 1.vim /etc/vsftpd/user_list 注释掉 ...

  5. PHP移动互联网开发笔记(8)——MySQL数据库基础回顾[2]

    一.数据表 为了确保数据的完整性和一致性,在创建表时指定字段名称,字段类型和字段属性外,还需要使用约束(constraint),索引(index),主键(primary key)和外键(foregin ...

  6. js进阶 10-8 伪类选择器有哪几类(自己不用,永远不是自己的)

    js进阶 10-8 伪类选择器有哪几类(自己不用,永远不是自己的) 一.总结 一句话总结:自己不用,永远不是自己的. 0.学而不用,却是为何? 自己不用,永远不是自己的,有需求的时候要想到它,然后操作 ...

  7. 【机器学习实战】第9章 树回归(Tree Regression)

    第9章 树回归 <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/ ...

  8. SEO那些事:一句代码一键分享网站

    这是很久以前就已经写过的笔记了,有一个习惯,每次遇到一个问题,都会进行百度,然后把解决问题的关键点记录下来,有人问我,为什么更新频率如此之快,大部分都是从前积累的知识点. 其实每天工作所涉及的知识点都 ...

  9. erlang 符号相关基本语法

    http://blog.csdn.net/anghlq/article/details/6803332 ErLang语法约定: 大写字母开头的名字(比如Address),表示一个变量,包括参数.局部变 ...

  10. AndroidStudio一步步教你修改项目包名(最详细,最易懂)

    如果你看了很多篇博文还是修改不了包名,我相信这篇可以帮你解决修改包名的问题 修改项目包名,实现不覆盖安装(如果只是想不覆盖安装,更改build.gradle里面的包名就OK了,那这篇博文到这里就可以结 ...