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.
适逢中国农历新年,RAKsmart也发布了2月促销活动,裸机云、云服务器、VPS主机全场7折优惠,新用户注册送10美元,独立服务器每天限量秒杀最低30.62美元/月起,美国洛杉矶/圣何塞、日本、香港站群服务器大量补货,1-10Gbps大带宽、高IO等特色服务器抄底价格,机器可选大陆优化、国际BGP、精品网及CN2等线路,感兴趣的朋友可以持续关注下。裸机云新品7折,秒杀产品5台/天优惠码:Bare-...
目前云服务器市场竞争是相当的大的,比如我们在年中活动中看到各大服务商都找准这个噱头的活动发布各种活动,有的甚至就是平时的活动价格,只是换一个说法而已。可见这个行业确实竞争很大,当然我们也可以看到很多主机商几个月就消失,也有看到很多个人商家捣鼓几个品牌然后忽悠一圈跑路的。当然,个人建议在选择服务商的时候尽量选择老牌商家,这样性能更为稳定一些。近期可能会准备重新整理Vultr商家的一些信息和教程。以前...
sharktech怎么样?sharktech (鲨鱼机房)是一家成立于 2003 年的知名美国老牌主机商,又称鲨鱼机房或者SK 机房,一直主打高防系列产品,提供独立服务器租用业务和 VPS 主机,自营机房在美国洛杉矶、丹佛、芝加哥和荷兰阿姆斯特丹,所有产品均提供 DDoS 防护。不知道大家是否注意到sharktech的所有服务器的带宽价格全部跳楼跳水,降幅简直不忍直视了,还没有见过这么便宜的独立服...
selectedindexchanged为你推荐
推广方法营业推广的方式有哪些邮箱怎么写正确的邮箱地址怎么写iphone5解锁捡了个苹果5怎么解锁拂晓雅阁有什么网站是学电脑技术的`?中国论坛大全甘肃论坛都有哪些?flash导航条如何添加FLASH导航条在线代理网站求有效的代理服务器地址?安装迅雷看看播放器如何用手机安装迅雷看看播放器ejb开发什么是EJB?它是干什么的?和JAVA,JSP有关系吗?他们各有什么特点和用途?blogcn怎样设置BLOGCN的访问密码
厦门域名注册 美国vps 域名主机基地 万网免费域名 免费顶级域名 softlayer 国外bt 68.168.16.150 轻博客 标准机柜尺寸 网通代理服务器 免费防火墙 西安服务器托管 shuang12 ebay注册 免费的域名 秒杀品 服务器防御 免 windowsserver2012 更多