ebook img

Microsoft ASP.NET coding strategies with the Microsoft ASP.NET team PDF

319 Pages·2003·4.96 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Microsoft ASP.NET coding strategies with the Microsoft ASP.NET team

Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team by Matthew Gibbs and Rob Howard ISBN:073561900x Microsoft Press © 2003 (319 pages) This in-depth insider’s guide shares the hard-won, hard-core coding experience of the Microsoft ASP.NET development team, revealing the most productive ways to exploit ASP.NET features and functionality to build dynamic Web solutions faster. Companion Web Site Table of Contents Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team Introduction Chapter 1 - ASP.NET Page Framework Chapter 2 - Server Controls Chapter 3 - Data Controls Chapter 4 - Developing for Mobile Browsers Chapter 5 - Managing Client State Chapter 6 - Managing Application and Request State Chapter 7 - Configuration Chapter 8 - ASP.NET Security Chapter 9 - Tuning ASP.NET Performance Chapter 10 - ASP.NET Debug and Trace Chapter 11 - Moving to ASP.NET Appendix A- Tips and Tricks Appendix B- The Cassini Sample Web Server Index List of Figures List of Tables List of Code Listings List of Sidebars Microsoft ASP.NET Coding Strategies with the Microsoft Back Cover ASP.NET Team Learn the strategiesb tyh aMta dtethveewlo pGeibrsb sa ta Mndic rRoosbo fHt ouwsea rtdo build great AISSBPN.:N07E3T5 6a1p9p00lixcations—and get their sample programs! This in-depth insider’s guide shares the hard-won, hard-core coding experience of the Microsoft ASP.NET Microsoft Press © 2003 (319 pages) development team, revealing the most productive ways to exploit ASP.NET features and functionality to build dynamic Web solutioTnhsis f ains-tdere.p Fthro imns imdearx’sim giuziindge sahpaprliecsa ttihoen hscaardla-bwiloitny, ahnadrd p-ecrofroermance to designing and implementing securictoy dfienagt uerxepse, ryieonuc ege otf tthhee bMeisctr opsraocftt iAceSsP,. NpeEeTr -dteov-epleoeprm aednvtice, and reusable, real-world code to take your own Web tdeeavmel,o rpemveeanltin egx ptheert miseo stto pthroed nuecxtitv ele vweal.ys to exploit ASP.NET features and functionality to build dynamic Web solutions Discover how to: faster. Companion Web Site Reduce coding time with server controls and data controls Lear best practices for managing client, application, and request state Use output caching and partial page caching to boost program functionality and scalability Table of Contents Simplify development for mobile and handheld devices with ASP.NET mobile controls MicrosIomftp lAeSmPe.NntE Tse Ccoudriitnyg f eSatrtuatreegsi—esin wcliuthd itnhge aMuitchreonstoifcta AtioSnP,. NaEuTth Toeraizmation, impersonation, server hardening, and code access security Introduction Use debug and trace to troubleshoot bottlenecks before your site goes live Chapter 1 - ASP.NET Page Framework Know the steps for performance tuning—and where to invest your time for the biggest payoffs ChaptAenr s2we-r Stheer v“erre wCrointet roorls integrate?” question when planning application migration strategy Chapter 3 - Data Controls About the Authors Chapter 4 - Developing for Mobile Browsers Chapter 5 - Managing Client State Matthew Gibbs is a lead software design engineer on the Microsoft ASP.NET team and was part of the product tCeahmapst efor r6 Ac-tivMea Sneagrvinegr PAapgpelisc a3t.io0n, Ianntder Rneetq uInefsot rSmtaatteion Services (IIS) versions 4.0 and 5.0, Mobile Internet Toolkit, and Microsoft .Net Framework 1.1. Chapter 7 - Configuration Chapter 8 - ASP.NET Security Rob Howard is a Microsoft program manager responsible for caching, session state, and other ASP.NET inCfhraaspttreurc 9ture- Tfeuantiunrge sA.S HPe.N aElsTo P reurnfosr mthaen AcSeP.NET Web site and ASP.NET Forums, as well as speaking at cCohnafeprteenr c1e0s -anAdS Pw.rNitEinTg D beoboukgs aanndd Tarratciceles. Chapter 11 - Moving to ASP.NET Appendix A- Tips and Tricks Appendix B- The Cassini Sample Web Server Index List of Figures List of Tables List of Code Listings List of Sidebars MicrosofMt icArosSofPt A.SNP.NEETT C oCdinog dStiranteggi eSs wtirtha thtee Mgicireossoft with the ASP.NET Team Microsofbty MAatSthePw .GNibbEs aTnd RTobe Haowmard ISBN:073561900x Microsoft Press © 2003 (319 pages) Matthew Gibbs RThoisb iHn-odwepatrhd insider’s guide shares the hard-won, hard-core coding experience of the Microsoft ASP.NET development team, revealing the most productive ways to exploit ASP.NET PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, features and functionality to build dynamic Web solutions Washington 98052-6399 faster. Copyright © 2003 by MCoicmropsaonfiot nC oWrepbo rSaittieon All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by Taabnley mofe Caonns twenithtsout the written permission of the publisher. Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team InLtirbordauryct oiofn Congress Cataloging-in-Publication Data Gibbs, Matthew, 1971-Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team / Matthew Gibbs. p. cm. Includes index. ISBN 0-7356-1900-X Chapter 1 - ASP.NET Page Framework 1. Active server pages. 2. Web sites--Design. 3. Microsoft .NET. I. Howard, Rob, 1973-II. Title. Chapter 2 - Server Controls Chapter 3 - Data Controls TK5105.8885.A26G53 2003 005.2'76--dc21 2003056218 Chapter 4 - Developing for Mobile Browsers CPharipntteerd 5 an-d Mbaonuangdin ign Cthliee nUt nSitteadte States of America. Chapter 6 - Managing Application and Request State 1 2 3 4 5 6 7 8 9 QWT 8 7 6 5 4 3 Chapter 7 - Configuration Chapter 8 - ASP.NET Security Distributed in Canada by H.B. Fenn and Company Ltd. Chapter 9 - Tuning ASP.NET Performance CAha CptIPer c1a0ta-loAgSuPe.N rEeTc oDredb ufogr athnids Tbroaocke is available from the British Library. Chapter 11 - Moving to ASP.NET Microsoft Press books are available through booksellers and distributors worldwide. For further information Appendix A- Tips and Tricks about international editions, contact your local Microsoft Corporation office or contact Microsoft Press Appendix B- The Cassini Sample Web Server International directly at fax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress. Send Index comments to [email protected]. List of Figures LiIsntt eolfl iTSaebnlesse, Internet Explorer, JScript, Microsoft, Microsoft Press, MSDN, MSN, Visual Basic, Visual C++, LiVstis oufa Cl oSdtue dLiios,t iWngisndows, Windows NT, and Windows Server are either registered trademarks or Litsrta dofe Smidaerkbsar osf Microsoft Corporation in the United States and/or other countries. Other product and company names mentioned herein may be the trademarks of their respective owners. The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Acquisitions Editor: Anne Hamilton Technical Editors: Mike Fitzgerald, Robert Brunner Project Editor: Barbara Moreland Body Part No. X09-45919 About the Authors Matt Gibbs is a lead Software Design Engineer on the Microsoft ASP.NET team. Previously he was part of the product teams for Active Server Pages 3.0, Internet Information Services (IIS) versions 4.0 and 5.0, Mobile Internet Toolkit version 1.0, and Microsoft .NET Framework version 1.1. Matt has a master's degree in computer science from the University of Washington and a bachelor's degree in computer science from the University of Utah. He enjoys traveling as well as playing golf and squash. You can reach Matt at [email protected]. Rob Howard is a Program Manager on the Microsoft ASP.NET team. He has contributed to ASP.NET features such as session state, Web services, and caching as well as to many of the new features coming in ASP.NET 2.0. He also is actively involved in the ASP.NET community, working closely with groups such as ASPInsiders, Microsoft MVPs, and community user groups. You can contact Rob at Microsoft ASP.NET Coding Strategies with the Microsoft [email protected]. ASP.NET Team Acknowledgmenbtys Matthew Gibbs and Rob Howard ISBN:073561900x Microsoft Press © 2003 (319 pages) We would like to Tthhaisn ikn -thdeep ttahl einnsteidde rp’se ogupildee w seh ahraevse t hweo hrkaerdd- wwoitnh, ohna rtdh-isc obroeok. Anne Hamilton got the book going and helpedc okdeienpg iet xmpeorvieinngc.e B oaf rtbhaer aM Microorseolfat nAdS dPi.dN EaT f adnevtaeslotipcm joebn tas project editor. Technical editors Mike Fitzgerald atneda mR,o rbeevret aBlinrugn tnheer mmoasdt ep rsoudruec twivee dwidany'st lteot eexrprolorist AgSePt .tNhrEoTugh, and Ina Chang helped us features and functionality to build dynamic Web solutions learn to write better by relentlessly improving on what we did. faster. I would like to thank mCyo mwpifaen, iHone aWtheebr S, iatend my two children, Josh and Kelley, for their extreme patience and understanding while I worked on this book. I missed a lot of weekend activities with them to make this book a reality. Thanks also go to Dmitry Robsman, David Ebbo, and Shanku Niyogi, with whom I have Table of Contents worked for the past few years. I have expanded my abilities by collaborating with them on designs and by Mbicrraoinsosftto rAmSPin.Ng EaTb Couodt ipnrgo bSlteramtesg.ies with the Microsoft ASP.NET Team Introduction CMhaapttter 1 - ASP.NET Page Framework Chapter 2 - Server Controls Thanks to my family and friends for their patience with yet another book project. Chapter 3 - Data Controls CRhaopbter 4 - Developing for Mobile Browsers Chapter 5 - Managing Client State Chapter 6 - Managing Application and Request State Chapter 7 - Configuration Chapter 8 - ASP.NET Security Chapter 9 - Tuning ASP.NET Performance Chapter 10 - ASP.NET Debug and Trace Chapter 11 - Moving to ASP.NET Appendix A- Tips and Tricks Appendix B- The Cassini Sample Web Server Index List of Figures List of Tables List of Code Listings List of Sidebars IntroductMiiocronsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team by Matthew Gibbs and Rob Howard ISBN:073561900x In this book, we'll look at the ASP.NET platform for developing Web applications. We take it for granted Microsoft Press © 2003 (319 pages) that you have some experience with Microsoft ASP.NET and are looking for more ideas for tackling Web This in-depth insider’s guide shares the hard-won, hard-core development tasks and leveraging what ASP.NET has to offer. However, we'll review some of the basics coding experience of the Microsoft ASP.NET development about how the page framework and server controls work. We'll also examine the features of ASP.NET and team, revealing the most productive ways to exploit ASP.NET discuss how theyf eaaretu dreess iagnnde fdu. nLcotitosn oafl itcyo dtoe b euxialdm dpylneasm wicil lW ilelubs tsroaluteti oonusr coding strategies, and along the way we include Tfiapsst ethr.at will help you make the most of ASP.NET. Companion Web Site Prerequisites TaTbhleis obfo Cookn atsesnutms es some familiarity with HTML and Web application development. Code samples are Mwicrriottseonf ti nA SCP#.N bEuTt dCood ninogt tSytpriactaelglyie ust iwliziteh cthoem Mpilcerxo lsaonftg AuSaPg.eN EfeTa Ttueraems, so developers familiar with C/C++, InJtarovadu, cotri oMnicrosoft Visual Basic should be able to follow along without difficulty. Chapter 1 - ASP.NET Page Framework Chapter 2 - Server Controls Chapter 3 - Data Controls Chapter 4 - Developing for Mobile Browsers Chapter 5 - Managing Client State Chapter 6 - Managing Application and Request State Chapter 7 - Configuration Chapter 8 - ASP.NET Security Chapter 9 - Tuning ASP.NET Performance Chapter 10 - ASP.NET Debug and Trace Chapter 11 - Moving to ASP.NET Appendix A- Tips and Tricks Appendix B- The Cassini Sample Web Server Index List of Figures List of Tables List of Code Listings List of Sidebars Structure of This Book Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team Most of the chaptbeyr sM inat tthhiesw b Gooibkb,s w ahnidch R dobis cHuoswsa vrda rious ASP.NIESBTN f:0e7a3t5u6r1e9s00 axnd development topics, are freestanding-thatM isic, ryoosuo fdt oPnre'ts hsa ©v 2e0 0to3 (r3e1a9 dpa tghees) chapters in order. Throughout we include Tips and Notes to help you leverageT hAisS Pin.-NdeEpTt hin i ndseidveerl’osp ginugid ed ysnhaamreisc tWhee hba ardp-pwliocna,t ihoanrsd. -Wcoere created these Notes based on our experiences dcoedveinlgo peixnpge ArieSnPc.eN oEfT t haen dM iocrno sooufrt wASoPrk.N wEiTth d ceuvsetloopmmeernst, in which we explored the challenges of cretaetainmg, lraervgeea lainngd t shme malol Wst epbro sdiutecsti,v ae sw wayesll taos e sxiptelosi ti nAtSenP.dNeEdT for access by internal features and functionality to build dynamic Web solutions corporate groups and by the general public. faster. Companion Web Site Table of Contents Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team Introduction Chapter 1 - ASP.NET Page Framework Chapter 2 - Server Controls Chapter 3 - Data Controls Chapter 4 - Developing for Mobile Browsers Chapter 5 - Managing Client State Chapter 6 - Managing Application and Request State Chapter 7 - Configuration Chapter 8 - ASP.NET Security Chapter 9 - Tuning ASP.NET Performance Chapter 10 - ASP.NET Debug and Trace Chapter 11 - Moving to ASP.NET Appendix A- Tips and Tricks Appendix B- The Cassini Sample Web Server Index List of Figures List of Tables List of Code Listings List of Sidebars Sample Files Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team The complete setb oy fM saatmthpewle Gcoibdbes caannd Rbeob d Howownalorad ded from theIS bBNo:o07k3’s5 6W19e00bx site (http://www.microMsoicfrto.csoomft /Pmresspsr e©s 2s0/0b3o (o31k9s p/6ag5e7s)8.asp). Click Companion Content in the More Information box on the right sTidheis o inf -thdeisp ptha gines itdoe br’rsi nggu iudpe tshhea rCeso mthpea hnaiordn- wCoonn,t ehanrt dp-acogree.Following the structure of the book, the code sacomdpinlegs e axrpee roiergnacen iozfe tdh ein tMoi car osseotf to Af cShPa.NpEteT rd seuvbedloirpemcetonrties, making it easy to create a virtual directory atneda mtry, roeuvte tahlien gc othdee mono syto purro douwcnti vmea wcahyinse t.o exploit ASP.NET features and functionality to build dynamic Web solutions faster. Companion Web Site Table of Contents Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team Introduction Chapter 1 - ASP.NET Page Framework Chapter 2 - Server Controls Chapter 3 - Data Controls Chapter 4 - Developing for Mobile Browsers Chapter 5 - Managing Client State Chapter 6 - Managing Application and Request State Chapter 7 - Configuration Chapter 8 - ASP.NET Security Chapter 9 - Tuning ASP.NET Performance Chapter 10 - ASP.NET Debug and Trace Chapter 11 - Moving to ASP.NET Appendix A- Tips and Tricks Appendix B- The Cassini Sample Web Server Index List of Figures List of Tables List of Code Listings List of Sidebars Software Needed to Run the Samples Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team The .NET Framebwyo Mrka SttDheKw, wGhibicbhs ainncdl uRdoebs H AoSwPa.rNd ET, is requirIeSdBN t:o0 7r3u5n61 t9h0e0x sample code. ASP.NET requires either MiMcricorsoosfotf Wt Pirnedsosw ©s 2 020030 (031,9 M paicgreos)soft Windows XP Professional, or Microsoft Windows Server 2003. You can usTeh iMs iicnr-odseopftth W inisniddoerw’ss gXuPid He oshmaere Es dthiteio nha frodr- wdeovne, lhoaprmd-ecnotr,e but Microsoft Internet Information Serviccoedsi n(IgIS e)x ipse nrioetn acev aoifla tbhlee Mfoicrr tohsaotf tp AlaStPfo.NrmET. Adnev aelltoeprmnaetnivte is to use a development Web server. The .NETt eFarmam, reewvoearklin SgD thKe c mano sbte p rdoodwunctliovaed weady fso tro f reexep lforoitm AS hPt.tpN:E//Tgo.microsoft.com/fwlink/? features and functionality to build dynamic Web solutions linkid=8862. faster. Companion Web Site Table of Contents Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team Introduction Chapter 1 - ASP.NET Page Framework Chapter 2 - Server Controls Chapter 3 - Data Controls Chapter 4 - Developing for Mobile Browsers Chapter 5 - Managing Client State Chapter 6 - Managing Application and Request State Chapter 7 - Configuration Chapter 8 - ASP.NET Security Chapter 9 - Tuning ASP.NET Performance Chapter 10 - ASP.NET Debug and Trace Chapter 11 - Moving to ASP.NET Appendix A- Tips and Tricks Appendix B- The Cassini Sample Web Server Index List of Figures List of Tables List of Code Listings List of Sidebars Creating an IIS Virtual Directory Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team ASP.NET handlebsy r eMqauttehsetws iGssibubesd a tnod a R Wobe Hb oswearvrde r, which is tyISpBicNa:0ll7y3 5II6S1 9o0n0x the Microsoft Windows platform. If you arMei curosisnogft V Pirseusasl ©S 2tu00d3io (3 t1o9 pcargeeas)te Web pages, Visual Studio will automatically create a virtual directory foTrh yiso uin.- dWehptehn inussiidnegr ’tsh egu .iNdEe Tsh Farraesm tehwe ohrakr dw-iwthoonu,t hVairsdu-acol Sretudio, you will need to create a virtual directory ucnoledsinsg y eoxup aerriee nucsein ogf tthhee dMeicfraouslot fWt AeSbP s.NiteE Tp dheyvseicloapl mdierencttory. team, revealing the most productive ways to exploit ASP.NET To set up an IIS vfiertautaurl edsi raencdto fruyn fcotrio AnSalPity.N tEo Tb,u yilodu d mynuasmt ifcir sWt ehba vsoel uat idoinresctory on disk to be used for the faster. application. Of course, we assume that you also have IIS and the .NET Framework installed. In this example, we'll use a sCaommpplaen dioinre Wcteobry S citreeated at C:\SampleApplication. To create the IIS virtual directory, perform the following steps: 1. On Windows 2000, select Programs from the Start menu, and then select Administrative Tools and Table of Contents Internet Services Manager. If you are using Windows XP, select Control Panel from the Start menu. Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team Choose Performance And Maintenance, Administrative Tools, and then Internet Information Introduction Services. Alternatively, you can type inetmgr at the prompt you see after selecting Run from the Chapter 1 - ASP.NET Page Framework Start menu. Chapter 2 - Server Controls Chap2te.r E3xp-aDnadt ath Ceo lnotcraolls computer node followed by the Web Sites node. Chapter 4 - Developing for Mobile Browsers 3. Right-click the Default Web Site node. Select New and then Virtual Directory from the expanded Chapter 5 - Managing Client State menu. Chapter 6 - Managing Application and Request State Chapter 7 - Configuration 4. On the first page of the Virtual Directory Creation Wizard, click Next. Then enter the alias for the Chapter 8 - ASP.NET Security application, which will be part of the URL path used to access the Web pages of the new Chapter a9pp-liTcuantiionng. AFSoPr .eNxEaTm Ppelrefo, rymoaun wceould type SampleApplication and the URL to get to the application Chapter f1r0om- AthSaP.t NmETa cDheinbeu:g h atntpd: /T/loraccaelhost/SampleApplication. Click Next to continue. Chapter 11 - Moving to ASP.NET Appe5n.dixE Ant-erT itphse a pnhdy Tsricicakls location where the Web application will exist. In our example, we would use C:\SampleApplication. Click Next to get to the Access Permission page. Appendix B- The Cassini Sample Web Server Index 6. Many any necessary changes to the security for the application. See Chapter 9 for detailed List of Figures information about security considerations. Click Next and then click Finish. List of Tables LiTsth eof IICSo dVeir tLuisatli nDgisrectory now exists, and .ASPX pages that you place in the physical location Li(sCt :o\Sf SamidepblearAspplication) are accessible from the newly created virtual directory at http://MachineName/SampleApplication. Web.config Code Samples Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team Many of the discubsys iMonatst hine wth Gisi bbboso akn edv Roolvbe Haorwouanrdd configuratioISnB sNe:0t7ti3n5g6s19 p00laxced in configuration files. The configuration dataM iiscr ionshoeftr itPerdes fsr o©m 20 a03p (p3l1ic9 aptaigoens) roots that already exist in the Web address. For example, consider the samTphleis UinR-dLe hpttthp :in//sloidcearl’hso gsut/idSeo msheaArepsp tlihcea thioanrd/p-wagone,. ahsaprxd-. cSooreme configuration data specified in the machine.cocnofdigin gfi leex cpaenri ebnec eo voef rtrhided Menic rinos ao fwt eAbS.Pc.oNnEfTig d feilvee lpolpamceedn tin the physical directory of the Default Web Sitet. eAagma,i nre, vine athlineg S tohme meAopstp plicroadtiuocnt idvier ewcatoyrsy t,o s eexttpinlogist AcSaPn. NbEeT modified in a web.config file. features and functionality to build dynamic Web solutions faster. To avoid a lot of code samples being named web.config, throughout the book we have used more descriptive names forC coomnpfiagnuiroant ioWne bfi leSist.e When using the sample .config files, remember to rename them to web.config, or the sample .ASPX pages will not behave as expected. Table of Contents Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team Introduction Chapter 1 - ASP.NET Page Framework Chapter 2 - Server Controls Chapter 3 - Data Controls Chapter 4 - Developing for Mobile Browsers Chapter 5 - Managing Client State Chapter 6 - Managing Application and Request State Chapter 7 - Configuration Chapter 8 - ASP.NET Security Chapter 9 - Tuning ASP.NET Performance Chapter 10 - ASP.NET Debug and Trace Chapter 11 - Moving to ASP.NET Appendix A- Tips and Tricks Appendix B- The Cassini Sample Web Server Index List of Figures List of Tables List of Code Listings List of Sidebars

Description:
Lot of good theories, i wouldn't casll it a book of "strategies" though, the BIGGEST turn off is the sample-code, it only ships with .aspx page, no code-behind!!!!!!!!!!! It's all in-line coding (tradition ASP style) and you can not debug anything since there is no solution!!!! If you let IDE handle
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.