ProASP.
NET3.
5inVB2008IncludesSilverlight2MatthewMacDonald,MarioSzpuszta,andVidyaVratAgarwalProASP.
NET3.
5inVB2008:IncludesSilverlight2Copyright2009byMatthewMacDonald,MarioSzpuszta,andVidyaVratAgarwalAllrightsreserved.
Nopartofthisworkmaybereproducedortransmittedinanyformorbyanymeans,electronicormechanical,includingphotocopying,recording,orbyanyinformationstorageorretrievalsystem,withoutthepriorwrittenpermissionofthecopyrightownerandthepublisher.
ISBN-13(paperback):978-1-4302-1630-8ISBN-13(electronic):978-1-4302-1631-5PrintedandboundintheUnitedStatesofAmerica987654321Trademarkednamesmayappearinthisbook.
Ratherthanuseatrademarksymbolwitheveryoccurrenceofatrademarkedname,weusethenamesonlyinaneditorialfashionandtothebenefitofthetrademarkowner,withnointentionofinfringementofthetrademark.
LeadEditor:DominicShakeshaftTechnicalReviewer:DamienFoggonEditorialBoard:ClayAndres,SteveAnglin,MarkBeckner,EwanBuckingham,TonyCampbell,GaryCornell,JonathanGennick,JonathanHassell,MichelleLowman,MatthewMoodie,DuncanParkes,JeffreyPepper,DouglasPundick,FrankPohlmann,BenRenow-Clarke,DominicShakeshaft,MattWade,TomWelshProductionDirector|ProjectManager:GraceWongCopyEditor:KimWimpsettAssociateProductionDirector:KariBrooks-CoponySeniorProductionEditor:LauraCheuCompositor:KineticPublishingServices,LLCProofreader:LizWelch,LisaHamiltonIndexer:BroccoliInformationManagementCoverDesigner:KurtKramesManufacturingDirector:TomDebolskiDistributedtothebooktradeworldwidebySpringer-VerlagNewYork,Inc.
,233SpringStreet,6thFloor,NewYork,NY10013.
Phone1-800-SPRINGER,fax201-348-4505,e-mailkn`ano)juSettings196ReadingandWritingConfigurationSectionsProgrammatically.
.
.
201TheWebsiteAdministrationTool(WAT)204ExtendingtheConfigurationFileStructure206EncryptingConfigurationSections211NCONTENTSxi.
NETComponents212CreatingaComponent.
213UsingaComponentThroughtheApp_CodeDirectory215UsingaComponentThroughtheBinDirectory.
216ExtendingtheHTTPPipeline219HTTPHandlersandHTTPModules219CreatingaCustomHTTPHandler221ConfiguringaCustomHTTPHandler222RegisteringHTTPHandlersWithoutConfiguringIIS.
224CreatinganAdvancedHTTPHandler225CreatinganHTTPHandlerforNon-HTMLContent.
227CreatingaCustomHTTPModule230Summary.
233CHAPTER6StateManagement.
235ASP.
NETStateManagement235ViewState.
238AViewStateExample238StoringObjectsinViewState.
240RetainingMemberVariables243AssessingViewState244ViewStateSecurity246TransferringInformationBetweenPages247TheQueryString247UsingtheQueryString248URLEncoding249Cross-PagePosting249GettingPage-SpecificInformation251PerformingCross-PagePostinginAnyEventHandler.
252TheIsPostBackandIsCrossPagePostBackProperties.
253Cross-PagePostingandValidation.
254Cookies256SessionState258SessionArchitecture258UsingSessionState.
260ConfiguringSessionState261Mode262Cookieless.
266Timeout268SecuringSessionState.
268NCONTENTSxiiApplicationState269StaticApplicationVariables271Summary.
273PART2NNNDataAccessCHAPTER7ADO.
NETFundamentals.
277TheADO.
NETArchitecture278ADO.
NETDataProviders.
279StandardizationinADO.
NET.
281SQLServer2005282FundamentalADO.
NETClasses.
282TheConnectionClass284ConnectionStrings.
284TestingaConnection.
285ConnectionPooling287ConnectionStatistics.
289TheCommandandDataReaderClasses290CommandBasics.
290TheDataReaderClass.
291TheExecuteReader()MethodandtheDataReader292TheExecuteScalar()Method298TheExecuteNonQuery()Method299SQLInjectionAttacks299UsingParameterizedCommands303CallingStoredProcedures304Transactions.
307TransactionsandASP.
NETApplications308IsolationLevels.
313Savepoints.
315Provider-AgnosticCode316CreatingtheFactory316CreateObjectswithFactory.
317AQuerywithProvider-AgnosticCode.
318Summary.
320CHAPTER8DataComponentsandtheDataSet321BuildingaDataAccessComponent321TheDataPackage323NCONTENTSxiiiTheStoredProcedures324TheDataUtilityClass325TestingtheDatabaseComponent.
331DisconnectedData333WebApplicationsandtheDataSet335XMLIntegration335TheDataSet336TheDataAdapterClass337FillingaDataSet.
339WorkingwithMultipleTablesandRelationships340SearchingforSpecificRows344UsingtheDataSetinaDataAccessClass.
344DataBinding345TheDataViewClass.
346SortingwithaDataView346FilteringwithaDataView348AdvancedFilteringwithRelationships350CalculatedColumns.
351TypedDataSets354CustomTableAdapters355CreatingaTypedDataSet.
356DissectingtheTypedDataSet357UsingtheTypedDataSet360Summary.
362CHAPTER9DataBinding.
363BasicDataBinding364Single-ValueBinding.
364OtherTypesofExpressions367Repeated-ValueBinding371DataSourceControls379ThePageLifeCyclewithDataBinding380TheSqlDataSource381SelectingRecords382ParameterizedCommands.
385HandlingErrors.
390UpdatingRecords.
391DeletingRecords395InsertingRecords.
396DisadvantagesoftheSqlDataSource397NCONTENTSxivTheObjectDataSource398SelectingRecords399UpdatingRecords.
404UpdatingwithaDataObject405TheLimitsoftheDataSourceControls.
410TheProblem410AddingtheExtraItems411HandlingtheExtraOptionswiththeSqlDataSource412HandlingtheExtraOptionswiththeObjectDataSource412Summary.
413CHAPTER10RichDataControls415TheGridView416DefiningColumns.
416FormattingtheGridView.
421FormattingFields421Styles422Formatting-SpecificValues426GridViewRowSelection428UsingSelectiontoCreateaMaster-DetailsForm.
430TheSelectedIndexChangedEvent.
431UsingaDataFieldAsaSelectButton432SortingtheGridView433SortingwiththeSqlDataSource.
433SortingwiththeObjectDataSource.
434SortingandSelection436AdvancedSorting.
437PagingtheGridView438AutomaticPaging.
439CustomPaginationwiththeObjectDataSource440CustomizingthePagerBar.
444GridViewTemplates445UsingMultipleTemplates.
448EditingTemplatesinVisualStudio448BindingtoaMethod449HandlingEventsinaTemplate451EditingwithaTemplate452TheListView459Grouping462Paging464NCONTENTSxvTheDetailsViewandFormView.
465TheDetailsView466TheFormView.
470AdvancedGrids472SummariesintheGridView472AParent/ChildViewinaSingleTable.
474EditingaFieldUsingaLookupTable477ServingImagesfromaDatabase479DetectingConcurrencyConflicts.
485Summary.
490CHAPTER11CachingandAsynchronousPages.
491UnderstandingASP.
NETCaching491OutputCaching492DeclarativeOutputCaching493CachingandtheQueryString494CachingwithSpecificQueryStringParameters.
495CustomCachingControl496CachingwiththeHttpCachePolicyClass497Post-CacheSubstitutionandFragmentCaching498CacheProfiles.
501CacheConfiguration502DataCaching503AddingItemstotheCache504ASimpleCacheTest506CachePriorities507CachingwiththeDataSourceControls508CacheDependencies511FileandCacheItemDependencies.
512AggregateDependencies513TheItemRemovedCallback.
514UnderstandingSQLCacheNotifications.
516CacheNotificationsinSQLServer2000andSQLServer7517CacheNotificationsinSQLServer2005andSQLServer2008.
.
.
522CustomCacheDependencies525ABasicCustomCacheDependency.
525ACustomCacheDependencyUsingMessageQueues.
526AsynchronousPages.
529CreatinganAsynchronousPage530QueryingDatainanAsynchronousPage.
532NCONTENTSxviHandlingErrors.
534UsingCachingwithAsynchronousTasks537MultipleAsynchronousTasksandTimeouts.
539Summary.
541CHAPTER12FilesandStreams.
543WorkingwiththeFileSystem543TheDirectoryandFileClasses544TheDirectoryInfoandFileInfoClasses.
546TheDriveInfoClass549WorkingwithAttributes.
550FilterFileswithWildcards.
552RetrievingFileVersionInformation.
553ThePathClass554AFileBrowser.
556ReadingandWritingFileswithStreams561TextFiles563BinaryFiles564UploadingFiles.
565MakingFilesSafeforMultipleUsers568Compression.
572Serialization573Summary.
577CHAPTER13LINQ.
579LINQBasics.
580DeferredExecution581HowLINQWorks582LINQExpressions583LINQExpressions"UndertheHood"590LINQtoDataSet593TypedDataSets595Nothing596LINQtoSQL597DataEntityClasses598TheDataContext.
600LINQtoSQLQueries"UndertheHood"602LINQtoSQLandDatabaseComponents606SelectingaSingleRecordorValue.
609NCONTENTSxviixviiGeneratingDataClassesAutomatically610Relationships616GeneratingMethodsforStoredProcedures629CommittingChanges.
631TheLinqDataSource638DisplayingData638GettingRelatedData642EditingData.
642Validation.
643Summary.
646CHAPTER14XML647WhenDoesUsingXMLMakeSense647AnIntroductiontoXML648TheAdvantagesofXML649Well-FormedXML650XMLNamespaces651XMLSchemas.
653Stream-BasedXMLProcessing.
654WritingXMLFiles.
655ReadingXMLFiles659In-MemoryXMLProcessing.
663TheXmlDocument664TheXPathNavigator.
668TheXDocument671SearchingXMLContent677SearchingwithXmlDocument677SearchingXDocumentwithLINQ682ValidatingXMLContent.
684ABasicSchema684ValidatingwithXmlDocument685ValidatingwithXDocument687TransformingXMLContent687ABasicStylesheet688UsingXslCompiledTransform.
689UsingtheXmlControl691TransformingXMLwithLINQtoXML691XMLDataBinding693NonhierarchicalBinding694UsingXPath.
696NCONTENTSxviiiNestedGrids698HierarchicalBindingwiththeTreeView700UsingXSLT702BindingtoXMLContentfromOtherSources704UpdatingXMLThroughtheXmlDataSource705XMLandtheADO.
NETDataSet.
705ConvertingtheDataSettoXML706AccessingaDataSetAsXML.
708Summary.
710PART3NNNBuildingASP.
NETWebsitesCHAPTER15UserControls715UserControlBasics.
716CreatingaSimpleUserControl716ConvertingaPagetoaUserControl.
718AddingCodetoaUserControl719HandlingEvents719AddingProperties.
720UsingCustomObjects.
722AddingEvents.
726ExposingtheInnerWebControls729DynamicallyLoadingUserControls730PortalFrameworks.
731PartialPageCaching.
734VaryByControl735SharingCachedControls737Summary.
737CHAPTER16ThemesandMasterPages739CascadingStyleSheets739CreatingaStylesheet740ApplyingStylesheetRules742Themes745ThemeFoldersandSkins.
746ApplyingaSimpleTheme.
747HandlingThemeConflicts.
748CreatingMultipleSkinsfortheSameControl.
749NCONTENTSxixSkinswithTemplatesandImages750UsingCSSinaTheme.
752ApplyingThemesThroughaConfigurationFile753ApplyingThemesDynamically.
754StandardizingWebsiteLayout.
756MasterPageBasics.
757ASimpleMasterPage.
757ASimpleContentPage760DefaultContent.
762MasterPageswithTablesandCSSLayout.
762MasterPagesandRelativePaths765ApplyingMasterPagesThroughaConfigurationFile766AdvancedMasterPages.
767InteractingwiththeMasterPageClass767DynamicallySettingaMasterPage769NestingMasterPages769Summary.
771CHAPTER17WebsiteNavigation773PageswithMultipleViews773TheMultiViewControl774TheWizardControl779SiteMaps788DefiningaSiteMap789BindingtoaSiteMap791Breadcrumbs792ShowingaPortionoftheSiteMap794TheSiteMapObjects798AddingCustomSiteMapInformation.
800CreatingaCustomSiteMapProvider.
801URLMapping808SecurityTrimming809TheTreeViewControl811TheTreeNode812PopulatingNodesonDemand815TreeViewStyles816TheMenuControl821MenuStyles824MenuTemplates.
825Summary.
827NCONTENTSxxCHAPTER18WebsiteDeployment829InternetInformationServices(IIS)829IISWebsitesandVirtualDirectories830IISManagementConsoleandIISConfiguration831MappingWebsites,VirtualDirectories,andFilestoURLs833DivingintotheArchitectureofIIS835InstallingIIS.
853ManagingWebsites.
860ManagingVirtualDirectoriesandWebsiteswithIIS5.
xandIIS6.
0861ManagingApplicationPoolsinIIS6.
0868ManagingVirtualDirectoriesandWebsiteswithIIS7.
0876ManagingApplicationPoolsinIIS7.
0889DeployingYourASP.
NETApplications892VerifyingtheASP.
NETInstallationonIIS5.
xandIIS6.
0.
893ASP.
NETSide-By-SideExecutiononIIS5.
xandIIS6.
0895ASP.
NETSide-By-SideExecutiononIIS7.
0896ConfiguringHTTPRuntimeSettingswhenDeployingonIIS5.
x897CompilationModelsinASP.
NET898DeployingwithVisualStudio902VisualStudio2005WebDeploymentProjects904TheVirtualPathProviderinASP.
NET911HealthMonitoringinASP.
NET916UnderstandingtheBasicStructure.
916EventsandProviders.
917Summary.
921PART4NNNSecurityCHAPTER19TheASP.
NETSecurityModel925WhatItMeanstoCreateSecureSoftware925UnderstandingPotentialThreats926SecureCodingGuidelines.
927UnderstandingGatekeepers.
928UnderstandingtheLevelsofSecurity.
929Authentication.
929Authorization.
931NCONTENTSxxiConfidentialityandIntegrity932PullingItAllTogether932InternetInformationServicesSecurity.
934AuthenticationandAuthorizationonIIS5.
xandIIS6.
0935SecurityConfigurationonIIS7.
0.
938UnderstandingSecureSocketsLayer.
944ASP.
NETSecurityArchitecture955Authentication.
957Authorization.
958TheSecurityContext959MembershipandRolesAPIs.
961Summary.
962CHAPTER20FormsAuthentication.
963IntroducingFormsAuthentication.
963WhyUseFormsAuthentication965WhyWouldYouNotUseFormsAuthentication966WhyNotImplementCookieAuthenticationYourself968TheFormsAuthenticationClasses969ImplementingFormsAuthentication969ConfiguringFormsAuthentication.
970DenyingAccesstoAnonymousUsers973CreatingaCustomLoginPage974CustomCredentialsStore.
981PersistentCookiesinFormsAuthentication982IIS7.
0andFormsAuthentication983Summary.
989CHAPTER21Membership991IntroducingtheASP.
NETMembershipAPI991UsingtheMembershipAPI.
994ConfiguringFormsAuthentication.
996CreatingtheDataStore.
997ConfiguringConnectionStringandMembershipProvider1003CreatingandAuthenticatingUsers1007UsingtheSecurityControls1009TheLoginControl.
1011TheLoginStatusControl1022TheLoginViewControl1023NCONTENTSxxiiThePasswordRecoveryControl.
1024TheChangePasswordControl1029TheCreateUserWizardControl.
1030ConfiguringMembershipinIIS7.
0.
1035ConfiguringProvidersandUsers.
1036UsingtheMembershipAPIwithOtherApplications.
1038UsingtheMembershipClass.
1040RetrievingUsersfromtheStore1041UpdatingUsersintheStore1044CreatingandDeletingUsers.
1044ValidatingUsers1045UsingMembershipinWindowsForms.
1046Summary.
1048CHAPTER22WindowsAuthentication.
1049IntroducingWindowsAuthentication1049WhyUseWindowsAuthentication1050WhyWouldYouNotUseWindowsAuthentication1051MechanismsforWindowsAuthentication1052ImplementingWindowsAuthentication1060ConfiguringIIS5.
xorIIS6.
01060ConfiguringIIS7.
01062ConfiguringASP.
NET.
1064DenyingAccesstoAnonymousUsers1068AccessingWindowsUserInformation1070Impersonation.
1075ImpersonationinWindows2000.
1076ImpersonationonWindowsXP1077ImpersonationandDelegationonWindowsServer2003.
1078ImpersonationonWindowsVista1081ImpersonationandDelegationonWindowsServer2008.
1082ConfiguredImpersonation1082ProgrammaticImpersonation.
1085Summary.
1088CHAPTER23AuthorizationandRoles1089URLAuthorization1089AuthorizationRules1090FileAuthorization.
1096NCONTENTSxxiiiAuthorizationChecksinCode1097UsingtheIsInRole()Method1097UsingthePrincipalPermissionClass.
1098UsingtheRolesAPIforRole-BasedAuthorization1100UsingtheLoginViewControlwithRoles.
1107AccessingRolesProgrammatically.
1108UsingtheRolesAPIwithWindowsAuthentication.
1111ProtectingNon-ASP.
NETResourcesinIIS5and61113AddingaFileTypeMapping.
1114WritingaCustomHTTPHandler1116AuthorizationandRolesinIIS7.
0.
1118AuthorizationwithASP.
NETRolesinIIS7.
01121ManagingASP.
NETRoleswithIIS7.
01123Summary.
1125CHAPTER24Profiles.
1127UnderstandingProfiles1127ProfilePerformance.
1128HowProfilesStoreData1129ProfilesandAuthentication.
1130Profilesvs.
CustomDataComponents.
1130UsingtheSqlProfileProvider.
1131CreatingtheProfileTables1131ConfiguringtheProvider.
1134DefiningProfileProperties1134UsingProfileProperties.
1135ProfileSerialization1137ProfileGroups.
1139ProfilesandCustomDataTypes1140TheProfilesAPI1143AnonymousProfiles.
1146CustomProfileProviders1149TheCustomProfileProviderClasses1149DesigningtheFactoredProfileProvider.
1151CodingtheFactoredProfileProvider.
1153TestingtheFactoredProfileProvider1157Summary.
1161NCONTENTSxxivCHAPTER25Cryptography.
1163EncryptingData:ConfidentialityMatters1163The.
NETCryptographyNamespace.
1164Understandingthe.
NETCryptographyClasses1168SymmetricEncryptionAlgorithms.
1169AsymmetricEncryption.
1170TheAbstractEncryptionClasses.
1171TheICryptoTransformInterface.
1172TheCryptoStreamClass1173EncryptingSensitiveData1174ManagingSecrets1174UsingSymmetricAlgorithms1176UsingAsymmetricAlgorithms1182EncryptingSensitiveDatainaDatabase.
1185EncryptingtheQueryString.
1189WrappingtheQueryString.
1189CreatingaTestPage1193Summary.
1194CHAPTER26CustomMembershipProviders1195ArchitectureofCustomProviders.
1196BasicStepsforCreatingCustomProviders.
1197OverallDesignoftheCustomProvider.
1198DesigningandImplementingtheCustomStore.
1199ImplementingtheProviderClasses1206UsingtheCustomProviderClasses1227Summary.
1232PART5NNNAdvancedUserInterfaceCHAPTER27CustomServerControls1237CustomServerControlBasics.
1237CreatingaBare-BonesCustomControl1238UsingaCustomControl1240CustomControlsintheToolbox.
1241CreatingaWebControlThatSupportsStyleProperties1243TheRenderingProcess.
1247NCONTENTSxxvDealingwithDifferentBrowsers1249TheHtmlTextWriter1249BrowserDetection1250BrowserProperties1252OverridingBrowserTypeDetection1254AdaptiveRendering1255ControlStateandEvents1257ViewState1258ControlState.
1260PostbackDataandChangeEvents.
1261TriggeringaPostback1264ExtendingExistingWebControls.
1266CompositeControls1267DerivedControls.
1270TemplateControls1273CreatingaTemplateControl1273UsingCustomizedTemplates.
1276Styles1281Summary.
1284CHAPTER28Design-TimeSupport1285TheKeyPlayers1285Design-TimeAttributes.
1286ThePropertiesWindow.
1287AttributesandInheritance1292TheToolboxIcon1292WebResources1294CreatingaResource1294RetrievingaResource1295TextSubstitution1296CodeSerialization1297TypeConverters1297SerializationAttributes1306TypeEditors1308ControlDesigners1311Design-TimeHTML1312SmartTags1314Summary.
1320NCONTENTSxxviCHAPTER29DynamicGraphicsandGDI+1321TheImageMapControl1321CreatingHotspots.
1322HandlingHotspotClicks1324ACustomHotspot1325DrawingwithGDI+1327SimpleDrawing1328ImageFormatandQuality1330TheGraphicsClass1332UsingaGraphicsPath1334Pens1335Brushes1338EmbeddingDynamicGraphicsinaWebPage1340UsingthePNGFormat.
1341PassingInformationtoDynamicImages1342CustomControlsThatUseGDI+1345ChartingwithGDI+1351Summary.
1356CHAPTER30PortalswithWebPartPages1357TypicalPortalPages1358BasicWebPartPages.
1360CreatingthePageDesign.
1361WebPartManagerandWebPartZoneControls.
1362AddingWebPartstothePage1364CustomizingthePage1368CreatingWebParts1371SimpleWebPartTasks.
1371DevelopingAdvancedWebParts.
1380WebPartEditors.
1390ConnectingWebParts.
1396CustomVerbsandWebParts1405UserControlsandAdvancedWebParts.
1406UploadingWebPartsDynamically.
1410AuthorizingWebParts.
1416FinalTasksforPersonalization1417Summary.
1418NCONTENTSxxviiPART6NNNClient-SideProgrammingCHAPTER31JavaScriptandAjaxTechniques.
1421JavaScriptEssentials1421TheHTMLDocumentObjectModel1422Client-SideEvents1423ScriptBlocks.
1426ManipulatingHTMLElements1427DebuggingJavaScript.
1429BasicJavaScriptExamples1431CreatingaJavaScriptPageProcessor1431UsingJavaScripttoDownloadImagesAsynchronously1435RenderingScriptBlocks1440ScriptInjectionAttacks.
1442RequestValidation1442DisablingRequestValidation1443CustomControlswithJavaScript1445Pop-UpWindows1445RolloverButtons.
1450Frames.
1454FrameNavigation.
1454InlineFrames1456UnderstandingAjax1458TheXMLHttpRequestObject1459AnAjaxExample.
1461UsingAjaxwithClientCallbacks.
1466CreatingaClientCallback1466ClientCallbacks"UndertheHood"1473ClientCallbacksinCustomControls.
1474Summary.
1478CHAPTER32ASP.
NETAJAX.
1479IntroducingASP.
NETAJAX.
1479ASP.
NETAJAXontheClient:TheScriptLibraries1481ASP.
NETAJAXontheServer:TheScriptManager1482ServerCallbacks1483WebServicesinASP.
NETAJAX.
1484TheWebServiceProxy1491NCONTENTSxxviiiPlacingaWebMethodinaPage.
1493ASP.
NETAJAXApplicationServices1494ASP.
NETAJAXServerControls1502PartialRenderingwiththeUpdatePanel.
1502TimedRefresheswiththeTimer1511Time-ConsumingUpdateswithUpdateProgress1512DeeperintotheClientLibraries.
1515UnderstandingtheClientModel1516Object-OrientedProgramminginJavaScript.
1517TheWeb-PageFramework.
1526ControlExtenders1531InstallingtheASP.
NETAJAXControlToolkit1532TheAutoCompleteExtender1533TheASP.
NETAJAXControlToolkit1536Summary.
1540CHAPTER33Silverlight2.
1541UnderstandingSilverlight1541Silverlightvs.
Flash1543SilverlightSystemRequirements1545InstallingtheSilverlightToolsforVisualStudio1546CreatingaSilverlightSolution1547SilverlightCompilation1548EntryPages.
1550CreatingaSilverlightProject1556DesigningaSilverlightPage.
1557UnderstandingXAML.
1560SettingProperties.
1562TheXAMLCode-Behind1563HandlingEvents1564BrowsingtheSilverlightClassLibraries.
1566Layout1567TheCanvas1567TheGrid.
1573NCONTENTSxxixAnimation1578AnimationBasics1579DefininganAnimation.
1579TheStoryboardClass1580AnInteractiveAnimationExample.
1583Transforms1587SilverlightandASP.
NET1591UsingWebServiceswithSilverlight1592TheMediaPlayerControl.
1598Summary.
1602INDEX.
1603xxxiAbouttheAuthorsNMATTHEWMACDONALDisanauthor,educator,andMicrosoftMVP.
He'saregularcontributortoprogrammingjournalsandtheauthorofmorethanadozenbooksabout.
NETprogramming,includingProSilverlight2inC#2008(Apress,2008),ProWPFinC#2008(Apress,2008),andBeginningASP.
NET3.
5inC#2008(Apress,2007).
HelivesinTorontowithhiswifeandtwodaughters.
NMARIOSZPUSZTAworksasanarchitectintheDeveloperandPlatformGroupofMicrosoftAustriaandhelpssoftwarearchitectsoftopenterpriseandwebcustomerswithestablishingnewMicrosofttechnologies.
Forseveralyears,hehasbeenfocusingonsecuresoftwaredevelopment,webservicesandinteroperability,andtheintegrationofMicrosoftOfficeclientsandserversincustomapplications.
Mariospeaksregularlyatlocalandinter-nationalconferences,suchasDevDaysandTechEdEuropeDevelopers,andhasbeenatechnicalcontentownerofTechEdEuropeDevelopersforthepasttwoyears.
NVIDYAVRATAGARWAL—aMicrosoft.
NETpuristandanMCT,MCPD,MCTS,MCSD.
NET,MCAD.
NET,andMCSD—workswithLionbridgeTechnologies(NASDAQ:LIOX).
HeisalsoalifetimememberoftheCom-puterSocietyofIndia(CSI).
HestartedworkingonMicrosoft.
NETwithitsbetarelease.
Hehasbeeninvolvedinsoftwaredevelopment,evan-gelism,consultation,corporatetraining,andT3programsonMicrosoft.
NETforvariousemployersandcorporateclients.
HeisthecoauthorofBeginningC#2008Databases:FromNovicetoProfessionalandBeginningVB2008Databases:FromNovicetoProfessionalandhasbeenthetechni-calreviewerofmanyotherbookspublishedbyApress.
Heliveswithhisbelovedwife,Rupali,andlovelydaughter,Vamika("Pearly").
Hebelievesthatnothingwillturnintoarealitywithoutthem.
Heisthefolloweroftheconcept"nopain,nogain"andbelievesthathiswifeishisgreateststrength.
Heblogsatdppl6++`kpjapl]ooekj*^hkcolkp*_ki;youcanreachhimatre`u][i_pxxxiiiAbouttheTechnicalReviewerNDAMIENFOGGONisafreelancedeveloperandtechnicalauthorbasedinNewcastle,England.
WhilenotwonderingwhytheNewcastleFalconscanneverwinhomeoraway,hespendshissparetimewriting,playingrugby,scubadiving,orpretendingthathecancook.
Ifhecouldbeconsistent(orinteresting),hisblogmightnotbethreemonthsoutofdate.
Youneverknow—youmaygetlucky.
Seeforyourselfatdppl6++sss*hepphalkj`*_k*qg.
xxxvIntroductionAsyounodoubtalreadyknow,ASP.
NETisMicrosoft'snext-generationtechnologyforcreat-ingserver-sidewebapplications.
It'sbuiltontheMicrosoft.
NETFramework,whichisaclusterofcloselyrelatednewtechnologiesthatrevolutionizeeverythingfromdatabaseaccesstodistributedapplications.
ASP.
NETisoneofthemostimportantcomponentsofthe.
NETFramework—it'sthepartthatenablesyoutodevelophigh-performancewebapplications.
It'snothardtogetdevelopersinterestedinASP.
NET.
Withoutexaggeration,ASP.
NETisthemostcompleteplatformforwebdevelopmentthat'severbeenputtogether.
Itfaroutclassesitspredecessor,ASP,whichwasdesignedasaquick-and-dirtysetoftoolsforinsertingdynamiccontentintoordinarywebpages.
Bycontrast,ASP.
NETisafull-blownplatformfordevelopingcomprehensive,blisteringlyfastwebapplications.
Inthisbook,you'lllearneverythingyouneedtomasterASP.
NET3.
5.
Ifyou'vepro-grammedwithapreviousversionofASP.
NET,youcanfocusonnewfeaturessuchasLINQ(Chapter13),ASP.
NETAJAX(Chapter32),andSilverlight(Chapter33).
Ifyou'veneverpro-grammedwithASP.
NET,you'llfindthatthisbookprovidesawell-pacedtourthatleadsyouthroughallthefundamentals,alongwithabackstagepassthatletsyouseehowtheASP.
NETinternalsreallywork.
Theonlyrequirementforthisbookisthatyouhaveasolidunderstand-ingoftheVBlanguageandthebasicsof.
NET.
Ifyou'reaseasonedJavaorC++developerbutyou'renewtoVB,youmayfinditeasiertostartwithabookabout.
NETfundamentals,suchasProVB2008andthe.
NET3.
5PlatformbyAndrewTroelsen(Apress,2008).
WhatDoesThisBookCoverHereisaquickbreakdownofwhatyou'llfindinthisbook:Part1:CoreConcepts:You'llbegininChapter1withalookattheoverallASP.
NETplatform,the.
NETFramework,andanoverviewofthechangesthathavetakenplaceinASP.
NET3.
5.
InChapter2you'llbranchouttolearnthetoolsofthetrade—namely,VisualStudio2008.
InChapters3,4,5,and6you'lllearnthekeypartsoftheASP.
NETinfrastructure,suchastheweb-pagemodel,applicationconfiguration,andstateman-agement.
Asyoulearnthesecoreconcepts,you'llalsotakealow-levellookathowASP.
NETprocessesrequestsandmanagesthelifetimeofyourwebapplications.
You'llevenlearnhowtoextendtheASP.
NETarchitecture.
Part2:DataAccess:Thisparttacklesoneofthecoreproblemdomainsforallsoftwaredevelopment—accessingandmanipulatingdata.
InChapters7and8you'llconsiderthefundamentalsofADO.
NETastheyapplytowebapplicationsandlearnhowtodesigndataaccesscomponents.
InChapters9and10you'lllearnaboutASP.
NET'ssetofinnovativeNINTRODUCTIONxxxvidataboundcontrolsthatletyouformatandpresentdatawithoutwritingpagesofcode.
Chapter11branchesoutintoadvancedcachingstrategiesthatensurefirst-classperfor-mance.
Finally,Chapters12,13,and14movebeyondtheworldofADO.
NETtoshowyouhowtoworkwithfiles,LINQ,andXMLcontent.
Part3:BuildingASP.
NETWebsites:Inthispartyou'lllearnaboutessentialtechniquesandfeaturesformanaginggroupsofwebpages.
You'llstartsimplywithusercontrolsinChapter15,whichallowyoutoreusesegmentsoftheuserinterface.
InChapter16you'llconsidertwonewASP.
NETinnovations—themes(forstylingcontrolsautomatically)andmasterpages(forreusingalayouttemplateacrossmultiplepages).
Chapter17showshowyoucanuseASP.
NET'snavigationmodeltoletvisitorssurffromonepagetoanother.
Finally,Chapter18describesdeploymentandtheIISwebserversoftware.
Part4:Security:Inthispart,you'lllookatASP.
NET'srichcomplementofsecurityfea-tures.
You'llstartwithahigh-leveloverviewofsecurityconceptsinChapter19andthenlearntheinsandoutsofformsauthentication(Chapter20)andthemembershipfeaturethatworkswithit(Chapter21).
InChapter22you'lltackleWindowsauthentication,andinChapter23you'lllearnhowtorestrictauthenticateduserswithsophisticatedauthori-zationrulesanduserole-basedsecurity.
InChapter24you'llexploretheprofilesfeature,whichisanew,prebuiltsolutionforstoringuser-specificinformation,andinChapter25you'llgoonestepfurtherandlearnhowtoprotectthedatayoustoreinadatabaseaswellastheinformationyousendinaURLwithencryption.
Finally,Chapter26showshowyoucanplugintotheASP.
NETsecuritymodelbydesigningacustommembershipprovider.
Part5:AdvancedUserInterface:Thispartshowshowyoucanextendwebpageswithadvancedtechniques.
InChapters27and28you'lltacklecustomcontrols.
InChapter29you'llbranchouttouseGDI+forhandcraftedgraphics.
Finally,Chapter30exploresASP.
NET'sWebPartsFramework,whichallowsyoutoeasilycreatewebportals.
Part6:Client-SideProgramming:Inthispart,you'llconsidersomeofthemostexcitinginnovationsinmodernwebdevelopment.
First,inChapters31and32,you'llconsiderhowtouseJavaScriptandAjaxtechniquesinyourASP.
NETwebpages.
You'lllearnhowtomakewebpagesmoredynamic(byincorporatingeffectssuchastextautocompletionanddrag-and-drop)andmoreresponsive(byreactingtoclient-sideeventsandseamlesslyrefresh-ingthewebpage).
InChapter33,you'lldiveintotheworldofSilverlight,aMicrosoft-builtbrowserplug-inthatgivesyoutheabilitytobringrichgraphics,animation,sound,andvideotoordinarywebpagesonavarietyofbrowsersandoperatingsystems.
WhoIsThisBookForThisbookisintendedasaprimerforprofessionaldeveloperswhohaveareasonableknowl-edgeofserver-sidewebdevelopment.
Thisbookdoesn'tprovideanexhaustivelookateveryingredientinthe.
NETFramework—infact,suchabookwouldrequiretwiceasmanypages.
Instead,thisbookaimstoprovideanintelligentintroductiontoASP.
NETforprofessionalprogrammerswhodon'twanttorehashthebasics.
Alongtheway,you'llfocusonothercor-nersofthe.
NETFrameworkthatyou'llneedinordertobuildprofessionalwebapplications,includingdataaccessandXML.
Usingthesefeatures,you'llbeabletocreatenext-generationwebsiteswiththebesttoolsonhandtoday.
NINTRODUCTIONxxxviiThisbookisalsorelentlesslypractical.
Youwon'tjustlearnaboutfeatures—you'llalsolearnaboutthereal-worldtechniquesthatcantakeyourwebsitetothenextlevel.
Laterchaptersarededicatedtocutting-edgetopicssuchascustomcontrols,dynamicgraphics,advancedsecurity,andhigh-performancedataaccess,allwiththegoalofgivingyoueverythingyouneedtobuildprofessionalwebapplications.
Togetthemostfromthisbook,youshouldbefamiliarwiththesyntaxoftheVBlanguageandwithobject-orientedconcepts.
Youdon'tneedtohaveexperiencewithapreviousver-sionofASP.
NET,asallthefundamentalsarecoveredinthisbook.
Ifyou'reanexperiencedVBdeveloperwithno.
NETexperience,youshouldconsidersupplementingthisbookwithanintroductionto.
NET,suchasProVB2008andthe.
NET3.
5PlatformbyAndrewTroelsen(Apress,2008).
WhatDoYouNeedtoUseThisBookTodevelopandtestASP.
NETwebapplications,youneedVisualStudio2008.
Althoughyoucouldtheoreticallywritecodebyhand,thesheertediumandthelikelihoodoferrormeanthisapproachisneverusedinaprofessionalenvironment.
NNoteYoucanusethescaled-downVisualStudioWebDeveloper2008ExpressEdition,butyou'llrunintosignificantlimitationsonsomeoftheexamples.
Mostimportant,youcan'tuseVisualStudioWebDeveloper2008ExpressEditiontocreateclasslibraries,whichareanessentialpartofmoderncomponent-orienteddesign(althoughyoucanworkaroundthislimitationbyusingtwoexpresseditions—VisualStudioWebDeveloperExpressEditiontocreateyourwebsitesandVisualBasic2008ExpressEditiontocreateyourcomponents).
Additionally,ifyouplantohostASP.
NETwebsites,you'llneedtouseWindowsXPProfessionalor(ideally)aserver-basedversionofWindows,suchasWindowsServer2003orWindowsServer2008.
You'llalsoneedtoinstallIIS(InternetInformationServices),thewebhostingsoftwarethat'spartoftheWindowsoperatingsystem.
IISisdescribedinChapter18.
ThisbookincludesseveralexamplesthatusesampledatabasesthatareincludedwithSQLServertodemonstratedataaccesscode,securitytechniques,andotherfeatures.
YoucanuseanyversionofSQLServertotrytheseexamples,includingSQLServer2005ExpressEdition,whichisincludedwithsomeversionsofVisualStudio(andfreelydownloadableatdppl6++sss*ie_nkokbp*_ki+omhoanran+.
,,1+).
Ifyouuseotherrelationaldatabaseengines,thesameconceptswillapply,butyouwillneedtomodifytheexamplecode.
Finally,tousetheSilverlightexamplesinChapter33,you'llwanttohavetheSilverlightToolsforVisualStudio,whichyoucandownloadfromdppl6++oehranhecdp*jap+CapOp]npa`.
TheSilverlightToolsforVisualStudioincludeallthecomponentsyouneedtodesign,run,anddebugSilverlight2applications,includingtheSilverlightruntime,theSilverlightSDK,andtheSilverlightadd-inforVisualStudio.
Chapter33hasmoredetails.
NINTRODUCTIONxxxviiiCustomerSupportWealwaysvaluehearingfromourreaders,andwewanttoknowwhatyouthinkaboutthisbook—whatyouliked,whatyoudidn'tlike,andwhatyouthinkwecandobetternexttime.
Youcansendyourcommentsbye-mailtobaa`^]_g<]lnaoo*_ki.
Pleasebesuretomentionthebooktitleinyourmessage.
SampleCodeTodownloadthesamplecode,visittheApresswebsiteatdppl6++sss*]lnaoo*_ki,andsearchforthisbook.
Youcanthendownloadthesamplecode,whichiscompressedintoasingleZIPfile.
Beforeyouusethecode,you'llneedtouncompressitusingautilitysuchasWinZip.
Codeisarrangedintoseparatedirectoriesbychapter.
Beforeusingthecode,refertotheaccompa-nyingreadme.
txtfileforinformationaboutotherprerequisitesandconsiderations.
BonusChaptersTheApresswebsitealsoincludesseveraladditionalchaptersthatyoucandownloadasPDFs.
Thesechaptersincludecontentthatcouldn'tbeincludedinthisbook(duetospacerequire-ments)andisn'tconsideredasimportanttoASP.
NETwebdevelopment.
Here'swhatyou'llfind:BonusChapter1:ThischapterdescribeshowtouseresourcesandlocalizationinASP.
NETwebsites.
It'sanessentialchapterfordeveloperswhoneedtocreatewebsitesthatcanbeviewedinmultiplelanguages.
BonusChapters2,3,and4:Thesechapterstacklewebservices,afeaturethatallowsyoutocreatecoderoutinesthatcanbecalledbyotherapplicationsovertheInternet.
Webser-vicesaremostinterestingwhenconsideringrichclientdevelopment(becausetheyallowyoutogivewebfeaturestoordinarydesktopapplications),andthey'reintheprocessofbeingreplacedbyanewtechnologyknownasWCF(WindowsCommunicationFounda-tion).
Forthosereasons,webservicesaren'tcoveredindetailinthisbook.
However,youwillconsiderhowtousewebservicestoextendthereachofyourwebpageswithASP.
NETAJAXinChapter32andSilverlightinChapter33.
NNoteTheonlinewebservicechapterscomefromthepreviouseditionofthisbook.
TheinformationinthesechaptersstillappliestoASP.
NET3.
5,becausethewebservicefeaturehasn'tchanged.
ErrataWe'vemadeeveryefforttomakesurethetextandthecodecontainnoerrors.
However,nooneisperfect,andmistakesdooccur.
Ifyoufindanerrorinthebook,suchasaspellingmis-takeorafaultypieceofcode,wewouldbegratefultohearaboutit.
Bysendinginerrata,youmaysaveanotherreaderhoursoffrustration,andyou'llbehelpingusprovidehigher-qualityinformation.
Simplye-mailtheproblemtooqllknp<]lnaoo*_ki,whereyourinformationwillbecheckedandpostedontheerratapageorusedinsubsequenteditionsofthebook.
Youcanviewerratafromthebook'sdetailpage.
SugarHosts 糖果主机商也算是比较老牌的主机商,从2009年开始推出虚拟主机以来,目前当然还是以虚拟主机为主,也有新增云服务器和独立服务器。早年很多网友也比较争议他们家是不是国人商家,其实这些不是特别重要,我们很多国人商家或者国外商家主要还是看重的是品质和服务。一晃十二年过去,有看到SugarHosts糖果主机商12周年的促销活动。如果我们有需要香港、美国、德国虚拟主机的可以选择,他们家的...
hostsailor怎么样?hostsailor成立多年,是一家罗马尼亚主机商家,机房就设在罗马尼亚,具说商家对内容管理的还是比较宽松的,商家提供虚拟主机、VPS及独立服务器,今天收到商家推送的八月优惠,针对所有的产品都有相应的优惠,商家的VPS产品分为KVM和OpenVZ两种架构,OVZ的比较便宜,有这方面需要的朋友可以看看。点击进入:hostsailor商家官方网站HostSailor优惠活动...
乌云数据主营高性价比国内外云服务器,物理机,本着机器为主服务为辅的运营理念,将客户的体验放在第一位,提供性价比最高的云服务器,帮助各位站长上云,同时我们深知新人站长的不易,特此提供永久免费虚拟主机,已提供两年之久,帮助了上万名站长从零上云官网:https://wuvps.cn迎国庆豪礼一多款机型史上最低价,续费不加价 尽在wuvps.cn香港cera机房,香港沙田机房,超低延迟CN2线路地区CPU...
selectedindexchanged为你推荐
站长故事部队里什么是站长?最低是什么级别?都有哪些级别啊?最新qq空间代码qq空间都是有哪些免费代码!(要全部)中国电信互联星空电信的互联星空服务是什么?万网核心代理万网代理商?中国万网认证核心分销商?吴晓波频道买粉罗辑思维,晓松奇谈,鸿观,吴晓波频道,财经郎眼哪个更有深度bluestacksBluestacks安卓模拟器是什么机型的?腾讯文章腾讯新闻的精选微信里面收藏的文章在哪里直播加速怎么让已拍摄好的视频加速idc前线怎么知道我电脑是3兆的宽带?商标注册查询官网怎么查商标是否注册成功
广东服务器租用 樊云 缓存服务器 68.168.16.150 主机屋免费空间 win8.1企业版升级win10 12306抢票助手 云鼎网络 云全民 腾讯云分析 炎黄盛世 北京双线机房 softbank邮箱 asp免费空间申请 徐正曦 免费dns解析 个人免费主页 跟踪路由命令 万网主机管理 阿里云免费邮箱 更多