MVC基架生成的Create视图
@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视图的更多相关文章
- MVC基架生成的Index视图
@model IEnumerable<MyMusicStore.Models.Album> @{ ViewBag.Title = "Index"; } < ...
- MVC基架生成的 Details视图
@model MyMusicStore.Models.Album @{ ViewBag.Title = "Details"; } <h2>Details< ...
- MVC基架生成的Edit视图
@model MyMusicStore.Models.Album @{ ViewBag.Title = "Edit"; } <h2>Edit</h2> ...
- MVC基架生成的Detele视图
@model MyMusicStore.Models.Album @{ ViewBag.Title = "Delete"; } <h2>Delete</h ...
- MVC 基架不支持 Entity Framework 6 或更高版本
MVC 基架不支持 Entity Framework 6 或更高版本.有关详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=276833. PS:新做一个 ...
- MVC 基架不支持 Entity Framework 6 或更高版本 即 NuGet的几个小技巧
MVC 基架不支持 Entity Framework 6 或更高版本.有关详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=276833. 原因:mvc版 ...
- MVC之基架
参考 ASP.NET MVC5 高级编程(第5版) 定义: 通过对话框生成视图及控制器的模版,这个过程叫做“基架”. 基架可以为应用程序的创建.读取.更新和删除(CRUB)功能生成所需的样板代码.基架 ...
- 学习《ASP.NET MVC5高级编程》——基架
基架--代码生成的模板.我姑且这么去定义它,在我学习微软向编程之前从未听说过,比如php代码,大部分情况下是我用vim去手写而成,重复使用的代码需要复制粘贴,即使后来我在使用eclipse这样的IDE ...
- MVC 用基架创建Controller,通过数据库初始化器生成并播种数据库
1 创建MVC应用程序 2 在Model里面创建实体类 using System; using System.Collections.Generic; using System.Linq; using ...
随机推荐
- The trust relationship between this workstation and the primary domain failed(断网可以登进来)(正确的解决方式用管理员登进去 :退域再加域)
The trust relationship between this workstation and the primary domain failed(断网可以登进来)(正确的解决方式用管理员登进 ...
- Android 异步更新UI-线程池-Future-Handler实例分析
前言: 我们在开发Android过程中,在处理耗时任务和UI交互的过程中,都会将耗时任务放到子线程处理并刷新. 下面我提出的两个问题,相信大多数开发者都会碰到: 1. 数据经常需要读取更新,并且比较耗 ...
- [Node.js] Test Node RESTful API with Mocha and Chai
In this lesson, we will use Chai's request method to test our Node application's API responses.By th ...
- php课程 5-18 数组排序和合并拆分函数有哪些
php课程 5-18 数组排序和合并拆分函数有哪些 一.总结 一句话总结:分类来记.这些函数自己都可以写,费点时间而已. 1.array_combine()和array_merge()的区别是什 ...
- SRA解密报错:Data must start with zero
项目背景:要对打印地址进行加密,用公钥加密后会乱码需要base64 decode一下,但是在解密时报错:javax.crypto.BadPaddingException: Data must star ...
- ArcGIS 帮助文件中的CAD数据的说明
专业库——地理数据类型——cad
- 走进windows编程的世界-----窗体的注冊及创建
1 窗体注冊和创建 1.1WIN32 窗体程序创建步骤 1.WinMain入口函数的定义 2.WindowProc函数的定义 3.注冊窗体类 RegisterClass.RegisterClass ...
- SpringMVC拦截器-路径语法-略坑
项目中遇到一种场景,登录拦截器需要拦截.html后缀等动态请求,但是发现语法不对头. <mvc:interceptors> <mvc:interceptor> ...
- [SVG] Add an SVG as an Embedded Background Image
Learn how to set an elements background image to embedded SVG. This method has an added benefit of n ...
- mysql常用控制台命令
作者:朱金灿 来源:http://blog.csdn.net/clever101 1.登陆mysql,语法为:mysql -u[用户名] -p[密码],示例:mysql -uroot -p123456 ...