CHAPTER 1: GETTING STARTED WITH ASP.NET 4 1

Similar documents
Beginning ASP.NET. 4.5 in C# Matthew MacDonald

Developing Web Applications Using ASP.NET Duration:56 Hours

Course Outline: Course 10267A: Introduction to Web Development with Microsoft Visual Studio 2010 Learning Method: Instructor-led Classroom Learning

ASP.NET 3.5. In C# and VB. Beginning. Wrox Programmer to Programmer TM. Imar Spaanjaars

10267A CS: Developing Web Applications Using Microsoft Visual Studio 2010

Introduction to Web Development with Microsoft Visual Studio 2010

10267 Introduction to Web Development with Microsoft Visual Studio 2010

"Charting the Course... MOC A Introduction to Web Development with Microsoft Visual Studio Course Summary

COURSE OUTLINE: OD10267A Introduction to Web Development with Microsoft Visual Studio 2010

Introduction to Web Development with Microsoft Visual Studio 2010 (10267A)

DE Introduction to Web Development with Microsoft Visual Studio 2010

Microsoft ASP.NET Using Visual Basic 2008: Volume 1 Table of Contents

Introduction to Web Development with Microsoft Visual Studio 2010

Learn Well Technocraft

SOFTRONIICS Call:

"Charting the Course... SharePoint 2007 Hands-On Labs Course Summary

Microsoft Official Courseware Course Introduction to Web Development with Microsoft Visual Studio

Introduction 13. Feedback Downloading the sample files Problem resolution Typographical Conventions Used In This Book...

Course ID: 2310C Course Name: Developing Web Applications Using Microsoft Visual Studio 2008

Introduction... xxvii. Chapter 1: ASP.NET 4.5 Essentials... 1

CHAPTER 1: WHAT S NEW IN SHAREPOINT

COPYRIGHTED MATERIAL. Contents. Introduction. Chapter 1: Welcome to SQL Server Integration Services 1. Chapter 2: The SSIS Tools 21

ASP.NET 2.0 p. 1.NET Framework 2.0 p. 2 ASP.NET 2.0 p. 4 New Features p. 5 Special Folders Make Integration Easier p. 5 Security p.

IN PRACTICE. Daniele Bochicchio Stefano Mostarda Marco De Sanctis. Includes 106 practical techniques MANNING

COPYRIGHTED MATERIAL. Contents. Chapter 1: Introducing Microsoft Expression Web 1. Chapter 2: Building a Web Page 21. Acknowledgments Introduction

2310C VB - Developing Web Applications Using Microsoft Visual Studio 2008 Course Number: 2310C Course Length: 5 Days

Contents. Using Interpreters... 5 Using Compilers... 5 Program Development Life Cycle... 6

DE-2310 Developing Web Applications Using Microsoft Visual Studio 2008 SP1

Apex TG India Pvt. Ltd.

ASP.NET Web Forms Programming Using Visual Basic.NET

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio

DEVELOPING WEB APPLICATIONS WITH MICROSOFT VISUAL STUDIO Course: 10264A; Duration: 5 Days; Instructor-led

Developing Web Applications Using Microsoft Visual Studio 2008

Acknowledgments Introduction. Part I: Programming Access Applications 1. Chapter 1: Overview of Programming for Access 3

.NET-6Weeks Project Based Training

Developing Web Applications Using Microsoft Visual Studio 2008 SP1

Introduction. Part I: Silverlight Fundamentals for ASP.NET Developers 1

DOT NET Syllabus (6 Months)

COWLEY COLLEGE & Area Vocational Technical School

10264A CS: Developing Web Applications with Microsoft Visual Studio 2010

.NET FRAMEWORK. Visual C#.Net

Web Development with ASP.Net

Kathy Hughes. Microsoft* SharePoinf. Designer A MM g "Msift Mi*p\% 800 East 96th Street, Indianapolis, Indiana USA. v^lk.

CHAPTER 1: A QUICK TOUR 3

Audience: Experienced application developers or architects responsible for Web applications in a Microsoft environment.

