@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. 使用pprof及Go 程序的性能优化

    使用Golang 程序的性能优化及 Pprof 程序的性能优化无非就是对程序占用资源的优化.对于服务器而言,最重要的两项资源莫过于 CPU 和内存.性能优化,就是在对于不影响程序数据处理能力的情况下, ...

  2. [Git] Use git add --patch for better commit history and mitigating bugs

    Let's split our changes into separate commits. We'll be able to check over our changes before stagin ...

  3. 开发自己的PHP MVC框架(一)

    这个教程能够使大家掌握用mvc模式开发php应用的基本概念.此教程分为三个部分.如今这篇是第一部分. 如今市面上有非常多流行的框架供大家使用.可是我们也能够自己动手开发一个mvc框架.採用mvc模式能 ...

  4. linux 登录windows跳板机

    rdesktop -u 用户 -p 密码 ip -r sound:on/off -g 1200:830

  5. Redis数据存储解决方案

    http://www.tuicool.com/articles/77nUZn 1.背景 1.1 Redis简介 官方网站: http://redis.io/ ,Redis是REmote DIction ...

  6. 数组replaceObjectAtIndex

    执行replaceObjectAtIndex方法前提是_temp_Array必须是可变数组 [_temp_Array replaceObjectAtIndex:2 withObject:tempDat ...

  7. iOS 利用FZEasyFile本地保存 和 常规保存

    1.常规保存(较麻烦) NSFileManager *fileManager = [NSFileManager defaultManager]; //获取document路径,括号中属性为当前应用程序 ...

  8. 在C++ Builder6上使用Boost正则表达式库

    本文关键词:正则表达式 c++ python 软件 正则表达式是一种模式匹配形式,它通常用在处理的文本程序中.比如我们经常使用的grep工具,还是perl语言都使用了正则表达式. 正则表达式是一种模式 ...

  9. 如何用JS获取“ul”下边的“li”的个数

    <script type="text/javascript"> function OnbtnClick() { var txtCount=document.getEle ...

  10. HTML5 的成长之路

    html5历史 w3c从2008年提出html5的概念,目前html5的版本已经趋于稳定,也逐步得到了业界的认可和接受. 以前我们有一个疑问,HTML5与Flash究竟谁将在移动互联网时代称霸市场?这 ...