@model MyMusicStore.Models.Album

@{

    ViewBag.Title = "Create";

}

<h2>Create</h2>

@using (Html.BeginForm()) 

{

    @Html.AntiForgeryToken()

    

    <div class="form-horizontal">

        <h4>Album</h4>

        <hr />

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

        <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="Create" class="btn btn-default" />

            </div>

        </div>

    </div>

}

<div>

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

</div>

@section Scripts {

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

}

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

  1. MVC基架生成的Index视图

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

  2. MVC基架生成的 Details视图

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

  3. MVC基架生成的Edit视图

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

  4. MVC基架生成的Detele视图

    @model MyMusicStore.Models.Album @{     ViewBag.Title = "Delete"; } <h2>Delete</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. 【Lucene4.8教程之五】Luke 2014-06-24 15:12 1092人阅读 评论(0) 收藏

    一.Luke基本内容 1.Luke简介 Luke可用于查看Lucene创建的索引,并对其进行基本操作. 2.创建Luke (1)从Github上下载源文件 https://github.com/tar ...

  2. 想要搞BGM,没有歌曲链接怎么办?

    有对于想要做个个人网站BGM,而非商业用途和非法用途,这只是个小技巧,仅限于个人娱乐使用. 方法一: 首先打开酷狗网页端 搜索想要的音乐名字 进入播放页面 进入开发者模式(右键鼠标->检查或者直 ...

  3. keepalived.conf 配置文件小结

    vrrp_script vs_mysql_82 {     script "/etc/keepalived/checkMySQL.py -h 192.168.11.82 -P 3306&qu ...

  4. css 父div如何包裹带有float属性的子div,float子div如何撑开父div

    来自网络摘抄 原始代码 <style> #div1{border:1px solid red;float:left;} #div2,#div3{float:right;border:1px ...

  5. JS和CSS压缩部署,提高访问效率

    一直想把项目中的js和css压缩下,今天终于搞定了. 先说说几个注意的问题,目标影响着你对应的解决办法:1.压缩后的文件,是否要直接覆盖旧的文件2. 单个压缩文件重命名,还是整个目录换个名字,同时文件 ...

  6. [Angular] Create a custom pipe

    For example we want to create a pipe, to tranform byte to Mb. We using it in html like: <div> ...

  7. .NET Core微服务之路:不断更新中的目录 (v0.43)

    原文:.NET Core微服务之路:不断更新中的目录 (v0.43) 微服务架构,对于从事JAVA架构的童鞋来说,早已不是什么新鲜的事儿,他们有鼎鼎大名的Spring Cloud这样的全家桶框架支撑, ...

  8. 学习JS的这些日子——十二月总结

    事实上非常想早就发表这篇十二月份的总结了,可是一直拖拖拉拉没有完毕.一直在想2015年都过去了,该不该再去 写这一篇2015年最后一个月的总结.还有就是2015年的年终总结能否够取代十二月的总结,后来 ...

  9. 【BZOJ 1016】[JSOI2008]最小生成树计数(搜索+克鲁斯卡尔)

    [题目链接]:http://www.lydsy.com/JudgeOnline/problem.php?id=1016 [题意] [题解] /* 两个最小生成树T和T'; 它们各个边权的边的数目肯定是 ...

  10. JS----checked----checked选中和未选中的获取

    , allValue.length - 1); allValue = allValue.replace(/[ ]/g, ""); var checkedIds = allValue ...