Microsoft. Inside Microsoft. SharePoint Ted Pattison. Andrew Connell. Scot Hillier. David Mann

Pro ASP.NET MVC 2 Framework

Pro ASP.NET 4 in C# 2010

ASP.NET Using C# (VS2017)

Developing ASP.NET MVC 5 Web Applications. Course Outline

CHAPTER 1: INTRODUCTION TO THE IDE 3

COURSE OUTLINE MOC 20488: DEVELOPING MICROSOFT SHAREPOINT SERVER 2013 CORE SOLUTIONS

Developing ASP.Net MVC 4 Web Application

ASP.NET Training Course Duration. 30 Working days, daily one and half hours. ASP.NET Training Course Overview

Developing Microsoft SharePoint Server 2013 Core Solutions

COURSE 20486B: DEVELOPING ASP.NET MVC 4 WEB APPLICATIONS

Microsoft ASP.NET Whole Course Syllabus upto Developer Module (Including all three module Primary.NET + Advance Course Techniques+ Developer Tricks)

20486-Developing ASP.NET MVC 4 Web Applications

SharePoint 2010 Developer Core Skills Course Length: 5 days Price: $3,000

VB.NET. Exercise 1: Creating Your First Application in Visual Basic.NET

Developing ASP.NET MVC 4 Web Applications

Installing and Administering a Satellite Environment

C# Programming: From Problem Analysis to Program Design. Fourth Edition

SHAREPOINT 2013 DEVELOPMENT

Diploma in Microsoft.NET

20486: Developing ASP.NET MVC 4 Web Applications

DOT NET SYLLABUS FOR 6 MONTHS

SECURED PROGRAMMING IN.NET DETAILED TRAINING CONTENT INDUSTRIAL TRAINING PROGRAM ( )

Coding Faster: Getting More Productive with Microsoft Visual

1: ASP.NET AND JQUERY

--Microsoft-- --Windows Phone--

CHAPTER 1: VISUAL STUDIO

2559 : Introduction to Visual Basic.NET Programming with Microsoft.NET

20486: Developing ASP.NET MVC 4 Web Applications (5 Days)

Developing Microsoft SharePoint Server 2013 Core Solutions

Developing ASP.NET MVC 5 Web Applications

Developing ASP.NET MVC 5 Web Applications

COURSE 20488B: DEVELOPING MICROSOFT SHAREPOINT SERVER 2013 CORE SOLUTIONS

Course 20486B: Developing ASP.NET MVC 4 Web Applications

Course 20488A: Developing Microsoft SharePoint Server 2013 Core Solutions

M Introduction to Visual Basic.NET Programming with Microsoft.NET 5 Day Course

Developing ASP.NET MVC 4 Web Applications

Visual Studio Course Developing ASP.NET MVC 5 Web Applications

Chapter 1: Introducing SQL Server

ALPHAPRIMETECH 112 New South Road, Hicksville, NY 11801

COPYRIGHTED MATERIAL. Contents. Part One: Team Architect 1. Chapter 1: Introducing the Visual Designers 3

ASP.NET MVC Training

20486 Developing ASP.NET MVC 5 Web Applications

Developing Microsoft SharePoint Server 2013 Core Solutions

Programming Microsoft's Clouds

ASP.NET Using C# (VS2013)

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

COURSE OUTLINE MOC 20480: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

CHAPTER 1: INTRODUCING C# 3

Microsoft Developing ASP.NET MVC 4 Web Applications

MS 20488: Developing Microsoft SharePoint Server 2013 Core Solutions Duration: 5 Days Method: Instructor-Led

Planning and Designing Your Site p. 109 Design Concepts p. 116 Summary p. 118 Defining Your Site p. 119 The Files Panel p. 119 Accessing Your Remote

Certified ASP.NET Programmer VS-1025

Developing Microsoft SharePoint Server 2013 Core Solutions

SharePoint 20488: Developing Microsoft SharePoint Server 2013 Core Solutions. Upcoming Dates. Course Description. Course Outline

Transcription:

