Home Page Icon
Home Page
Table of Contents for
I. Overview of ASP.NET 3.5
Close
I. Overview of ASP.NET 3.5
by Scott Mitchell
Sams Teach Yourself ASP.NET 3.5 in 24 Hours, Complete Starter Kit
Copyright
Dedication
About the Author
Acknowledgments
We Want to Hear from You!
Reader Services
Introduction
Audience and Organization
Conventions Used in This Book
I. Overview of ASP.NET 3.5
1. Getting Started with ASP.NET 3.5
What Is ASP.NET?
Serving Static Web Pages
Serving Dynamic Web Pages
Hosting ASP.NET Web Pages
Develop Locally, Deploy to a Web Host
Installing the ASP.NET Engine, Editor, and Database System
A Brief Tour of Visual Web Developer
Creating a New ASP.NET Website
Creating and Testing a Simple ASP.NET Web Page
Summary
Q&A
Workshop
Quiz
Answers
Exercises
2. Understanding the ASP.NET Programming Model
Examining the HTML Portion of an ASP.NET Web Page
A Brief HTML Primer
Extraneous Whitespace
Nested Tags
Creating the HTML Portion of an ASP.NET Web Page Using Visual Web Developer
Editing the HTML Content Using the Designer
Examining the HTML Content
Examining the Source Code Portion of an ASP.NET Web Page
A Quick Object-Oriented Programming Primer
Examining Event-Driven Programming
Out-of-Order Execution
Event Handlers in ASP.NET
Programmatically Working with Web Controls
Summary
Q&A
Workshop
Quiz
Answers
Exercises
3. Using Visual Web Developer
Creating a New Website
Choosing a Website Template
Specifying the Website’s Location
Choosing the Source Code Programming Language
Opening Existing Websites
Working with Web Pages and Other Content
Adding Content to Your Website
Adding Existing Content
Moving, Renaming, and Deleting Content
Customizing the Visual Web Developer Experience
Viewing, Moving, and Resizing Windows
A World of Help at Your Fingertips
Summary
Q&A
Workshop
Quiz
Answers
Exercise
4. Designing, Creating, and Testing ASP.NET Web Pages
Specifying the Design Requirements
Formulating the Features for Our Financial Calculator
Deciding on the User Interface
Creating the User Interface
Adding the Three TextBox Web Controls
Adding the Compute Monthly Cost Button
Creating a Label Web Control for the Output
Writing the Source Code for the ASP.NET Web Page
Reading the Values in the TextBox Web Controls
The Complete Source Code
Testing the Financial Calculator
Viewing the Rendered Source Code
Testing Erroneous Input
Examining the Source Code
Using the Debugger
Summary
Q&A
Workshop
Quiz
Answers
Exercises
5. Understanding Visual Basic’s Variables and Operators
The Purpose of Programming Languages
Concepts Common to All Programming Languages
Declaring and Using Variables
Assigning Values to Variables
Declaring a Variable
Rules for Naming Variables
Examining Variable Data Types
Integer Types
Nonintegral Numeric Types
Boolean Data Types
String Types
Date Types
The Object Type
Examining the Dim Statement
Performing Assignment When Declaring a Variable
Examining Visual Basic’s Operators
Arithmetic Operators
Exploring the Comparison Operators
Understanding the Concatenation Operator
Visual Basic’s Assignment Operators
Shorthand Versions for Common Assignments
Learning Visual Basic’s Type Rules
Understanding Casting
Widening and Narrowing Casts
Rules for Implicit Casting
Summary
Q&A
Workshop
Quiz
Answers
Exercises
6. Managing Program Flow with Visual Basic’s Control Structures
Understanding Control Structures
Exploring the Conditional Control Structure
Executing Instructions If the Conditional Is False
Performing Another If Statement When the Condition Is False
Working with Visual Basic’s Looping Control Structures
Using For ... Next Loops
Do ... Loop Loops
Exploring the Modularizing Control Structures: Subroutines and Functions
Reducing Code Redundancy Using Subroutines and Functions
Passing in Parameters to a Subroutine or Function
Returning Values with Functions
Where Do Event Handlers Fit In?
Summary
Q&A
Workshop
Quiz
Answers
Exercises
7. Working with Objects in Visual Basic
Reexamining the Role of Classes and Objects
The Role of Objects in an ASP.NET Web Application
The Four Common Tasks Performed with Objects
Creating an Object
Constructors with Parameters
Setting an Object’s Properties
Calling an Object’s Methods
Creating Event Handlers for an Object’s Events
Summary
Q&A
Workshop
Quiz
Answers
Exercises
8. ASP.NET Web Controls for Displaying Text
Examining the Web Controls Designed for Displaying Text
Using the Literal Web Control
Setting the Literal Control’s Text Property Programmatically
Using the Label Web Control
Examining the Formatting Properties of the Label Web Control
Looking at the Color Properties
Examining the Border Properties
Delving into the Font Properties
The Miscellaneous Properties
Summary
Q&A
Workshop
Quiz
Answers
Exercises
II. Collecting and Processing User Input
9. Web Form Basics
Gathering User Input in an HTML Web Page
Examining the <input> HTML Element
Passing the Input Back to the Web Server Using the <form> Element
Comparing Postback Forms and Redirect Forms
Dissecting ASP.NET Web Forms
Adding Web Controls to Collect User Input
Testing the BMICalculator.aspx ASP.NET Page
Web Forms Remember the Values the Users Enter
Writing the Code for BMICalculator.aspx
Summary
Q&A
Workshop
Quiz
Answers
Exercises
10. Using Text Boxes to Collect Input
Learning About the TextBox Web Control Basics
Performing an Action When the User Submits the Form
Creating Multiline and Password Text Boxes
Using Multiline Text Boxes
Using Password Text Boxes
Password Text Box Values Are Not Continued Across Postbacks
Examining the TextBox Web Control’s Properties
Specifying the Length of a Text Box
Limiting the Number of Characters a User Can Enter into a Text Box
Aesthetic Properties—Changing the Text Box’s Font and Color
Summary
Q&A
Workshop
Quiz
Answers
Exercises
11. Collecting Input Using Drop-Down Lists, Radio Buttons, and Check Boxes
Examining the Different Types of User Input Classifications
Using an Appropriate Web Control
Examining the DropDownList Web Control
Adding Options to the DropDownList Web Control
Adding a DropDownList Web Control to an ASP.NET Web Page
The DropDownList Web Control’s Formatting Properties
Selecting One Option from a List of Suitable Choices with RadioButton Web Controls
Using the Text and GroupName Properties
Determining What RadioButton Web Control Was Selected
A Look at the Formatting Properties
Using the CheckBox Web Control
Determining What Check Boxes Have Been Checked
Summary
Q&A
Workshop
Quiz
Answers
Exercises
12. Validating User Input with Validation Controls
Examining the Need for User Input Validation
Types of Input Validation
Required Field Input Validation
Data Type Validation
Range Input Validation
Comparison Validation
Pattern Validation
Validating User Input in an ASP.NET Web Page
An ASP.NET Web Page for Examining the Validation Controls
Examining the RequiredFieldValidator Validation Control
Specifying What Web Control the Validation Web Control Is Validating
Specifying What Error Message to Display for Invalid Input
Testing the ASP.NET Page
Client-Side and Server-Side Validation
Programmatically Determining Whether the User’s Input Is Valid
Summarizing the Basic Validation Control Features
Examining the CompareValidator
Using the CompareValidator to Compare One Input to Another
Using the RangeValidator
Validating Input with the RegularExpressionValidator
Formatting Properties for the Validation Web Controls
A Look at the Remaining Validation Controls
Summary
Q&A
Workshop
Quiz
Answers
Exercises
III. Working with Databases
13. An Introduction to Databases
Examining Database Fundamentals
A Look at Current Database Systems
Storing Structured Data
Examining a Table’s Columns
Primary Key Columns
Creating a New Database
Creating Database Tables
A Discussion on Database Design
Uniquely Identifying Each Record
Modeling a System’s Logical Entities as Related Tables
Adding Data to the Books Table
Summary
Q&A
Workshop
Quiz
Answers
Exercises
14. Accessing Data with the Data Source Web Controls
Examining the Data Source Controls
Working with the SqlDataSource Control
Step 1: Choose Your Data Connection
Step 2: Configure the Select Statement
Step 3: Test the Query
Examining the SqlDataSource Control’s Markup
A Look at SQL, the Language of Databases
Delving into the SQL SELECT Statement
Viewing SQL Queries Results in Visual Web Developer
Restricting Returned Rows Using the WHERE Clause
Understanding What Happens When a WHERE Clause Is Present
Ordering the Results Using the ORDER BY Clause
Sorting in Ascending and Descending Order
Filtering and Sorting Data from the SqlDataSource Control’s Wizard
Filtering the SqlDataSource Control’s Data
Sorting the SqlDataSource Control’s Data
Testing Queries with WHERE Clauses
A Look at the SqlDataSource Control’s Markup
Summary
Q&A
Workshop
Quiz
Answers
Exercises
15. Displaying Data with the Data Web Controls
An Overview of Data Web Controls
Displaying Data with the GridView Control
A Look at the GridView’s Declarative Markup
Customizing the Appearance of the GridView
Formatting from the Properties Window
Formatting the GridView’s Fields
Formatting with the AutoFormat Dialog Box
Showing One Record at a Time with the DetailsView
Customizing the Paging Interface
Customizing the Appearance of the DetailsView
Paging and Sorting with the GridView
A Look at Paging
Testing the Paging Functionality
Providing Sortable Data
Customizing the Sorting Interface
Summary
Q&A
Workshop
Quiz
Answers
Exercises
16. Deleting, Inserting, and Editing Data
Updating, Deleting, and Inserting Data with the SqlDataSource
Looking at the SqlDataSource Control’s Declarative Markup
Looking at the Data Modification SQL Statements
Examining the INSERT Statement
Deleting Data with the DELETE Statement
Editing Data with UPDATE
Editing and Deleting Data with the GridView
Allowing Users to Delete Data
Customizing the Delete Field
Looking at the Inner Workings of Deleting
Creating an Editable GridView
Customizing the Editing Interface and Updating Rules
Marking Fields as Read-Only
Editing and Formatted Fields
Using Nulls or Blank Strings
Replacing the Autogenerated TextBox with a Custom Editing Interface
Inserting Data with the DetailsView
Customizing the Insertable DetailsView
Summary
Q&A
Workshop
Quiz
Answers
Exercises
17. Working with Data-Bound DropDownLists, RadioButtons, and CheckBoxes
An Overview of the List Web Controls
Binding Data to a List Web Control
The Benefits of Dynamically Populating a List Control
Programmatically Responding to a Changed Selection
Automatically Posting Back When a List Web Control Changes
Filtering Results Using the DropDownList
Listing the Genres in a DropDownList
Filtering the Data Based on the Selected Genre
Collecting User Input with CheckBoxLists and RadioButtonLists
Enumerating the List Web Control’s List Items
Using SelectedItem and SelectedValue
Customizing the Appearance of the RadioButtonList and CheckBoxList Controls
Summary
Q&A
Workshop
Quiz
Answers
Exercises
18. Exploring Data Binding and Other Data-Related Topics
Looking at the GridView’s and DetailsView’s Fields
Looking at How Bit Columns Are Displayed
Displaying Hyperlinks with the HyperLinkField
Displaying Images with the ImageField
Using Wildcards in a WHERE Filter Expression
An Examination of Data Binding
The Difference Between One-Way and Two-Way Data Binding
Specifying the Data Bindings for a Web Control
A Look at the Declarative Markup
Summary
Q&A
Workshop
Quiz
Answers
Exercises
19. Using Templated Data Web Controls
Displaying Data Using the ListView Control
Examining How the ListView Renders Its LayoutTemplate and ItemTemplate
Adding Templates Using the Configure ListView Option
Adding Templates Manually
Paging and Sorting the ListView’s Data
Creating a Sorting Interface
Adding Paging Support
Displaying One Record at a Time with the FormView Control
Paging Through the Records One at a Time
Examining the FormView’s Available Templates
Customizing the Templates
Summary
Q&A
Workshop
Quiz
Answers
Exercises
IV. Site Navigation, User Management, Page Layout, AJAX, and Deployment
20. Defining a Site Map and Providing Site Navigation
An Overview of ASP.NET’s Site Navigation Features
Defining the Website’s Structure Using a Site Map
Adding the Site Map
Building the Site Map
Displaying a Breadcrumb with the SiteMapPath Control
Customizing the SiteMapPath’s Appearance
Showing the Entire Site Structure
Displaying the Site’s Structure in a TreeView
Customizing the TreeView’s Appearance
Using Menus to Show the Site’s Structure
Configuring the Menu’s Static and Dynamic Portions
Customizing the Menu’s Appearance
Summary
Q&A
Workshop
Quiz
Answers
Exercises
21. Managing Your Site’s Users
An Overview of User Accounts in ASP.NET
Configuring an ASP.NET Website to Support Membership
Creating and Managing Users
Classifying Users by Role
Creating and Managing Access Rules
Configuring a Website’s SMTP Settings
Allowing Visitors to Create New User Accounts
Customizing the CreateUserWizard Control
Specifying the Text for the Labels, Text Boxes, and Buttons
Dictating What Information Users Must Provide
Emailing Users a Message After Creating Their Accounts
Creating Inactive User Accounts
Logging In to the Website with the Login Control
Customizing the Login Control
Logging Out
Specifying the Login Page URL
Displaying Content Based on Authentication Status
Summary
Q&A
Workshop
Quiz
Answers
Exercises
22. Using Master Pages to Provide Sitewide Page Templates
An Overview of Master Pages
Creating a Master Page
Designing the Sitewide Template
Creating the Header Region
Crafting the Navigation Region
Creating the Main Region and Footer Region
Creating a Content Page
Having an Existing Page Inherit from a Master Page
Providing Default Content in a Master Page
Choosing to Use Default or Custom Content in an ASP.NET Page
Working with a Master Page’s Source Code Portion
Testing the Master Page’s Functionality
Summary
Q&A
Workshop
Quiz
Answers
Exercises
23. Building More Responsive Web Pages with ASP.NET AJAX
An Overview of AJAX
A Look at the Technologies Involved
Using the ASP.NET AJAX Framework
Working with the UpdatePanel Control
Using Multiple UpdatePanel Controls
Displaying a Progress Message for Long-Running Partial Postbacks
Summary
Q&A
Workshop
Quiz
Answers
Exercises
24. Deploying Your Website
Choosing a Web-Hosting Company
Getting Started with a Web-Hosting Company
Understanding the Deployment Process
Building the Sample Web Application
Uploading the Website’s Files
Replicating Your Database
Using the Database Publishing Wizard
Executing the Output Script on the Web-Hosting Company’s Database Server
Updating the Connection Strings in Web.config
Visiting the Remote Website
Summary
Q&A
Workshop
Quiz
Answers
Exercises
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Introduction
Next
Next Chapter
1. Getting Started with ASP.NET 3.5
Part I. Overview of ASP.NET 3.5
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset