Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

ASP.NET 2.0 Instant Results

.pdf
Скачиваний:
67
Добавлен:
17.08.2013
Размер:
11.03 Mб
Скачать

Contents

Acknowledgments

v

Introduction

xvii

Chapter 1: The Online Diary and Organizer

1

Using the Online Diary

1

Design of the Online Diary

6

The Data Access Layer

6

The Business Layer

8

The OnlineDiary Class

8

The Contact Class

8

The ContactCollection Class

10

The DiaryEntry Class

11

The DiaryEntryCollection Class

13

The DiaryEvent Class

14

The DiaryEventCollection Class

16

Code and Code Explanation

17

File Structure

17

Registration, Logging On, and Security

18

Logging On

18

New User Registration

19

Password Reminder

23

Viewing the Online Calendar

24

Creating, Editing, and Viewing a Diary Entry

26

Creating, Editing, and Viewing Diary Events

29

Managing Contacts

32

Setting up the Online Diary

34

Summary

35

Chapter 2: Wrox File Share

37

Using the Wrox File Share

38

Wrox File Share Design

41

Uploading Files

41

Sending E-Mails

42

Structure of the Site

43

ContentsurrentHead

Data Model and Database Objects

44

The Email Table

44

The Contact Table

44

The Resource Table

45

Themes and Skins

50

Security Model

51

Classes Involved

52

The EmailContent Class

52

The Resource Class

53

The Config Class

54

The Utilities Class

55

Code and Code Explanation

55

Root Files

56

Web.config

56

config.vb

56

Resource.vb

58

resourceDB.vb

59

WebForms

62

Default.aspx

62

Login.aspx

63

Download.aspx

64

User Controls

65

header.ascx

65

footer.ascx

66

navigation.ascx

66

Setting up the Project

67

Hosted Web Site Installation

67

Local Developer Installation

68

Summary

69

Chapter 3: Wrox Chat Server

71

Using the Wrox Chat Server

73

Wrox Chat Server Design

75

Sending Messages Using Callbacks

75

Structure of the Site

78

Data Model

78

The Category Table

79

The Room Table

79

The Message Table

80

The User Table

80

viii

 

CurrentContentsHead

 

 

Themes and Skins

80

Classes Involved

81

The ChatRoom Class

81

The ChatRoomDB Class

82

The Config Class

83

Code and Code Explanation

84

Root Files

84

Web.config

84

Config.vb

84

ChatRoom.vb

85

ChatRoomDB.vb

86

WebForms

88

SignIn.aspx

88

Default.aspx

88

ChatRoom.aspx

90

ChatWindow.aspx

92

User Controls

94

header.ascx

95

footer.ascx

95

navigation.ascx

95

Setting up the Project

96

Hosted Web Site Installation

96

Local Developer Installation

96

Summary

97

Chapter 4: Wrox Survey Engine

99

Using the Wrox Survey Engine

100

Adding a New Survey

105

Editing an Existing Survey

109

Wrox Survey Engine Design

110

Object Binding and SQL Server Data Binding

110

Structure of the Site

111

Data Model and Database Objects

112

Themes and Skins

115

Security Model

116

Classes Involved

117

The SurveyBase Class

117

The Survey Class

118

The SurveyDB Class

120

The Config Class

121

ix

ContentsurrentHead

Code and Code Explanation

122

Root Files

122

Web.config

122

Survey.vb

122

Config.vb

123

SurveyDB.vb

124

WebForms

126

Default.aspx

126

Login.aspx

126

TakeSurvey.aspx

126

User Controls

127

header.ascx

127

footer.ascx

128

navigation.ascx

128

surveyresults.ascx

129

currentsurvey.ascx

130

Setting up the Project

130

Hosted Web Site Installation

131

Local Developer Installation

131

Summary

132

Chapter 5: Wrox CMS

133

Using the Wrox CMS

133

Viewing Content on the Site

134

Managing Content with the CMS

135

Design of the Wrox CMS

136

The Business Layer

137

The Data Access Layer

139

The Data Model

139

Helper Class

140

Code and Code Explanation

141

Root Files

141

Web.config

141

SiteMaster.master and AdminMaster.master

142

Login.aspx

146

The Management Folder

146

Managing Categories

146

Managing Content

153

Displaying Content on the Web Site

159

Setting up the Wrox CMS

162

Using the Installer

162

Manual Installation

162

x

 

CurrentContentsHead

 

 

Changing IIS Settings

162

Changing Security Settings

163

Testing Out the Site

164

Summary

165

Chapter 6: Wrox Blog

167

Using the Blog

168

Design of the Wrox Blog

170

The Business Layer

170

The BlogEntry Class

171

The BlogManager Class

172

The UserManager Class

173

The Data Access Layer

174

The BlogManagerDB Class

176

The UserManagerDB Class

177

The Data Model

178

Stored Procedures and Queries

179

Helper Classes

180

Code and Code Explanation

181

Root Files

181

Web.config

181

Login.aspx

181

Global.asax

184

Writing Provider-Independent Code

185

The Controls Folder

188

BlogEntriesFilter.ascx

188

BlogEntries.ascx

191

Structured Error Handling and Logging

198

Configuration

198

Handling and Logging Errors

198

Setting up the Wrox Blog

200

Using the Installer

200

Manual Installation

201

Summary

203

Chapter 7: Wrox Photo Album

205

Using the Wrox Photo Album

206