FOREWORD INTRODUCTION xxv xxvii CHAPTER 1: GETTING STARTED WITH ASP.NET 4 1 Microsoft Visual Web Developer 2 Getting Visual Web Developer 3 Installing Visual Web Developer Express 3 Creating Your First ASP.NET 4 Web Site 5 An Introduction to ASP.NET 4 9 Understanding HTML 10 A First Look at ASP.NET Markup 14 A Tour of the IDE 15 The Main Development Area 15 Informational Windows 21 Customizing the IDE 22 Rearranging Windows 22 Modifying the Toolbox 23 Customizing the Document Window 25 Customizing Toolbars 26 Customizing Keyboard Shortcuts 26 Resetting Your Changes 27 The Sample Application 27 Practical Tips on Visual Web Developer 29 Summary 30 CHAPTER 2: BUILDING AN ASP.NET WEB SITE 33 COPYRIGHTED MATERIAL Creating Web Sites with VWD 2010 34 Different Project Types 34 Choosing the Right Web Site Template 35 Creating and Opening a New Web Site 37 Working with Files in Your Web Site 40 The Many File Types of an ASP.NET 4 Web Site 40 Adding Existing Files 44 Organizing Your Site 46 Special File Types 47

Working with Web Forms 47 The Different Views on Web Forms 47 Choosing between Code Behind and Pages with Inline Code 49 Adding Markup to Your Page 54 Connecting Pages 60 Practical Tips on Working with Web Forms 62 Summary 63 CHAPTER 3: DESIGNING YOUR WEB PAGES 65 Why Do You Need CSS? 66 Problems of HTML Formatting 66 How CSS Fixes Formatting Problems 67 An Introduction to CSS 68 CSS The Language 71 The Style Sheet 72 Adding CSS to Your Pages 84 Working with CSS in Visual Web Developer 87 Creating New Styles in External Style Sheets 87 Creating Embedded and Inline Style Sheets 92 Applying Styles 98 Managing Styles 99 Practical Tips on Working with CSS 102 Summary 103 CHAPTER 4: WORKING WITH ASP.NET SERVER CONTROLS 105 Introduction to Server Controls 106 A Closer Look at ASP.NET Server Controls 110 Defi ning Controls in Your Pages 110 Common Properties for All Controls 110 Types of Controls 113 Standard Controls 113 HTML Controls 126 Data Controls 127 Validation Controls 127 Navigation Controls 127 Login Controls 127 Ajax Extensions 127 WebParts 128 Dynamic Data 128 xvi

The ASP.NET State Engine 128 What Is State and Why Is It Important? 128 How the State Engine Works 129 Not All Controls Rely on View State 133 A Note about View State and Performance 134 Practical Tips on Working with Controls 135 Summary 136 CHAPTER 5: PROGRAMMING YOUR ASP.NET WEB PAGES 139 Introduction to Programming 140 Data Types and Variables 141 Converting and Casting Data Types 144 Using Arrays and Collections 146 Statements 151 Operators 152 Making Decisions 159 Loops 166 Organizing Code 170 Methods: Functions and Subroutines 170 The App_Code Folder 172 Organizing Code with Namespaces 176 Writing Comments 179 Object Orientation Basics 181 Important OO Terminology 182 Events 192 Practical Tips on Programming 194 Summary 195 CHAPTER 6: CREATING CONSISTENT LOOKING WEB SITES 197 Consistent Page Layout with Master Pages 198 Creating Master Pages 200 Creating Content Pages 201 Using a Centralized Base Page 207 An Introduction to the ASP.NET Page Life Cycle 208 Implementing the Base Page 210 Creating Reusable Page Templates 214 Themes 218 Different Types of Themes 219 Choosing Between Theme and StyleSheetTheme 219 Applying Themes 220 Extending Themes 224 Dynamically Switching Themes 226 xvii

