没有合适的资源?快使用搜索试试~ 我知道了~
首页ASP.NET 4.0入门教程:权威指南
"ASP.NET 4.0 完整教程,权威技术指南,适合初学者"
在本书《 Beginning ASP.NET 4 in C# 2010》中,作者Matthew MacDonald详细介绍了ASP.NET 4.0框架的基础知识和核心技术,旨在帮助开发者开始构建ASP.NET网站的旅程。这本书专为那些希望深入理解ASP.NET 4.0的初学者设计,提供了丰富的实践指导和理论讲解。
ASP.NET 4.0是微软.NET Framework的一个重要组成部分,它为Web开发提供了一个强大的平台。此版本引入了许多新特性和改进,包括:
1. **增强的性能**:ASP.NET 4.0通过优化内部工作方式提升了运行时性能,减少了服务器资源的消耗,从而提高了网站的响应速度。
2. **更强大的MVC(Model-View-Controller)框架**:ASP.NET MVC 2与ASP.NET 4.0一起发布,提供了一种更清晰的分离关注点的方法,让开发者能更好地进行测试驱动开发(TDD)。
3. **Web Forms改进**:Web Forms是ASP.NET的核心部分,4.0版本对其进行了许多改进,如控件生命周期的简化、动态数据支持以及更灵活的页面布局。
4. **动态数据(Dynamic Data)**:ASP.NET 4.0引入了动态数据功能,允许快速创建数据驱动的网站,无需编写大量代码即可实现数据验证和UI绑定。
5. **简化部署**:引入了Web Deploy工具,使得部署ASP.NET应用程序变得更加简单和高效。
6. **配置管理**:ASP.NET 4.0的配置系统更加灵活,可以针对不同的环境设置不同的配置,便于在开发、测试和生产环境间切换。
7. **AJAX支持**:ASP.NET 4.0增强了AJAX功能,提供了更多的客户端库和更新的jQuery版本,使开发者能够轻松构建富交互式的Web应用。
8. **编程模型的增强**:包括更强的代码隐藏类,更灵活的页面生命周期,以及更方便的数据绑定机制,如Lambda表达式和LINQ支持。
9. **安全性改进**:增加了对ASP.NET请求验证、跨站脚本攻击(XSS)防护以及跨站请求伪造(CSRF)防护的支持。
10. **全球化与本地化**:ASP.NET 4.0在处理多语言和文化环境方面做了加强,让开发者更容易实现全球化应用。
通过阅读本书,读者将逐步学习如何使用C#语言和ASP.NET 4.0框架来创建功能丰富的Web应用程序,包括如何设计用户界面、处理用户输入、实现数据访问和交互、优化性能以及确保应用程序的安全性。书中包含的实际示例和练习将帮助读者掌握理论知识并将其转化为实践经验。

■ CONTENTS
xiv
Applying Style Sheet Rules.................................................................................................................380
Themes ........................................................................................................................383
How Themes Work .............................................................................................................................383
Applying a Simple Theme...................................................................................................................385
Handling Theme Conflicts...................................................................................................................386
Creating Multiple Skins for the Same Control ....................................................................................388
More Advanced Skins.........................................................................................................................389
Master Page Basics .....................................................................................................391
A Simple Master Page and Content Page ...........................................................................................392
How Master Pages and Content Pages Are Connected ......................................................................396
A Master Page with Multiple Content Regions ...................................................................................398
Default Content...................................................................................................................................401
Master Pages and Relative Paths .......................................................................................................402
Advanced Master Pages ..............................................................................................403
Style-Based Layouts...........................................................................................................................403
Code in a Master Page........................................................................................................................408
Interacting with a Master Page Programmatically .............................................................................409
The Last Word..............................................................................................................410
■ Chapter 13: Website Navigation.......................................................................411
Site Maps.....................................................................................................................411
Defining a Site Map ............................................................................................................................412
Seeing a Simple Site Map in Action....................................................................................................416
Binding an Ordinary Page to a Site Map.............................................................................................416
Binding a Master Page to a Site Map .................................................................................................418
Binding Portions of a Site Map ...........................................................................................................420
The SiteMap Class ..............................................................................................................................425
URL Mapping and Routing ...........................................................................................427
URL Mapping ......................................................................................................................................428
URL Routing........................................................................................................................................428

■ CONTENTS
xv
The SiteMapPath Control .............................................................................................430
Customizing the SiteMapPath ............................................................................................................431
Using SiteMapPath Styles and Templates..........................................................................................432
Adding Custom Site Map Information.................................................................................................434
The TreeView Control...................................................................................................435
TreeView Properties ...........................................................................................................................436
TreeView Styles ..................................................................................................................................438
The Menu Control ........................................................................................................442
Menu Styles........................................................................................................................................444
Menu Templates.................................................................................................................................445
The Last Word..............................................................................................................448
Part 4: Working with Data ....................................................................................449
■ Chapter 14: ADO.NET Fundamentals ................................................................451
Understanding Databases............................................................................................451
Configuring Your Database ..........................................................................................453
SQL Server Express ............................................................................................................................453
Browsing and Modifying Databases in Visual Studio .........................................................................454
The sqlcmd Command-Line Tool........................................................................................................457
SQL Basics...................................................................................................................458
Running Queries in Visual Studio .......................................................................................................459
The Select Statement .........................................................................................................................461
The SQL Update Statement.................................................................................................................463
The SQL Insert Statement...................................................................................................................465
The SQL Delete Statement..................................................................................................................465
The Data Provider Model .............................................................................................466
Direct Data Access ......................................................................................................467
Creating a Connection ........................................................................................................................469
The Select Command .........................................................................................................................475
The DataReader..................................................................................................................................476

■ CONTENTS
xvi
Putting It All Together.........................................................................................................................476
Updating Data.....................................................................................................................................481
Disconnected Data Access ..........................................................................................491
Selecting Disconnected Data..............................................................................................................492
Selecting Multiple Tables ...................................................................................................................494
Defining Relationships........................................................................................................................495
The Last Word..............................................................................................................498
■ Chapter 15: Data Binding .................................................................................499
Introducing Data Binding .............................................................................................499
Types of ASP.NET Data Binding..........................................................................................................500
How Data Binding Works....................................................................................................................500
Single-Value Data Binding ...........................................................................................500
A Simple Data Binding Example .........................................................................................................501
Simple Data Binding with Properties..................................................................................................504
Problems with Single-Value Data Binding..........................................................................................505
Using Code Instead of Simple Data Binding .......................................................................................506
Repeated-Value Data Binding......................................................................................506
Data Binding with Simple List Controls ..............................................................................................507
A Simple List Binding Example...........................................................................................................508
Strongly Typed Collections .................................................................................................................509
Multiple Binding..................................................................................................................................510
Data Binding with a Dictionary Collection ..........................................................................................512
Using the DataValueField Property .....................................................................................................513
Data Binding with ADO.NET ................................................................................................................514
Creating a Record Editor.....................................................................................................................516
Data Source Controls...................................................................................................521
The Page Life Cycle with Data Binding...............................................................................................523
The SqlDataSource .............................................................................................................................523
Selecting Records...............................................................................................................................525
Parameterized Commands .................................................................................................................527

■ CONTENTS
xvii
Handling Errors...................................................................................................................................532
Updating Records ...............................................................................................................................533
The Last Word..............................................................................................................537
■ Chapter 16: The Data Controls .........................................................................539
The GridView................................................................................................................539
Automatically Generating Columns ....................................................................................................540
Defining Columns ...............................................................................................................................542
Formatting the GridView..............................................................................................546
Formatting Fields................................................................................................................................546
Using Styles........................................................................................................................................547
Formatting-Specific Values ................................................................................................................550
Selecting a GridView Row............................................................................................552
Adding a Select Button .......................................................................................................................553
Using Selection to Create Master-Details Pages ................................................................................554
Editing with the GridView ............................................................................................556
Sorting and Paging the GridView.................................................................................559
Sorting ................................................................................................................................................559
Paging.................................................................................................................................................561
Using GridView Templates...........................................................................................563
Using Multiple Templates ...................................................................................................................565
Editing Templates in Visual Studio .....................................................................................................566
Handling Events in a Template ...........................................................................................................567
Editing with a Template......................................................................................................................568
The DetailsView and FormView ...................................................................................573
The DetailsView ..................................................................................................................................573
The FormView.....................................................................................................................................575
The Last Word..............................................................................................................578
■ Chapter 17: Files and Streams.........................................................................579
Files and Web Applications..........................................................................................579

■ CONTENTS
xviii
File System Information...............................................................................................580
The Path Class....................................................................................................................................581
The Directory and File Classes ...........................................................................................................582
The DirectoryInfo and FileInfo Classes ...............................................................................................587
The DriveInfo Class.............................................................................................................................589
A Sample File Browser .......................................................................................................................590
Reading and Writing with Streams..............................................................................594
Text Files ............................................................................................................................................594
Binary Files.........................................................................................................................................596
Shortcuts for Reading and Writing Files.............................................................................................597
A Simple Guest Book ..........................................................................................................................598
Allowing File Uploads ..................................................................................................604
The FileUpload Control .......................................................................................................................604
The Last Word..............................................................................................................607
■ Chapter 18: XML...............................................................................................609
XML Explained .............................................................................................................609
Improving the List with XML...............................................................................................................611
XML Basics .........................................................................................................................................612
Attributes............................................................................................................................................613
Comments ..........................................................................................................................................614
The XML Classes..........................................................................................................615
The XML TextWriter ............................................................................................................................615
The XML Text Reader..........................................................................................................................618
Working with XML Documents in Memory .........................................................................................623
Reading an XML Document ................................................................................................................628
Searching an XML Document .............................................................................................................631
XML Validation.............................................................................................................632
XML Namespaces ...............................................................................................................................632
XML Schema Definition ......................................................................................................................635
Validating an XML Document..............................................................................................................637
剩余1016页未读,继续阅读
103 浏览量
812 浏览量
点击了解资源详情
103 浏览量
220 浏览量
812 浏览量

xiaoshan_33
- 粉丝: 19
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

最新资源
- 深入探讨RBAC权限管理数据库表的设计
- Netty权威指南第二版:电子书带源码的Java网络编程教程
- GBPNotify:Python编写的货币转换通知Bot
- 基于SSM框架的税务管理系统设计与实现
- 探索MySQLFront:高效操作MySQL数据库的图形化工具
- Arduino旋钮编码器库:实现旋转输入控制
- Sublime Text Python插件安装与右键集成指南
- RobotHelper: 专为Android游戏开发的自动化框架
- C#图书在线销售系统实现与实用体验
- 学生信息管理系统的开发与应用
- Shiro与SpringBoot整合实现iHRM系统认证授权
- 深入探讨JavaScript应用的开发实践
- Apropos:简化响应式图像自动化的开源工具
- WCF经典实例手册:深入理解与应用
- CKEditor与CKFinder整合:自定义文件上传及域名路径设置
- Python坦克大战游戏音乐素材包下载
安全验证
文档复制为VIP权益,开通VIP直接复制