Wrox Photo Album Design

211

How It All Fits Together

211

Storing Images

212

Displaying Images

212

xi

ContentsurrentHead

Site Structure

213

Themes and Skins

214

Data Model

216

Security Model

217

Classes Involved

218

Code and Code Explanation

221

Root Files

222

Web.config

222

Masterpage.master and Admin.master

222

Web.sitemap

223

WebForms

223

Photos.aspx

223

Login.aspx

224

Admin.aspx

225

Editphotos.aspx

227

Secure Area Files

228

User Controls

229

header.ascx

229

footer.ascx

229

navigation.ascx

229

Setting up the Project

230

Hosted Web Site Installation

230

Local Developer Installation

231

Summary

232

Chapter 8: Customer Support Site

233

Using the Customer Support Site

233

Design of the Customer Support Site

235

The Business Layer

236

The ContentBase Class

236

The Product Class

237

The Download Class

239

The Faq Class

239

The Category Class

241

The Data Access Layer

241

The ProductDB Class

242

The DownloadDB Class

243

The FaqDB class

243

The CategoryDB class

243

The Data Model

244

Stored Procedures and User-Defined Functions

247

Helper Classes

247

The AppConfiguration Class

247

xii

 

CurrentContentsHead

 

 

Code and Code Explanation

248

Root Files

248

Web.config

248

Global.asax

248

Default.aspx

248

Master Pages

249

Other Files and Folders

250

The Product Locator

251

The Downloads List

256

Searching Frequently Asked Questions

262

The Customer Support Site CMS

268

Categories.aspx

268

The List Pages

268

The Create and Update Pages

269

Setting up the Customer Support Site

269

Using the Installer

269

Manual Installation

270

Using the Customer Support Site

270

Summary

271

Chapter 9: Wrox WebShop

273

Using the WebShop

273

Navigating the WebShop

274

Maintaining the WebShop Product Catalog

276

Design of the WebShop

277

The Business Layer

277

Product

277

OrderedProduct

279

ShoppingCart

280

ShopManager

281

Customer

283

The Data Access Layer

284

The Data Model

284

ShopManagerDB

287

Helper Classes

288

Code and Code Explanation

289

Root Files

289

Global.asax

289

Web.config

289

MasterPage.master

291

Default.aspx

292

Login.aspx

292

UserDetails.aspx

293

xiii

ContentsurrentHead

The Shop Folder

293

Displaying Products

294

Adding a Product to the Cart

296

The ShoppingCart.aspx Page

297

Changing Items in the Cart

298

Finalizing Orders

301

The Management Folder

306

Setting up the WebShop

307

Using the Installer

307

Manual Installation

307

Modifying Security Settings

307

Changing E-mail Settings

309

Managing Products

309

Summary

309

Chapter 10: Appointment Booking System

311

Using the Appointment Booking System

311

Maintaining the Appointment Booking System

312

Making Appointments with the Appointment Booking System

314

Creating an Account

314

The Availability Checker

314

The Appointment Wizard

315

Design of the Appointment Booking System

316

The Business Layer

316

BookingObject

316

BookingObjectManager

317

Appointment

318

AppointmentManager

320

Weekdays

321

The Data Access Layer

322

BookingObjectManagerDB

322

AppointmentManagerDB

322

The Data Model

323

Helper Classes

324

AppConfiguration

324

Helpers

325

Code and Code Explanation

325

Web.config

325

Global.asax

326

Default.aspx

326

xiv

 

CurrentContentsHead

 

 

Master Pages

326

Other Files and Folders

326

The Availability Checker

327

The Appointment Wizard

334

The Sign Up Page

340

The Management Section

342

Saving Configuration Information

342

Managing Booking Objects

344

Viewing Appointments

345

Setting up the Appointment Booking System

349

Using the Installer

349

Manual Installation

349

Configuring the Application

350

Summary

350

Chapter 11: Greeting Cards

351

Creating Your Own Greeting Card

352

Design of the Greeting Cards Application

355

The Toolkit

356

The Imaging Class

356

The UploadHandler Class

358

Helper Classes

361

The FileHandlingEventArgs Class

361

AppConfiguration

361

Code and Code Explanation

362

The Host Page

362

Uploading and Resizing Images

366

Uploading Files

367

Resizing Images

369

Rotating and Flipping Images

372

Cropping Images

374

Adding Text to Images

379

Sending E-Mail with Embedded Images

384

Setting up the Greeting Card Application

386

Using the Installer

387

Manual Installation

387

Configuring the Application

387

Configuring Security Settings

387

Configuring the Mail Server

389

Summary

390

xv

ContentsurrentHead

Chapter 12: The Bug Base

391

Using the Bug Base

392

Design of the Bug Base

396

The Business Layer

397

Bug

397

BugManager

399

BugComparer

400

CommentManager

400

ListManager

400

MemberManager

402

NameValue

402

SearchCriteria

402

The Data Access Layer

403

BugManagerDB

407

CommentManagerDB

408

ListManagerDB

409

MemberManagerDB

410

Code and Code Explanation

410

Root Files

410

Web.config

410

MasterPage.master

412

Global.asax

413

Web.sitemap

413

Filing a Bug

413

Searching and Viewing Bugs

423

Other Files and Folders

433

Setting up the Bug Base

435

Using the Installer

435

Manual Installation

435

Browsing to the Bug Base

436

Summary

436

Index

439

xvi