Skins 232 Creating a Skin File 233 Named Skins 235 Disable Theming for Specific Controls 236 Practical Tips on Creating Consistent Pages 236 Summary 237 CHAPTER 7: NAVIGATION 239 Different Ways to Move around Your Site 240 Understanding Absolute and Relative URLs 240 Understanding Default Documents 244 Using the Navigation Controls 245 Architecture of the Navigation Controls 245 Examining the Web.sitemap File 246 Using the Menu Control 248 Using the TreeView Control 257 Using the SiteMapPath Control 261 Programmatic Redirection 263 Programmatically Redirecting the Client to a Different Page 263 Server-Side Redirects 266 Practical Tips on Navigation 268 Summary 269 CHAPTER 8: USER CONTROLS 271 Introduction to User Controls 272 Creating User Controls 272 Adding User Controls to a Content Page or Master Page 276 Site-Wide Registration of User Controls 279 User Control Caveats 280 Adding Logic to Your User Controls 282 Creating Your Own Data Types for Properties 283 Implementing View State Properties 288 View State Considerations 294 Practical Tips on User Controls 294 Summary 295 CHAPTER 9: VALIDATING USER INPUT 297 Gathering Data from the User 298 Validating User Input in Web Forms 299 Understanding Request Validation 316 xviii

Processing Data at the Server 316 Sending E-mail from Your Web Site 317 Reading from Text Files 322 Practical Tips on Validating Data 328 Summary 329 CHAPTER 10: ASP.NET AJAX 331 Introducing Ajax 332 Using ASP.NET AJAX in Your Projects 334 Creating Flicker-Free Pages 334 Providing Feedback to Users 340 The Timer Control 345 Using Web Services and Page Methods in Ajax Web Sites 346 What Are Web Services? 346 Creating Web Services 347 Using Web Services in Your Ajax Web Site 351 Introducing Page Methods 358 The Client-Side ASP.NET AJAX Library 361 This Is Just the Beginning 362 Practical Ajax Tips 363 Summary 364 CHAPTER 11: JQUERY 367 An Introduction to jquery 368 Choosing the Location for Your jquery Reference 368 Different Ways to Include the jquery Library 369 jquery Syntax 373 jquery Core 374 Selecting Items Using jquery 374 Modifying the DOM with jquery 382 CSS Methods 382 Handling Events 383 Miscellaneous jquery Functionality 385 Common Mistakes When Working with jquery 386 Effects with jquery 391 jquery and Extensibility 396 Practical Tips on jquery 400 Summary 401 xix

CHAPTER 12: INTRODUCING DATABASES 403 What Is a Database? 404 Different Kinds of Relational Databases 405 Using SQL to Work with Database Data 405 Retrieving and Manipulating Data with SQL 407 Reading Data 408 Creating Data 417 Updating Data 418 Deleting Data 418 Creating Your Own Tables 421 Data Types in SQL Server 421 Understanding Primary Keys and Identities 422 Creating Relationships Between Tables 426 Practical Database Tips 430 Summary 431 CHAPTER 13: DISPLAYING AND UPDATING DATA 433 Data Controls 433 Data-bound Controls 434 Data Source Controls 435 Other Data Controls 436 Data Source and Data-bound Controls Working Together 436 Displaying and Editing Data with GridView 436 Inserting Data with DetailsView 442 Storing Your Connection Strings in web.confi g 445 Filtering Data 446 Customizing the Appearance of the Data Controls 452 Confi guring Columns or Fields of Data-bound Controls 453 Updating and Inserting Data 459 Using DetailsView to Insert and Update Data 459 Practical Tips for Displaying and Updating Data 473 Summary 474 CHAPTER 14: LINQ AND THE ADO.NET ENTITY FRAMEWORK 477 Introducing LINQ 478 LINQ to Objects 479 LINQ to XML 479 LINQ to ADO.NET 479 Introducing the ADO.NET Entity Framework 480 Mapping Your Data Model to an Object Model 481 xx

