Apress beginning visual web developer 2005 express from novice to professional dec 2005 ISBN 1590594827 pdf

353 533 0
Apress beginning visual web developer 2005 express from novice to professional dec 2005 ISBN 1590594827 pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Delorme.book Page i Tuesday, November 15, 2005 11:40 AM Beginning Visual Web Developer 2005 Express From Novice to Professional ■■■ Paul Sarknas with Rick Delorme Delorme.book Page ii Tuesday, November 15, 2005 11:40 AM Beginning Visual Web Developer 2005 Express: From Novice to Professional Copyright © 2006 by Paul Sarknas and Rick Delorme All rights reserved No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher ISBN (pbk): 1-59059-482-7 Printed and bound in the United States of America Trademarked names may appear in this book Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark Lead Editor: Ewan Buckingham Technical Reviewer: Mark Horner Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis, Jason Gilmore, Jonathan Hassell, Chris Mills, Dominic Shakeshaft, Jim Sumser Project Manager: Sofia Marchant Copy Edit Manager: Nicole LeClerc Copy Editor: Freelance Editorial Services Assistant Production Director: Kari Brooks-Copony Production Editor: Katie Stence Compositor: Pat Christenson Proofreader: Elizabeth Berry Indexer: John Collin Artist: April Milne Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013 Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, or visit http://www.springeronline.com For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710 Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com, or visit http://www.apress.com The information in this book is distributed on an “as is” basis, without warranty Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work The source code for this book is available to readers at http://www.apress.com in the Source Code section Delorme.book Page iii Tuesday, November 15, 2005 11:40 AM I would like to dedicate this work to my family in appreciation for all their help and support over the years Paul Sarknas I would like to dedicate this work to my two beautiful children, Jaxen and Kendyl, and to my amazing wife, Jenn, without whom none of this would have been possible because she is my anchor Richard Delorme Delorme.book Page iv Tuesday, November 15, 2005 11:40 AM Delorme.book Page v Tuesday, November 15, 2005 11:40 AM Contents at a Glance About the Authors xv About the Technical Reviewer xvii ■CHAPTER Introducing Visual Web Developer ■CHAPTER The Development Environment 21 ■CHAPTER Introducing SQL Server Express 45 ■CHAPTER Server Controls 77 ■CHAPTER Master Pages, Themes, and Skins 101 ■CHAPTER Working with Data Using ADO.NET 119 ■CHAPTER Managing Site Navigation 135 ■CHAPTER Localization 169 ■CHAPTER Personalization 189 ■CHAPTER 10 Administration and Configuration 215 ■CHAPTER 11 Securing Websites 235 ■CHAPTER 12 Debugging Your Website 269 ■CHAPTER 13 Deployment 291 ■CHAPTER 14 Post Development 307 ■INDEX 321 v Delorme.book Page vi Tuesday, November 15, 2005 11:40 AM Delorme.book Page vii Tuesday, November 15, 2005 11:40 AM Contents About the Authors xv About the Technical Reviewer xvii ■CHAPTER Introducing Visual Web Developer What Is ASP.NET? Visual Web Developer Visual Web Developer vs Visual Studio Installing Visual Web Developer 2005 Principles of Object-Oriented Programming Class Your First Web Application 10 Building Web Applications 17 Web Application Architecture 17 ASP.NET Runtime 18 Summary 19 ■CHAPTER The Development Environment 21 Main Menu and Toolbars File Menu Edit Menu View Menu Website Menu Build and Debug Menus Tools Menu Window Menu Help Menu 21 22 22 24 24 24 25 26 26 vii Delorme.book Page viii Tuesday, November 15, 2005 11:40 AM viii ■C O N T E N T S ■CHAPTER Dockable Windows Solution Explorer Toolbox Properties Window Database Explorer Output Window Error List Task List Find Results View Class View Code Editing Code-Beside IntelliSense Inserting Code Snippets Environment Options Environment Projects and Solutions Text Editor Database Tools Display Summary 28 29 31 33 35 35 35 36 37 38 38 38 40 41 41 42 42 43 43 43 43 Introducing SQL Server Express 45 SQL Server Express What’s Under the Hood? SQL Server Express vs SQL Server 2005 SQL Server Express Security Features SQL Server Databases What Is a Database in SQL Server? Database Objects Using T-SQL SQL Express Management Tools Express Manager Installing Express Manager Working with the Command Line Books Online Visual Web Developer Integration Connecting to a Database Creating Database Objects Summary 46 46 47 49 50 50 51 53 56 56 56 61 65 65 66 69 76 Delorme.book Page ix Tuesday, November 15, 2005 11:40 AM ■C O N T E N T S ■CHAPTER Server Controls 77 Standard Controls Label TextBox Button LinkButton ImageButton HyperLink DropDownList ListBox CheckBox CheckBoxList RadioButton RadioButtonList Image ImageMap Table BulletedList HiddenField Literal Calendar AdRotator FileUpload Wizard Xml MultiView and View Panel PlaceHolder Substitution Data Controls GridView DataList DetailsView FormView Repeater SqlDataSource AccessDataSource ObjectDataSource XmlDataSource SiteMapDataSource 78 79 79 79 79 79 79 79 79 79 80 80 80 80 80 80 80 80 80 81 81 81 81 81 81 81 81 81 84 84 84 84 84 85 85 85 85 85 85 ix Delorme.book Page 320 Thursday, November 10, 2005 1:51 PM DelormeIndex.fm Page 321 Tuesday, November 15, 2005 10:16 AM INDEX ■Symbols ? (-?) switch, SQLCmd tool, 62 ■A Active Directory, 236 add element, web.config, 202 Add Tab option, Toolbox, 32 Add-In Manager launching, 25 Adding References option, Website menu, 24 AddPhotoAlbum stored procedure VWD and SQL Express integration, 75 administration tools Web Site Administration Tool, 230 ADO.NET connection strings, 47 Advanced menu, Edit menu, 23 allowAnonymous attribute, web.config, 202 Alter statement, DDL, 54 App_Assemblies folder, Solution Explorer, 30 App_Browsers folder, Solution Explorer, 31 App_Code folder, Solution Explorer, 30 App_Data folder, Solution Explorer, 30 App_GlobalResources folder, Solution Explorer, 31 App_LocalResources folder, Solution Explorer, 31 App_Themes folder, 207 Solution Explorer window, 31 App_WebReferences folder, Solution Explorer, 30 appearance of web pages master pages, 101–110 skins, 115–117 themes, 110–115 Application XCopy SQL Server Express, 48 Application_Start subroutine displaying dynamic content, 166 applicationName attribute membership providers, 248 applications building web application, 10–17 web application architecture, 17 AppSettings class Settings method, 221 appSettings section, web.config, 220 architecture data access, 119–121 ASP.NET ASP.NET 2.0 themes, 206 Forms authentication, 239 introduction, 1–2 ASP.NET runtime, 18 ASPNET_COMPILER tool help files, 302 precompilation, 300 precompilation for deployment, 303 ASPNET_REGSQL utility implementing SQL Server caching, 309, 310, 311, 312, 313 AspNetSqlProvider, 248, 250 assemblies adding References, Website menu, 24 App_Assemblies folder, 30 AttachDBFileName parameter connection strings, 48 attributes entities, 51 Authenticate method, FormsAuthentication class, 242 implementing Forms authentication, 243 321 DelormeIndex.fm Page 322 Tuesday, November 15, 2005 10:16 AM 322 ■I N D E X authentication authentication methods, 236 Forms authentication, 239–245 Login control, 264 security web controls, 264–266 authentication element, web.config site navigation security, 153 auto detect functionality using automatic browser detection, 173 AutoRecover option Environment node, 42 ■B binding see data binding breadcrumb trail, 100 SiteMapPath control, 140 breakpoints, 271–276 Call Stack window, 282 Immediate window, 280 inserting breakpoints, 271–273 Locals window, 279 navigating in break mode, 273–276 navigation methods, 274 Quick Watch window, 277 Step Into method, 274–275 Step Out method, 276 Step Over method, 276 Watch window, 278 browsers App_Browsers folder, 31 changing language programmatically, 180 modifying preferred browser language, 171–173 storing language preferences, 181 using automatic browser detection, 173 Build Page option, Build menu, 25 Build Solution option, Build menu, 25 Build view, Output window, 35 Build/Run option Projects and Solutions node, 42 Button control, 79 applying skins to, 116 example using, 82 ■C caching, 309–319 output caching, 318–319 Calendar control, 81 creating Web Parts, 193 Call Stack window debugging windows, 282 Cascading Style Sheets (CSS) adding style sheet to web project, 208 CatalogPart component, 191 CheckBox control, 79 Class View window, 38 classes constructors, partial classes, 39 principles of OOP, protected modifier, public keyword, referring to static classes, 148 ClassName attribute Page directive, Web Form, 39 code App_Code folder, 30 code beside model, 38–39 code editing, 38–41 code snippets, 41 command line development, command line tools, 232 Common Language Runtime (CLR) SQL Server Express support, 49 CompareValidator control, 92 compilation, 299–304 precompilation, 300–304 CompileWith attribute Page directive, Web Form, 39 configuration files location of, 216 order of execution, 216 XML refresher course, 215 Configuration Management API, 219–230 reading configurations, 222 updating configurations, 222–226 DelormeIndex.fm Page 323 Tuesday, November 15, 2005 10:16 AM ■I N D E X Configuration objects, 219, 220 encrypting configurations, 226 GetSection method, 226 updating configurations, 222 configuration tag, web.config, 218 ConfigurationManager class Configuration Management API, 219 Connection Properties dialog, 66 connection strings membership functionality, 247 mixed mode authentication, 49 using ASP.NET data controls, 125, 126 Windows authentication, 49 connections configuring SQL connection, 87 establishing SQL connection, 86 installing Express Manager, 58 SQL Server Express, 47 SQLCmd tool connecting, 63 testing SQL connection, 87 using ASP.NET data controls, 123, 124 VisualPhotoAlbum database, 68 VWD and SQL Express integration, 66 connectionStringName attribute membership providers, 248 ConnectionsZone component, 191 content pages using with master pages, 102–110 ContentPlaceHolder control, 101 Contents option, Help menu, 26 controls ASP.NET data controls, 121–130 ContentPlaceHolder control, 101 implicit localization for a control, 176–178 navigation controls, 140–147 security web controls, list of ChangePassword, 266 LoginName, 265 LoginView, 265 server controls, 77–100 custom controls, 100 data controls, 84–91 navigation controls, 99–100 security controls, 98–99 skins, 115–117 standard controls, 78–84 validation controls, 91–98 server controls, list of AccessDataSource, 85 AdRotator, 81 BulletedList, 80 ChangePassword, 99 CheckBoxList, 80 CustomValidator, 92 DetailsView, 84 GridView, 84 HyperLink, 79 ImageMap, 80 LinkButton, 79 ListBox, 79 Literal, 80 Login, 99 LoginName, 99 Menu, 100 MultiView, 81 PasswordRecovery, 99 PlaceHolder, 81 RadioButtonList, 80 RegularExpressionValidator, 92 Repeater, 85 RequiredFieldValidator, 92 TextBox, 79 Wizard, 81 XmlDataSource, 85 tracing at page level, 286 web controls, 140–147 cookies Forms authentication, 239 tracing at page level, 286 Copy Web Site tool, 296–299 advantages/disadvantages, 297 connecting with, 298 Create statement, DDL, 53 CreateRole method, Role class, 263 CreateUserWizard control, 99 cross page posting, 14 CRUD operations, 53 323 DelormeIndex.fm Page 324 Tuesday, November 15, 2005 10:16 AM 324 ■I N D E X Culture property, Page class using automatic browser detection, 173 CultureInfo class storing language preferences, 183 cultures languages and cultures listing, 170 currencies localization, websites, 169 CurrentExecutionFilePath property, Request class, 224 custom controls, 100 ■D d (-d) switch, SQLCmd tool, 62 data App_Data folder, 30 data access architecture ASP.NET data controls, 121–130 data binding, 130–133 data access layer data access architecture, 119, 120 data controls, ASP.NET data binding, 130–133 Data controls, Toolbox, 31 Data Definition Language (DDL), 53 Alter statement, 54 Data Manipulation Language (DML), 54–56 definition, 53 Delete statement, 55 Insert statement, 55 data providers data access architecture, 119, 120 data sources data access controls, 121–130 data binding, 130–133 data stores, 45 data access architecture, 120 Database Explorer, 35 database objects, SQL Server, 51–53 creating, VWD and SQL Express integration, 69–76 object names and references, 51 securing, 56 stored procedures, 52 views, 52 Database Tools node environment options, VWD, 43 DataList control, 84 date formats English localization of current date, 174 German localization of current date, 175 localization, websites, 169 de language, 170 Debug view, Output window, 35 debugging, 289 breakpoints, 276 customizing Debugging toolbar, 25 debugging windows, 277–283 Immediate window, 280 Watch window, 278 enabling, 269–271 warning: debugging not enabled, 16 de-ch language, 170 defaultValue attribute, web.config, 202 Delete statement, 55 DeletePhotoAlbum stored procedure VWD and SQL Express integration, 76 deny attribute authorization element, web.config, 153 deployment precompilation for deployment, 303–304 description attribute siteMapNode element, 136 using site navigation classes, 150 DestinationPageUrl site navigation security, 159 development environment options, 41–43 Display node environment options, VWD, 43 dockable windows, 28–38 dragging and dropping, 28 Domain Name Server (DNS) function of DNS, 18 drag and drop deployment XCOPY deployment, 292–294 Drop statement, DDL, 54 DropDownList control, 79 creating Web Parts, 197, 198 example using, 83 DelormeIndex.fm Page 325 Tuesday, November 15, 2005 10:16 AM ■I N D E X Duration directive implementing output caching, 318 dynamic content web pages displaying, 162 ■E E (-E) switch, SQLCmd tool, 62 Edit menu, 22 EditorZone component, 191 EM see Express Manager (EM) tool EmailWebSite building first web application, 10 enabled attribute profile element, 203 enablePasswordReset attribute, 248 enablePasswordRetrieval attribute, 248 encapsulation, OOP, End User License Agreement installing VWD, en-gb language, 170 entities, 51 en-us language, 170 Environment node environment options, VWD, 42 Error List window, 35 Eval method data binding controls, 131 events SiteMapResolve event, 163 execution advantages of stored procedures, 74 explicit localization, websites, 175 explicit localization for a control, 178–180 Express Manager (EM) tool, 48, 56 installing, 56–61 toolbar buttons, 59 ■F files configuration files, 215–219 Recent Files, File menu, 22 FileUpload control, 81 Find Results View, 37 Fonts and Colors option Environment node, 42 foreign keys see relationships Format Document option, Edit menu, 22, 23 Format Selection option, Edit menu, 22 FormatString property, LoginName control, 265 Forms authentication attributes of element, 240 description, 236 example implementing, 241–245 web.config file, 239 FormsAuthentication class Authenticate method, 242, 243 implementing Forms authentication, 241 RedirectFromLoginPage method, 240, 243 SignOut method, 245 FormView control, 84 fr-ca language, 170 FTP (File Transfer Protocol) XCOPY deployment using, 292 Full Screen option, View menu, 24 ■G General controls, Toolbox, 32 General option Environment node, 42 Projects and Solutions node, 42 GetAllRoles method, Role class, 263 GetSection method, Configuration objects, 226 GetUser method, Membership class, 257, 259, 260, 262 Globalization namespace storing language preferences, 182 globalization, websites, 169 GridView control data binding controls, 131, 132, 133 example using, 89 implementing SQL Server caching, 314, 315 using ASP.NET data controls, 121, 128, 130 325 DelormeIndex.fm Page 326 Tuesday, November 15, 2005 10:16 AM 326 ■I N D E X ■H ■L headers collection tracing at page level, 286 help Books Online help, 56, 65 Help menu, 26 HiddenField control, 80 HTML controls, Toolbox, 32 Label control, 79 example using, 82 language auto detection, 173–175 browser’s language setting, 170 changing programmatically, 180–186 layers tiers, 119, 120 Load event building first web application, 16 localization, websites explicit localization for a control, 178–180 implicit localization for a control, 175, 176–178 information to localize, 169 localizing static content, 187 using automatic browser detection, 173 Locals window debugging windows, 279 location tag, web.config, 218 Login control, 264 site navigation security, 160 Toolbox, 32 login page implementing Forms authentication, 243 LoginStatus control, 99, 265 loginUrl attribute, element, 240 LoginView control, 99 ■I i (-i) switch, SQLCmd tool, 62 IDE (Integrated Development Environment ), Image control, 80 ImageButton control, 79 implicit localization, websites, 175 implicit localization for a control, 178 in-line IntelliSense, 40 in place compilation, 300 in place precompilation, 303 Index option, Help menu, 26 InitializeCulture method storing language preferences, 181, 182, 184 Insert statement, 55 instances, SQL Server, 46 instantiation, classes, IntelliSense, 40 interfaces, 10 Intermediary Language (IL) NET compilation process, 24 Internet Properties window XCOPY deployment using FTP, 293 Internet Services Application Programming Interface (ISAPI), 18 IsInRole method, User object, 237 IsProtected property, SectionInformation class, 227 ■J Just-In-Time (JIT) compilation NET compilation process, 25 ■K KeyValueConfigurationElement type, 221 Value property, 224 keywords, ■M machine.config file order of execution of configuration files, 217 main database file SQL Server, 50 main menu, 21 Build menu, 24 Debug menu, 25 illustration of, 22 View menu, 24 Window menu, 26 maintenance advantages of stored procedures, 74 DelormeIndex.fm Page 327 Tuesday, November 15, 2005 10:16 AM ■I N D E X management tools SQL Server Express, 48 many to many relationships, 70 master pages, 101 using with content pages, 102 membership website security, 245–262 Membership class ChangePassword method, 260 UnlockUser method, 262 ValidateUser method, 257–260 membership functionality connectionStrings element, 246 creating new user, 251–257 deleting new user, 260–261 providers element, 246 MembershipProvider element, 246 web.config file utilizing, 246 MembershipCreateStatus enumeration creating new user, 255 Menu control description, 140 example illustrating use of, 145–147 Menu control (continued) navigation controls compared, 140 site navigation security, 160 with SiteMapDataSource control, 145 menus see main menu methods, 10 Microsoft Intermediate Language (MSIL) precompilation, 300 Microsoft Management Console snap-in, 231 Microsoft Passport authentication, 245 modifiers, modularity user defined functions, 53 msdb database SQL Server, 50 MSN website using themes, 205 using Web Parts, 190 ■N name attribute membership providers, 248 user profile attributes in web.config, 202 name attribute, element, 240 namespaces NET Framework, navigation see site navigation navigation controls Toolbox, 31 web.sitemap file, 135 NET, compilation process, 24 NET Framework, notation in path, 206 network connections SQL Server Express, 50 New keyword, New Website option, Website menu, 24 NextSibling property, SiteMap class determining current page, 148 ■O object hierarchy viewing, 38 ObjectDataSource control, 85 OnAuthenticate method Windows authentication, 237 one to many relationships, 69 OOP (object oriented programming) classes, 10 encapsulation, 10 key terms in OOP, 10 principles of OOP, 7–10 properties, 10 purpose of OOP, OpenMachineConfiguration method WebConfigurationManager class, 219 OpenWebConfiguration method WebConfigurationManager class, 219, 221, 226 327 DelormeIndex.fm Page 328 Tuesday, November 15, 2005 10:16 AM 328 ■I N D E X options VWD environment options, 41–43 Options command, Tools menu, 25 OSQL, 56 Outline menu, 23 Output window, 35 overriding, 181 ■P P (-P) switch, SQLCmd tool, 62 page directive tracing at page level, 283 Web Forms, 39 Page_Load event/method building first web application, 16 encrypting configurations, 226 updating configurations, 223 Page_PreInit method changing themes programmatically, 210 Panel control, 81 Passport authentication, 245 description, 236 passwordFormat attribute, 248 PasswordRecovery control, 265 passwords ChangePassword control, 266 implementing Forms authentication, 242 path attribute, element, 240 perfmon command, 307 performance, 307–309 adding performance monitors, 308 advantages of stored procedures, 74 SQL Server Express parameters, 48 performance monitor window, 307 personalization, websites, 189–213 themes, 205–213 user profiles, 202–205 post back events using site navigation classes, 150 precompilation NET Framework, 300 precompilation for deployment, 300, 304 presentation layer data access architecture, 120 PreviousSibling property, SiteMap class determining current page, 148 using site navigation classes, 150 primary keys setting, 70, 71 tables, 51 private keyword/modifier, procedures see stored procedures Profile class, NET Framework accessing user profiles in code, 205 profile elements adding, 203 group element within, 203 user profile elements in web.config, 202 profiles user profiles, 202–205 Project Build Order option, Website menu, 24 Project Dependency option, Website menu, 24 projects Recent Projects, File menu, 22 Solution Explorer window, 29 prompts SQLCmd command line tool, 63 properties element user profile elements in web.config, 202 Properties window, 33–34 VWD and SQL Express integration, 69 protectedData section, web.config, 228, 229 protection attribute, element, 240 ProtectSection method, SectionInformation class, 228 provider attribute user profile attributes in web.config, 202 providers Connection Properties dialog, 66 membership providers, 248 user profiles, 204 public keyword AspNetAccessProvider provider, 204 DelormeIndex.fm Page 329 Tuesday, November 15, 2005 10:16 AM ■I N D E X ■Q queries creating, VWD and SQL Express integration, 69 query string parameters web pages displaying dynamic content, 162 Query tab drop down list Express Manager tool, 60 question mark (?) ? (-?) switch, SQLCmd tool, 62 web pages displaying dynamic content, 163 Quick Watch window debugging windows, 277 ■R RadioButton control, 80 RangeValidator control, 92 readOnly attribute user profile attributes in web.config, 202 Recent Files, File menu, 22 Recent Projects, File menu, 22 RedirectFromLoginPage method FormsAuthentication class, 240, 243 Refactor view, Output window, 35 References adding, Website menu, 24 Refresh option VWD and SQL Express integration, 69 RegularExpressionValidator control, 93 relationships between tables, 69 defining tables and columns for, 73 VisualPhotoAlbum tables, 72 Relationships editor VWD and SQL Express integration, 73 Reponse class Redirect method, 224 Request details tracing at page level, 286 requiresQuestionandAnswer attribute membership providers, 248 requiresUniqueEmail attribute membership providers, 248 Resource Editor implicit localization, 176 resource expressions, 175–180 resource files explicit/implicit localization, 175 resources App_GlobalResources folder, 31 App_LocalResources folder, 31 Role class, 262 CreateRole method, 263 PopulateRoles method, 263 ■S S (-S) switch, SQLCmd tool, 62 sa account, SQL Server, 49 scope class methods and properties, SectionInformation class GetRawXml method, 226 UnprotectSection method, 227 security advantages of stored procedures, 74 site navigation, 152–162 SQL Server Express, 49–50 Web Site Administration Tool, 156 website security, 235 Windows authentication, 236–238 Security Support Provider Interface (SSPI), 247 security web controls ChangePassword control, 266 Login control, 264 securityTrimmingEnabled attribute siteMap element, 153 SELECT statement configuring for data retrieval, 87 Data Manipulation Language, 54 using ASP.NET data controls, 127 SelectedIndexChanged method, DropDownList storing language preferences, 184 serializeAs attribute user profile attributes in web.config, 202 server controls, 77–100 see also under controls 329 DelormeIndex.fm Page 330 Tuesday, November 15, 2005 10:16 AM 330 ■I N D E X server variables tracing at page level, 286 SetPropertyValue method, Profile class storing language preferences, 184 sibling pages, SiteMap class determining current page, 148 using site navigation classes, 150 SignOut method, FormsAuthentication class, 245 site navigation building site map, 135–139 displaying dynamic content, 163–168 implementing security, 152 managing site navigation, 135–168 Site Navigation API programming with, 147–152 using site navigation classes, 148 SiteMap class CurrentNode property, 148 displaying dynamic content, 163 Site Navigation API, 147 site navigation security, 152 siteMap element web.config file, 152 web.sitemap file, 135 sitemap file see web.sitemap file SiteMapDataSource control, 85 Menu control using, 145 SiteMapPath control using, 141 Treeview control using, 142, 149 siteMapFile attribute siteMap element, 153 siteMapNode element adding web.sitemap file to web projects, 138 title attribute, 136 web pages displaying dynamic content, 163 SiteMapPath control, 100 description, 140 displaying dynamic content, 163 example illustrating use of, 141–142 navigation controls compared, 140 with SiteMapDataSource control, 141 SiteMapResolve event, SiteMap class displaying dynamic content, 163–168 skins creating, 115 Solution Explorer, 29–31 special folders, 30 Split command, Window menu, 26 sprocs see stored procedures SQL (Structured Query Language) Data Control Language (DCL), 56 Data Definition Language (DDL), 54 database engine extensions, 47 SQL Server caching, 309–317 command line, working with, 65 data organization, 50–56 database objects, 51 installed databases, 50 log file, 50 sa account, 49 T-SQL, 53 SQL Server Express, 46–50 Application XCopy, 48 authentication modes, 49 cache size for data caching, 48 CLR support, 49 command line, working with, 61 Computer Manager tool, 56 connection strings, 47 design goals, 47 Express Manager tool, 56 creating database in, 60 installing, 56 management tools, 48, 56–65 mixed mode authentication, 49 Shared Memory access, 50 SQL Server Express (continued) SQL Server compared, 46, 47–49 SQL Server provider, 66 VWD integration, 65–76 creating database objects, 69–76 DelormeIndex.fm Page 331 Tuesday, November 15, 2005 10:16 AM ■I N D E X SQLCmd command line tool, 61–65 command line switches, 62 SQL Server Express, 56 SqlDataSource control, 85 using ASP.NET data controls, 121, 122 SQLEXPRESS instance, 46 installing Express Manager, 58 stack trace output tracing at page level, 283, 284, 285, 286 stacks, 282 Standard controls, Toolbox, 31 Start Options menu, Website menu, 24 static classes localizing static content, 187 Step Into method, 274 navigating in break mode, 274–275 Step Out method, 274 navigating in break mode, 276 Step Over method, 274 navigating in break mode, 276 stored procedures advantages of, 74 photo album project AddPhotoAlbum, 75 DeletePhotoAlbum, 76 UpdatePhotoAlbum, 75 VWD and SQL Express integration, 74 styles see themes Substitution control, 81 symbols Class View window, 38 System.Web.Configuration namespace Configuration Management API, 219 ■T tabbed document dockable windows, 29 Table control, 80 tables Alter statement, 54 Create statement, 53 creating, VWD and SQL Express integration, 69, 70 database objects, SQL Server, 51 Drop statement, 54 entity attributes, 51 foreign keys, 51 Insert Table dialog, 12 normalization, 51 relationships between, 69 views and, 52 VisualPhotoAlbum entities, 69 Task List option Environment node, 42 Task List window, 36 creating, 37 tblPhotoAlbum table VWD and SQL Express integration, 70, 71 tblPhotoAlbumPictures table VWD and SQL Express integration, 70, 72 TCP/IP SQL Server Express connections, 50 tempdb database, SQL Server, 50 text direction (of reading), 169 localization, websites, 169 Text Editor node environment options, VWD, 43 TextBox control, 82 themes adding, 110 adding customized themes, 206 adding style sheet to web project, 208 adding to a web page, 206 adding to a website, 207 App_Themes folder, 31 applying at application level, 113 applying at page level, 112 changing at runtime, 209–213 changing programmatically, 209–213 creating and implementing, 207–209 theme structure, 206–209 third-party tools, 25 Threading namespace storing language preferences, 182 tiers, 119, 120 331 DelormeIndex.fm Page 332 Tuesday, November 15, 2005 10:16 AM 332 ■I N D E X timeout attribute, element, 240 title attribute, siteMapNode element configuring web.sitemap, 139 TODO comment Task List window, 36 toolbars View menu, 24, 25 Toolbox, 31–33 Add Tab option, 32 adding controls, 33 control groupings, 31 customizing, 25, 32 illustrated, VWD, 78 tools administration tools, 230–232 Tools menu, 25 tracing, debugging, 283–289 application level tracing, 287–288 custom trace output, 288–289 page level tracing, 286 single web page, 283–286 trace output, 286 TreeView control, 100 description, 140 example illustrating use of, 142–145 node properties displayed, 151 properties window, 143 with SiteMapDataSource control, 142, 149 triggers database objects, SQL Server, 52 type attribute adding to profile element, 203 membership providers, 248 user profile attributes in web.config, 202 ■U UnlockUser method, Membership class, 261–262 Update statement, 55 UpdatePhotoAlbum stored procedure VWD and SQL Express integration, 75 Url attribute siteMapNode element, 136 configuring web.sitemap, 139 user defined functions database objects, SQL Server, 53 User object IsInRole method, 237 Windows authentication, 237 user profiles accessing in code, 204 attributes/elements in web.config, 202 user roles Web Site Administration Tool creating, 158 users language preferences, 180 personalization, websites, 189–213 Web Site Administration Tool creating, 158 ■V Validation controls, Toolbox, 32 ValidationSummary control, 92 Value property KeyValueConfigurationElement type, 224 VaryByParam directive implementing output caching, 318 Visual Web Developer (VWD) building web applications, 10–18 Dynamic Help, 28 environment options, 41–43 Database Tools node, 43 Projects and Solutions node, 42 Insert Table dialog, 12 installing, 2–6 End User License Agreement, installation options, introduction, main menu, 21 server controls, 77–100 SQL Server Express integration, 76 connecting to database, 66 creating database objects, 69–76 Toolbox illustrated, 78 Visual Studio and VWD, ■W Weather Channel, The, 197 web application layer data access architecture, 120 DelormeIndex.fm Page 333 Tuesday, November 15, 2005 10:16 AM ■I N D E X web applications debugging, 269–289 deployment, 291–305 tracing at application level, 287–288 web controls site navigation, 140–147 website security, 264–266 Web Forms code beside model, 39 web pages adding themes, 206 code beside model, 38 master pages, 101–110 themes, 110–115 tracing single page, 283–286 Web Parts, 189–201 Web Part Framework, 190–191Web Part component, 191 Web Parts creating, 192–201 during runtime in browse mode, 199 during runtime in design mode, 200 moving during runtime in design mode, 201 personalization, websites, 189–201 web projects adding web.sitemap file to, 137–139 Web References App_WebReferences folder, 30 web requests, ASP.NET runtime, 18 web response, ASP.NET runtime, 18 Web Site Administration Tool, 230 home page, 249 membership functionality, 248 Provider tab, 249 site navigation security, 155 user roles, 156 web.config file accessing, 216 adding to web project, 208 appSettings section, 220, 221 authorization element, 153 Configuration Management API, 219–230 configuration tag, 217, 218 enabling debugging, 269, 270 encrypting configurations, 226–230 implementing Forms authentication, 241 implementing SQL Server caching, 309 order of execution of configuration files, 217 reading and examining configurations, 220–222 site navigation security, 152, 153, 154 user profile attributes/elements in, 202 web.sitemap file building site map, 135–139 configuring, 137–139 displaying dynamic content, 163 using SiteMapResolve event, 165 how it works, 135 navigation controls, 135 retrieving settings from, 148 site navigation security, 154 siteMap element, 135 siteMapNode element, 136 WebPartManager component, 191 creating Web Parts, 192 WebPartPageMenu control Beta versions, 198 WebParts controls, Toolbox, 32 WebPartZone component creating Web Parts, 192, 196 description, 191 during runtime in design mode, 200 in Design view, 193 Website menu, 24 websites adding themes, 207 building web applications, 10–17 Copy Website command, 24 debugging, 269 localization, 169 security, 235–267 authentication, 235–245 roles, 262–264 tracing at application level, 287–288 user interaction illustrated, 18 333 DelormeIndex.fm Page 334 Tuesday, November 15, 2005 10:16 AM 334 ■I N D E X WHERE clause importance of, 55 Windows authentication description, 236 Global.asax file, 237 SQL Server Express, 49 User object, 237 web.config file configuration for, 236 WindowsPrincipal object attaching to current user, 237 description, 236 Windows authentication, 236 ■X XCOPY deployment, 48, 291–296 using batch file, 294–296 using FTP, 292–294 XML refresher course for, 215 Xml control, 81 XmlSiteMapProvider attribute siteMap element, 153 ... 15, 2005 11:40 AM Beginning Visual Web Developer 2005 Express From Novice to Professional ■■■ Paul Sarknas with Rick Delorme Delorme.book Page ii Tuesday, November 15, 2005 11:40 AM Beginning Visual. .. about VWD Visual Web Developer You may be wondering where Visual Web Developer comes into play All the way back to the old versions of Visual Basic, ASP, and the like, it was always possible to build... Tuesday, November 15, 2005 11:40 AM Delorme.book Page Friday, November 11, 2005 12:29 PM CHAPTER ■■■ Introducing Visual Web Developer W elcome to Microsoft’s Visual Web Developer (VWD)! This

Ngày đăng: 20/03/2019, 11:39

Mục lục

  • Beginning Visual Web Developer 2005 Express: From Novice to Professional

    • Table of Content

    • Chapter 1 Introducing Visual Web Developer

    • Chapter 2 The Development Environment

    • Chapter 3 Introducing SQL Server Express

    • Chapter 4 Server Controls

    • Chapter 5 Master Pages, Themes, and Skins

    • Chapter 6 Working with Data Using ADO.NET

    • Chapter 7 Managing Site Navigation

    • Chapter 8 Localization

    • Chapter 9 Personalization

    • Chapter 10 Administration and Configuration

    • Chapter 11 Securing Websites

    • Chapter 12 Debugging Your Website

    • Chapter 13 Deployment

    • Chapter 14 Post Development

    • Index

Tài liệu cùng người dùng

Tài liệu liên quan