关闭

关闭

关闭

封号提示

内容

首页 Wrox.Professional.ASP.NET.MVC.2.Jun.2010.pdf

Wrox.Professional.ASP.NET.MVC.2.Jun.2010.pdf

Wrox.Professional.ASP.NET.MVC.2…

上传者: 于庆-甲寅 2010-12-18 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《Wrox.Professional.ASP.NET.MVC.2.Jun.2010pdf》,可适用于IT/计算机领域,主题内容包含ProfessionalasPneTMVCforewordxxvinTroduCTionxxviiChaPTerNerdDinnerChaPTerM符等。

ProfessionalasPneTMVCforewordxxvinTroduCTionxxviiChaPTerNerdDinnerChaPTerModelViewControllerandASPNETChaPTerASPNET>ASPNETMVCChaPTerRoutesandURLsChaPTerControllersChaPTerViewsChaPTerAJAXChaPTerFiltersChaPTerSecuringYourApplicationChaPTerTestDrivenDevelopmentwithASPNETMVCChaPTerTestableDesignPatternsChaPTerBestofBothWorlds:WebFormsandMVCTogetherChaPTerWhat’sNewinASPNETMVCindexProfessionalasPneTMVCProfessionalasPneTMVCJonGallowayPhilHaackScottHanselmanScottGuthrieRobConeryProfessionalasPneTMVCPublishedbyWileyPublishing,IncCrosspointBoulevardIndianapolis,INwwwwileycomCopyrightbyWileyPublishing,Inc,Indianapolis,IndianaPublishedsimultaneouslyinCanadaISBN:ISBN:(ebk)ISBN:(ebk)ISBN:(ebk)ManufacturedintheUnitedStatesofAmericaNopartofthispublicationmaybereproduced,storedinaretrievalsystemortransmittedinanyformorbyanymeans,electronic,mechanical,photocopying,recording,scanningorotherwise,exceptaspermittedunderSectionsoroftheUnitedStatesCopyrightAct,withouteitherthepriorwrittenpermissionofthePublisher,orauthorizationthroughpaymentoftheappropriatepercopyfeetotheCopyrightClearanceCenter,RosewoodDrive,Danvers,MA,(),fax()RequeststothePublisherforpermissionshouldbeaddressedtothePermissionsDepartment,JohnWileySons,Inc,RiverStreet,Hoboken,NJ,(),fax(),oronlineathttp:wwwwileycomgopermissionsLimitofLiabilityDisclaimerofWarranty:Thepublisherandtheauthormakenorepresentationsorwarrantieswithrespecttotheaccuracyorcompletenessofthecontentsofthisworkandspecificallydisclaimallwarranties,includingwithoutlimitationwarrantiesoffitnessforaparticularpurposeNowarrantymaybecreatedorextendedbysalesorpromotionalmaterialsTheadviceandstrategiescontainedhereinmaynotbesuitableforeverysituationThisworkissoldwiththeunderstandingthatthepublisherisnotengagedinrenderinglegal,accounting,orotherprofessionalservicesIfprofessionalassistanceisrequired,theservicesofacompetentprofessionalpersonshouldbesoughtNeitherthepublishernortheauthorshallbeliablefordamagesarisingherefromThefactthatanorganizationorWebsiteisreferredtointhisworkasacitationandorapotentialsourceoffurtherinformationdoesnotmeanthattheauthororthepublisherendorsestheinformationtheorganizationorWebsitemayprovideorrecommendationsitmaymakeFurther,readersshouldbeawarethatInternetWebsiteslistedinthisworkmayhavechangedordisappearedbetweenwhenthisworkwaswrittenandwhenitisreadForgeneralinformationonourotherproductsandservicespleasecontactourCustomerCareDepartmentwithintheUnitedStatesat(),outsidetheUnitedStatesat()orfax()WileyalsopublishesitsbooksinavarietyofelectronicformatsSomecontentthatappearsinprintmaynotbeavailableinelectronicbooksLibraryofCongressControlNumber:Trademarks:Wiley,theWileylogo,Wrox,theWroxlogo,ProgrammertoProgrammer,andrelatedtradedressaretrademarksorregisteredtrademarksofJohnWileySons,Incandoritsaffiliates,intheUnitedStatesandothercountries,andmaynotbeusedwithoutwrittenpermissionAllothertrademarksarethepropertyoftheirrespectiveownersWileyPublishing,Inc,isnotassociatedwithanyproductorvendormentionedinthisbookTomywifeRachel,mydaughtersRosemary,Esther,andEllie,andtherestofmyfamilyfortheirpatienceandsupportduringthewhole“move,changejobs,andwriteabookinthesameyear”thingJonGallowayMywife,Akumi,deservestohavehernameonthecoverasmuchasIdoforallhersupportmadethispossibleAndthankstoCodyforhisinfectioushappinessPhilhaackabouTTheauThorsJonGallowayworksatMicrosoftasanASPNETCommunityProgramManagerJonpreviouslyworkedatVertigoSoftware,whereheledteamsbuildingMicrosoftconferencewebsitesandworkedonsomehighprofileSilverlightprojectsPriortothat,heworkedinawiderangeofwebdevelopmentshops,fromscrappystartupstoFortunefinancialcompanies,andevenspentsometimeasasubmarinelieutenantHe’sanASPNETandSilverlightInsider,formerASPNETMVP,andregularcontributortoseveralopensourceNETprojectsHe’spartoftheHerdingCodepodcast(http:herdingcodecom),blogsathttp:weblogsaspnetjgalloway,andtwittersasjongallowayHelivesinSanDiegowithhiswife,threedaughters,andabunchofavocadotreesPhilhaaCkisaSeniorProgramManagerwiththeASPNETteamworkingontheASPNETMVCprojectPriortojoiningMicrosoft,Philworkedasaproductmanagerforacodesearchengine,adevmanagerforanonlinegamingcompany,andasaseniorarchitectforapopularSpanishlanguagetelevisionnetwork,amongothercrazypursuitsAsacodejunkie,PhilHaacklovestocraftsoftwareNotonlydoesheenjoywritingsoftware,heenjoyswritingaboutsoftwareandsoftwaremanagementonhisblog,http:haackedcomInhissparetime,PhilcontributestovariousopensourceprojectsandisthefounderoftheSubtextblogengineproject,whichisundergoingarewrite,usingASPNETMVC,ofcoursesCoTThanselManworksforMicrosoftasaPrincipalProgramManagerLeadinServerandToolsOnline,aimingtospreadthegoodwordaboutdevelopingsoftware,mostoftenontheMicrosoftstackBeforethis,heworkedineFinanceforyearsandbeforethathewasaPrincipalConsultantatMicrosoftPartnerfornearlyyearsHewasalsoinvolvedinafewthingsliketheMVPandRDprogramsandwillspeakaboutcomputers(andotherpassions)wheneversomeonewilllistentohimHeblogsathttp:wwwhanselmancomandpodcastsathttp:wwwhanselminutescomandcontributestositeslikehttp:wwwaspnet,http:wwwwindowsclientnet,andhttp:wwwsilverlightnetYoucanalsofindhimontwitteratshanselman,fartoooftensCoTTGuThrieiscorporatevicepresidentofMicrosoft’sNETDeveloperDivision,whereherunsthedevelopmentteamsresponsiblefordeliveringMicrosoftVisualStudiodevelopertoolsandMicrosoftNETFrameworktechnologiesforbuildingclientandWebapplicationsAfoundingmemberoftheNETproject,GuthriehasplayedakeyroleinthedesignanddevelopmentofVisualStudioandtheNETFrameworksinceGuthrieisalsoresponsibleforMicrosoft’sWebserverplatformanddevelopmenttoolsteamsHehasalsomorerecentlydriventhedevelopmentofSilverlightacrossbrowser,crossplatformpluginfordeliveringnextgenerationmediaexperiencesandrichinternetapplicationsfortheWebToday,GuthriedirectlymanagesthedevelopmentteamsthatbuildtheCommonLanguageRuntime(CLR),ASPNET,Silverlight,WindowsPresentationFoundation(WPF),IIS,CommerceServerandtheVisualStudioToolsforWeb,ClientandSilverlightdevelopmentGuthriegraduatedwithadegreeincomputersciencefromDukeUniversityrobConeryisanexpertinASPNETHeistheCreatorofSubSonicandwastheChiefArchitectoftheCommerceStarterKit(afree,OpenSourceeCommerceplatformforNET)HelivesinKauai,HIwithhiswifeandtwodaughters(MaddyandRuby)abouTTheTeChniCalediTorsbradwilsonhasbeenaprofessionalsoftwaredeveloperfornearlyyears,whichincludesmorethanyearsofwebdevelopmentHejoinedMicrosoftin,joinedtheASPNETteamin,andhasworkedontheASPNETMVCprojectsinceeilonliPTonjoinedtheASPNETteamasadeveloperatMicrosoftinOnthisteam,hehasworkedonareasrangingfromdatasourcecontrolstolocalizationtotheUpdatePanelcontrolHenowworksontheASPNETMVCFrameworkasaseniordevelopmentleadEilonisalsoafrequentspeakeronavarietyofASPNETrelatedtopicsatconferencesworldwideHegraduatedfromBostonUniversitywithadualdegreeinMathandComputerScienceInhissparetimeEilonspendstimeinhisgarageworkshopbuildingwhatheconsiderstobewelldesignedfurnitureIfyouknowanyonewhoneedsacoffeetablethat’sthreefeettallandhasaslightslopetoit,sendhimanemailCrediTsaCquisiTionsediTorPaulReeseProJeCTediTorMaureenSpearsTeChniCalediTorsBradWilsonEilonLiptonProduCTionediTorDanielScribnerCoPyediTorCateCaffreyediTorialdireCTorRobynBSieskyediTorialManaGerMaryBethWakefieldassoCiaTedireCTorofMarkeTinGDavidMayhewProduCTionManaGerTimTateViCePresidenTandexeCuTiVeGrouPPublisherRichardSwadleyViCePresidenTandexeCuTiVePublisherBarryPruettassoCiaTePublisherJimMinatelProJeCTCoordinaTor,CoVerLynseyStanfordCoMPosiTorJeffLytle,HappenstanceTypeORamaProofreaderPublicationServices,IncindexerRobertSwansonCoVerdesiGnerMichaelETrentCoVeriMaGeDavidMadisonPhotographer’sChoiceRFGettyImagesaCknowledGMenTsThanksTofaMilyandfriendswhograciouslyactedasif“Jonwithoutsleep”issomeoneyou’dwanttospendtimewithThankstoScottHanselmanforbelievinginmeThankstoScottStanfieldandallmyfriendsatVertigoforjustbeingawesomeThankstothewholeASPNETteamformakingworkfunsince,andespeciallytoBradWilsonandPhilHaackforansweringtonsofrandomquestionsThankstoWarrenGHardingfornormalcyThankstoPhilippians:forcontinuallyremindingmewhichwayisupJonGallowayThanksGoTomylovelywifeAkumiforhersupportwhichwentaboveandbeyondallexpectationsandmadethispossibleI’dliketoalsogiveashoutouttomysonCodyforhissageadvice,deliveredonlyasatwoyearoldcandeliveritI’msurehe’llbeembarrassedtenyearsfromnowthatIusedsuchananachronism(“shoutout”)inmyacknowledgmenttohimThanksgotomydaughterMiaashersmilelightsuptheroomlikeunicornsPhilhaackConTenTsForewordxxxIntroductIonxxviinerddinnerChaPTer:file  newProjectExaminingtheNerdDinnerDirectoryStructureRunningtheNerdDinnerApplicationTestingtheNerdDinnerApplicationCreatingtheDatabaseCreatingaNewSQLServerExpressDatabaseCreatingTableswithinOurDatabaseSettingUpaForeignKeyRelationshipbetweenTablesAddingDatatoOurTablesBuildingtheModelEntityFrameworkAddingEntityFrameworkClassestoOurProjectCreatingDataModelClasseswithEntityFrameworkNerdDinnerEntitiesClassCreatingaDinnerRepositoryClassRetrieving,Updating,Inserting,andDeletingUsingtheDinnerRepositoryClassIntegratingValidationandBusinessRuleLogicwithModelClassesControllersandViewsAddingaDinnersControllerControllerAddingIndexandDetailsActionMethodstotheDinnersControllerClassUnderstandingASPNETMVCRoutingUsingtheDinnerRepositoryfromOurDinnersControllerUsingViewswithOurControllerImplementingthe“NotFound”ViewTemplateImplementingthe“Details”ViewTemplateImplementingthe“Index”ViewTemplateConventionBasedNamingandtheViewsDirectoryStructureCreate,Update,DeleteformscenariosURLsHandledbyDinnersControllerImplementingtheHTTPGETEditActionMethodHtmlBeginFormandHtmlTextBoxForHtmlHelperMethodsImplementingtheHTTPPOSTEditActionMethodxviiiConTenTsHandlingEditErrorsUnderstandingModelStateandtheValidationHTMLHelperMethodsCompleteEditActionMethodImplementationsImplementingtheHTTPGETCreateActionMethodImplementingtheHTTPPOSTCreateActionMethodImplementingtheHTTPGETDeleteActionMethodImplementingtheHTTPPOSTDeleteActionMethodModelBindingSecurityCRUDWrapUpViewDataandViewModelPassingDatafromControllerstoViewTemplatesUsingtheViewDataDictionaryUsingaViewModelPatternCustomShapedViewModelClassesPartialsandMasterPagesRevisitingOurEditandCreateViewTemplatesUsingPartialViewTemplatesUsingPartialViewTemplatestoClarifyCodeMasterPagesPagingsupportIndexActionMethodRecapUnderstandingIQueryable<T>AddingapageValuetotheURLAddingPageNavigationUIauthenticationandauthorizationUnderstandingAuthenticationandAuthorizationFormsAuthenticationandtheAccountControllerAuthorizingtheDinnersCreateURLUsingtheAuthorizeFilterUsingtheUserIdentityNamePropertyWhenCreatingDinnersUsingtheUserIdentityNamePropertyWhenEditingDinnersShowingHidingEditandDeleteLinksaJaXenablingrsVPsacceptsIndicatingWhethertheUserIsRSVP’edImplementingtheRegisterActionMethodCallingtheRegisterActionMethodUsingAJAXAddingajQueryAnimationCleanupRefactorOutaRSVPPartialViewintegratinganaJaXMapCreatingaMapPartialViewCreatingaMapjsUtilityLibraryIntegratingtheMapwithCreateandEditFormsIntegratingtheMapwiththeDetailsViewImplementingLocationSearchinOurDatabaseandRepositoryxixConTenTsImplementingaJSONBasedAJAXSearchActionMethodCallingtheJSONBasedAJAXMethodUsingjQueryUnitTestingWhyUnitTestNerdDinnerTestsProjectCreatingUnitTestsforOurDinnerModelClassRunningTestsCreatingDinnersControllerUnitTestsDependencyInjectionExtractinganIDinnerRepositoryInterfaceUpdatingDinnersControllertoSupportConstructorInjectionCreatingtheFakeDinnerRepositoryClassUsingtheFakeDinnerRepositorywithUnitTestsCreatingEditActionUnitTestsMockingtheUserIdentityNamePropertyTestingUpdateModelScenariosTestingWrapUpnerdDinnerWrapUpModelViewConTrollerandasPneTChaPTer:WhatisModelViewControllerMVContheWebTodayRubyonRailsDjangoandPythonSpring,Struts,andJavaZendFrameworkandPHPMonoRailasPneTMVC:ThenewKidontheBlockServingMethods,NotFilesIsThisWebFormsWhyNotWebFormsCostBenefitofWebFormsShouldYouFearASPNETMVCsummaryasPneT>asPneTMVCChaPTer:abstraction:WhatWebformsDoesWellABasicWebFormsApplicationTheImportanceofEventsTheleak:WhereWebformsDoesn’texactlyfitViewStateControllingYourAngleBracketsxxConTenTsClientIDsTestingBacktoBasics:asPneTMVCBelieves…OrchestrationversusComposingSeparationofConcerns:WhatItMeansApproachestoMaintainabilityCaringaboutTestabilityCommonreactionstoasPneTMVCThisLooksLikeClassicASPfrom!WhoMovedMy<asp:Cheeserunat=”server”}>YetAnotherWebFrameworkWhy“(asPneT>asPneTMVC)==True”ConventionoverConfigurationYourFirst,er,Third,RequestTheRequestLifeCyclesummaryrouTesandurlsChaPTer:introductiontoroutingComparedtoURLRewritingDefiningRoutesNamedRoutesAreasCatchAllParameterStopRoutingHandlerandIgnoreRouteDebuggingRoutesUndertheHood:HowRoutesGenerateURLsUndertheHood:HowroutesTieYourUrltoanactionTheHighLevelRequestRoutingPipelineRouteMatchingadvancedroutingwithCustomConstraintsrouteextensibilityUsingroutingwithWebformsRoutingWithWebFormsinASPNETRoutingwithWebFormsinASPNETsummaryConTrollersChaPTer:HistoryoftheControllerDefiningtheController:TheiControllerinterfaceTheControllerBaseabstractBaseClassxxiTheControllerClassandactionsActionMethodsTheactionresultActionResultTypesActionResultHelperMethodsImplicitActionResultsactioninvokerHowanActionIsMappedtoaMethodMappingParametersInvokingActionsUsingAsynchronousControllerActionsPassingDatatoActions:TheModelBindersAWordaboutUserInputsummaryViewsChaPTer:WhataViewDoesWhataViewshouldn’tDospecifyingaViewstronglyTypedViewsViewModelsHTMlHelperMethodsHtmlHelperClassandExtensionMethodsUsingtheHTMLHelpersHTMLTemplateCustomizationTheViewengineConfiguringaViewEngineFindingaViewTheViewItselfAlternativeViewEnginesnewViewengineornewactionresultsummaryaJaxChaPTer:WhenajaxisCoolWhenit’snotajaxexamplesHandlingDisabledScriptingUsingPartialsforRenderingSomeThingsYouMayNotKnowaboutMicrosoftASPNETAjaxUpdatinganHTMLElementWhenSubmittingaFormTheAutoCompleteTextBoxConTenTsxxiiConTenTsImplementingAutoCompletewithMicrosoftASPNETAjaxFilteringDatawithaSelectboxTheModalPopUpwithjQueryTheModalPopUpCodeTheRatingControlsummaryfilTersChaPTer:filtersincludedwithasPneTMVCAuthorizeRequireHttp

用户评论(0)

0/200

精彩专题

上传我的资料

每篇奖励 +2积分

资料评价:

/49
仅支持在线阅读

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部