Introducing Query Syntax 487 Standard Query Operators 487 Shaping Data with Anonymous Types 491 Using Server Controls with LINQ Queries 496 Using Data Controls with the Entity Framework 496 A Few Notes about Performance 526 Practical LINQ and ADO.NET Entity Framework Tips 526 Summary 527 CHAPTER 15: WORKING WITH DATA ADVANCED TOPICS 529 Formatting Your Controls Using Styles 530 An Introduction to Styles 531 Combining Styles, Themes, and Skins 535 Handling Events 539 The ASP.NET Page and Control Life Cycles Revisited 540 The ASP.NET Page Life Cycle and Events in Data Controls 545 Handling Errors that Occur in the Data Source Controls 550 Hand-Coding Data Access Code 554 Caching 565 Common Pitfalls with Caching Data 565 Different Ways to Cache Data in ASP.NET Web Applications 566 Practical Data Tips 575 Summary 576 CHAPTER 16: SECURITY IN YOUR ASP.NET 4 WEB SITE 579 Introducing Security 580 Identity: Who Are You? 580 Authentication: How Can You Prove Who You Are? 580 Authorization: What Are You Allowed to Do? 580 An Introduction to the ASP.NET Application Services 581 Introducing the Login Controls 582 The Login Controls 587 Confi guring Your Web Application 599 The Role Manager 603 Confi guring the Role Manager 603 Managing Users with the WSAT 604 Confi guring the Web Application to Work with Roles 608 Programmatically Checking Roles 612 Practical Security Tips 616 Summary 617 xxi

CHAPTER 17: PERSONALIZING WEB SITES 619 Understanding Profile 620 Confi guring the Profi le 621 Using the Profi le 627 Other Ways of Dealing with Profile 645 Anonymous Identification 645 Cleaning Up Old Anonymous Profi les 646 Looking at Other Users Profi les 648 Practical Personalization Tips 651 Summary 651 CHAPTER 18: EXCEPTION HANDLING, DEBUGGING, AND TRACING 655 Exception Handling 656 Different Types of Errors 656 Catching and Handling Exceptions 658 Global Error Handling and Custom Error Pages 666 The Basics of Debugging 673 Tools Support for Debugging 677 Moving around in Debugged Code 677 Debugging Windows 677 Debugging Client-Side Script 684 Tracing Your ASP.NET Web Pages 688 Using the Standard Tracing Capabilities 688 Adding Your Own Information to the Trace 691 Tracing and Performance 694 A Security Warning 694 Practical Debugging Tips 694 Summary 695 CHAPTER 19: DEPLOYING YOUR WEB SITE 697 Preparing Your Web Site for Deployment 698 Avoiding Hardcoded Settings 698 The web.confi g File 699 Expression Syntax 699 The WebConfi gurationmanager Class 700 Copying Your Web Site 706 Creating a Simple Copy of Your Web Site 707 Publishing Your Web Site 709 xxii

Running Your Site under IIS 710 Installing and Confi guring the Web Server 711 Installing and Confi guring ASP.NET 714 Understanding Security in IIS 717 NTFS Settings for Planet Wrox 718 Troubleshooting Web Server Errors 721 Moving Data to a Remote Server 723 Using the Database Publishing Wizard 723 Recreating the Database 725 The Deployment Checklist 727 What s Next 728 Summary 729 APPENDIX A: EXERCISE ANSWERS 731 Chapter 1 731 Chapter 2 732 Chapter 3 733 Chapter 4 734 Chapter 5 735 Chapter 6 736 Chapter 7 737 Chapter 8 738 Chapter 9 739 Chapter 10 741 Chapter 11 743 Chapter 12 744 Chapter 13 745 Chapter 14 746 Chapter 15 749 Chapter 16 751 Chapter 17 752 Chapter 18 754 APPENDIX B: CONFIGURING SQL SERVER 2008 757 Configuring SQL Server 2008 757 Terminology and Concepts 758 Using SQL Server Management Studio 759 Enabling Remote Connections in SQL Server 760 Connecting Your Application to SQL Server 2008 764 xxiii

Configuring Application Services 771 Confi guring Your Database for the Application Services 771 Overriding the LocalSqlServer Connection String 773 Overriding the Settings of the Application Services 773 INDEX 777 xxiv