... weakness. ASP. NET MVC doesn’t offer server controls of its own and also se-
verely limits the use of classic ASP. NET server controls. Even though you describe the view of
an ASP. NET MVC page via ASPX ... 2-12 shows the content of such a package.
Programming Microsoft
®
ASP. NET4
1
Part I
The ASP. NET Runtime
Environment
In this part:
Chapter 1: ASP. NET Web Forms Today . . . . . . . . . . . ... the Identity of the ASP. NET Process
. . . . . . . . . . . . . . . . . . 7 84
The Trust Level of ASP. NET Applications
. . . . . . . . . . . . . . . . . . . . . . . . 786
ASP. NET Authentication...
... Next.
vii
Contents
Introduction xiii
PART I ASP. NET MVC FUNDAMENTALS
Chapter 1 ASP. NET MVC controllers 3
Routing incoming requests 4
Simulating the ASP. NET MVC runtime 4
The URL routing HTTP ... invoking a page-agnostic URL in an ASP. NET Web Forms application.
4 PART I ASP. NET MVC fundamentals
Note This book is based on ASP. NET MVC 5. This version of ASP. NET MVC is backward
compatible ... 2 ASP. NET MVC views 33
The structure and behavior of a view engine 34
The mechanics of a view engine 34
Denition of the view template 39
HTML helpers 42
Basic helpers 43
Templated helpers 48
Custom...
... . . . . .3 34
Working with a Test Harness
335
Aspects of Testing
340
Testing Your ASP. NET MVC Code 345
Which Part of Your Code Should You Test?
345
Unit Testing ASP. NET MVC Code 348
Dealing ... .185
PART II ASP. NET MVC SOFTWARE DESIGN
Chapter 5 Aspects of ASP. NET MVC Applications 189
ASP. NET Intrinsic Objects 189
SEO and HTTP Response
190
Managing the Session State
193
Caching Data
1 94
Error ... role and structure of the controller—the foundation of
ASP. NET MVC applications—and how requests are routed to controllers.
Note This book is based on ASP. NET MVC 3. This version of ASP. NET MVC...
... MVC4
Entity Framework
Ánh ạ thự thể vào CSDL
EF API – giao tiếp lập tr nh EF
Xây dựg ứg dụg CRUD với mô hình Code-First
Truy vấ dữ liệu với linq
Tr nh bày hàng hóa
Tr nh ...
Hiể thị thông báo lỗi
Controller: phía server
Kiể lỗi hợp lệ dữ liệu
Kiể soát request giả
ThS. Nguyễn Nghiệm
0913. 745 .789
nghiemn@fpt.edu.vn
Phân trang hàng hóa
db.Products.ToList().Skip(10).Take(6); ... Guid.NewGuid());
Truy vấ hàng theo loại
db.Products.Where(p => p.CategoryId == CategoryId);
Truy vấ hàng theo nhà cung ấp
db.Products.Where(p => p.SupplierId == SupplierId);
Truy vấ...
... strip out nonalphanumeric
characters. Listing 4- 4 shows some code that does the trick.
LISTING 4- 4 Stripping Alphanumerics
protected string StripNonAlphanumerics(string str)
{
string strStripped ... String strControlText = this.Text;
String strTextToUpper = null;
strTextToUpper = Text.ToUpper();
strControlText =
this.StripNonAlphanumerics(strTextToUpper);
char[] rgcReverse = strControlText.ToCharArray();
... control—when ASP. NET fi nds literal text on the page, ASP. NET packages that
as a literal control. When it comes time for the page to render, ASP. NET walks the control list
and asks each control...
... control 34
2 .4. 10 ASP. NET server control 36
2 .4. 11 Các điều khiển đa năng khác 40
2 .4. 13 ASP. NET User Web control 42
2 .4. 13.1 Cấu tr c của User Control 42
2.1.13.2Tạo Web User Control: 42
2.5 Truy ... sự đem
40
Tìm hiểu Microsoft ASP. NET
Chúng ta đà xem sơ qua về vai tr của ASP. NET trong môi tr ng tích hợp với
hệ điều hành. Chúng ta cần nhìn ASP. NET ở một khía cạnh khác .ASP. NET khac
gì ... với ADO .NET 45
2.5 Mục đích thiết kế cho ADO .NET 45
2.5.1Giữ lại những hiểu biết về ADO 46
2.5.2 Hỗ tr mô hình lập tr nh N-Tier 46
2.5.3 Tích hợp với XML 46
2.5 .4 Cấu tr c của ADO .NET 46
2.5.5...
...
quick development of Web sites and applications (such as ASP, Microsoft Visual InterDev,
Dreamweaver, Java Server Pages, ASP. NET, and Microsoft Visual Studio), we’ve been pushed
into the AJAX ... AJAX
31
< ;asp: ScriptReference
Path="~/Scripts/MyFavoriteLib.js" />
</Scripts>
< /asp: ScriptManager>
You can reference script fi les, including ASP. NET AJAX system ... a hash string to the URL whenever the page moves to a
state that you want to track. A hash is a string appended to the URL prefi xed by a pound sign
(#) symbol. Here’s a sample AJAX-trackable...