没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Int
r
Vis
u
Rick
A
Summa
applicat
version
o
Catego
r
Applies
Source:
E-book
115 pag
r
o t
o
u
al
S
A
nders
o
ry: This tut
o
ion using
M
o
f Microso
f
r
y: Step-By
to: ASP.N
E
ASP.NET s
i
publicati
o
es
o
AS
P
S
tudi
o
o
n and
S
o
rial will te
M
icrosoft V
i
f
t Visual St
u
-Step
E
T MVC 4 B
te (link to
s
o
n date: M
a
P
.NE
T
o
(B
e
S
cott H
a
ach you th
e
i
sual Studi
o
u
dio.
eta, Visual
s
ource con
t
a
y 2012
T
M
V
e
ta)
a
nselm
a
e
basics of
o
11 Expres
s
Studio 11
B
t
ent)
V
C 4
w
a
n
building a
n
s
Beta for
W
B
eta
w
ith
n
ASP.NET
M
W
eb, which
M
VC Web
is a free
Copyright © 2012 by Microsoft Corporation
All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means
without the written permission of the publisher.
Microsoft and the trademarks listed at
http://www.microsoft.com/about/legal/en/us/IntellectualProperty/Trademarks/EN-US.aspx are trademarks of the
Microsoft group of companies. All other marks are property of their respective owners.
The example companies, organizations, products, domain names, email addresses, logos, people, places, and events
depicted herein are fictitious. No association with any real company, organization, product, domain name, email address,
logo, person, place, or event is intended or should be inferred.
This book expresses the author’s views and opinions. The information contained in this book is provided without any
express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will
be held liable for any damages caused or alleged to be caused either directly or indirectly by this book.
Contents
Getting Started ........................................................................................................................................ 3
What You'll Build ........................................................................................................................... 3
Skills You'll Learn ........................................................................................................................... 5
Getting Started .............................................................................................................................. 6
Creating Your First Application .................................................................................................... 7
Adding a Controller ............................................................................................................................ 13
Adding a View ..................................................................................................................................... 20
Changing Views and Layout Pages ............................................................................................ 25
Passing Data from the Controller to the View ........................................................................... 31
Adding a Model .................................................................................................................................. 37
Adding Model Classes................................................................................................................. 37
Creating a Connection String and Working with SQL Server LocalDB .................................... 41
Accessing Your Model's Data from a Controller ............................................................................... 43
Creating a Movie ......................................................................................................................... 46
Examining the Generated Code.................................................................................................. 48
Strongly Typed Models and the @model Keyword .................................................................. 49
Working with SQL Server LocalDB ............................................................................................. 53
Examining the Edit Methods and Edit View ...................................................................................... 58
Processing the POST Request ..................................................................................................... 65
Adding a Search Method and Search View ............................................................................... 67
Displaying the SearchIndex Form ............................................................................................... 67
Adding Search by Genre ............................................................................................................. 77
Adding Markup to the SearchIndex View to Support Search by Genre .................................. 79
Adding a New Field to the Movie Model and Table ......................................................................... 80
Adding a Rating Property to the Movie Model ......................................................................... 80
Managing Model and Database Schema Differences ............................................................... 82
Automatically Re-Creating the Database on Model Changes .................................................. 85
Adding Validation to the Model ........................................................................................................ 95
Keeping Things DRY .................................................................................................................... 95
Adding Validation Rules to the Movie Model ........................................................................... 95
Validation Error UI in ASP.NET MVC .......................................................................................... 97
How Validation Occurs in the Create View and Create Action Method ................................ 100
Adding Formatting to the Movie Model.................................................................................. 108
Examining the Details and Delete Methods .................................................................................... 111
Examining the Details and Delete Methods ............................................................................ 111
Wrapping Up ............................................................................................................................. 113
剩余117页未读,继续阅读
资源评论
- leon22202014-06-18英文看的累
- fjp05042012-10-14英文的哦,吃力啊
mocpac
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功