关闭

关闭

关闭

封号提示

内容

首页 ASP.NET MVC2 in Action.pdf

ASP.NET MVC2 in Action.pdf

ASP.NET MVC2 in Action.pdf

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

简介:本文档为《ASP.NET MVC2 in Actionpdf》,可适用于IT/计算机领域,主题内容包含MANNINGJeffreyPalermoBenScheirmanJimmyBogardEricHexterMatthewHinzeFOREWORD符等。

MANNINGJeffreyPalermoBenScheirmanJimmyBogardEricHexterMatthewHinzeFOREWORDSBYRODPADDOCKANDPHILHAACKINACTIONDownloadatPiniComPraisefortheFirstEditionamustreadforanyonewhoisseriousaboutdevelopingwiththeASPNETMVCframeworkSteveMichelotti,MicrosoftMVP,geekswithblogsnetAtmerelypagesASPNETMVCinActionisatruemasterpieceTheauthors,JeffreyPalermo,BenScheirman,andJimmyBogardareallconsideredrockstarsintheASPNETcommunityandtheyhaveopenedupthedoorstotheirconcertwithASPNETMVCinActionMohammadAzam,MicrosoftMVPIreallyenjoyedASPNETMVCinActionandhighlyrecommenditforafreshlookattheASPNETMVCFrameworkDavidHayden,MicrosoftMVPDoesagreatjobofwalkingdevelopersthroughanintroductiontoMVCdevelopmentthatfeelsorreadslikespendingtimewithanotherdeveloperatawhiteboardMichaelKCampbell,DevConnectionsTheauthorsclearlyhavealotofexperiencewiththeframeworkandI’dhighlyrecommendthistoanyonewhoisseriousaboutbuildingwebapplicationswithASPNETMVCJeremySkinner,ASPNETDeveloperASPNETMVCinActionshouldbeatthetopofyourlistIhighlyrecommendthisbookforanyoneinterestedinbreakingawayfromthepainsofASPNETWebFormsAndrewSiemer,PrincipalArchitect,OTXResearchdoesagoodjobofnotonlyshowingyouwhattodo,butalsoprovidescautionarywordstoavoidpoorpracticesthatmayleadtomaintenanceissuesonnontrivialapplicationsVenkatSubramanian,NoFluffJustStuffBlogsLicensedtoRobertSeder<robertsederhotmailcom>MorePraisefortheFirstEdtionIntheendtheauthorsnotonlydidanexcellentjobofputtingtogetheragreatpracticalguidetoASPNETMVCtheyalsosuccessfullyembeddedsomesubversiveALTNETconceptsthatwillhopefulmakeusallbetterdevelopersAndattheendofthedaythatisadamnfineaccomplishmentBobbyJohnson,WashingtonStateASPNETMVCinActionwillguideyoufromyourfirstprojectthroughadvancedtopicssuchasAJAXanddeployingonsuboptimalhostingenvironmentsThewritingstyleisclearandconciseDiagramsandcodeexamplesareabundantIrecommenditforanyonelookingforagreatresourceforlearningaboutorbecomingabetteruseroftheASPNETMVCframeworkNathanStott,PartnerandSoftwareEngineer,WhiteboardITI’mveryhappywiththisbookIwoulddefinitelyrecommendittoanyoneinterestedinASPNETMVCGettingthe‘beyondthetext’thatcomeswiththeCodeCampServerisjusticingonthecake,trulyChrisStewart,CompiledMonkeycomLicensedtoRobertSeder<robertsederhotmailcom>DownloadatPiniComASPNETMVCinActionJEFFREYPALERMO,BENSCHEIRMANJIMMYBOGARD,ERICHEXTERANDMATTHEWHINZEMANNINGGreenwich(wlong)LicensedtoRobertSeder<robertsederhotmailcom>ForonlineinformationandorderingofthisandotherManningbooks,pleasevisitwwwmanningcomThepublisheroffersdiscountsonthisbookwhenorderedinquantityFormoreinformation,pleasecontactSpecialSalesDepartmentManningPublicationsCoBroadStreetSuiteStamford,CTEmail:ordersmanningcombyManningPublicationsCoAllrightsreservedNopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmitted,inanyformorbymeanselectronic,mechanical,photocopying,orotherwise,withoutpriorwrittenpermissionofthepublisherManyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarksWherethosedesignationsappearinthebook,andManningPublicationswasawareofatrademarkclaim,thedesignationshavebeenprintedininitialcapsorallcapsRecognizingtheimportanceofpreservingwhathasbeenwritten,itisManning’spolicytohavethebookswepublishprintedonacidfreepaper,andweexertourbesteffortstothatendRecognizingalsoourresponsibilitytoconservetheresourcesofourplanet,ManningbooksareprintedonpaperthatisatleastpercentrecycledandprocessedwithouttheuseofelementalchlorineTechnicaleditor:JeremySkinnerDevelopmenteditor:KatharineOsborneManningPublicationsCoCopyeditor:AndyCarrollBroadStreet,SuiteCoverdesigner:MarijaTudorStamford,CTTypesetter:GordanSalinovicISBNPrintedintheUnitedStatesofAmerica–MAL–LicensedtoRobertSeder<robertsederhotmailcom>DownloadatPiniCombriefcontentsPARTHIGHSPEEDFUNDAMENTALSHighspeedbeginnerrampupPresentationmodelViewfundamentalsControllerbasicsConsumingthirdpartycomponentsHostingASPNETMVCapplicationsLeveragingexistingASPNETfeaturesvPARTJOURNEYMANTECHNIQUESDomainmodelExtendingthecontrollerAdvancedviewtechniquesSecurityAjaxinASPNETMVCControllerfactoriesModelbindersandvalueprovidersValidationLicensedtoRobertSeder<robertsederhotmailcom>BRIEFCONTENTSviPARTMASTERINGASPNETMVCRoutingDeploymenttechniquesMappingwithAutoMapperLightweightcontrollersFullsystemtestingOrganizationwithareasPortableareasDataaccesswithNHibernatePARTCROSSCUTTINGADVANCEDTOPICSDebuggingroutesCustomizingVisualStudioforASPNETMVCTestingpracticesRecipe:creatinganautocompletetextboxLicensedtoRobertSeder<robertsederhotmailcom>DownloadatPiniComcontentsforewordxvforewordtothefirsteditionxviprefacexviiiprefacetothefirsteditionxxacknowledgmentsxxiiiaboutthisbookxxviabouttheauthorsxxxaboutthecoverillustrationxxxiiiPARTHIGHSPEEDFUNDAMENTALSviiHighspeedbeginnerrampupWelcometoASPNETMVCTheMVCpatternCreatingyourfirstASPNETMVCprojectCreatingcontrollersandactionsCreatingviewsImprovingyourapplicationSummaryLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSviiiPresentationmodelTheMinMVCDeliveringthepresentationmodelViewDataModelRepresentinguserinputDesigningthemodelPresentingtheinputmodelinaviewWorkingwiththesubmittedinputMorecomplexmodelsforbothdisplayandinputDesigningthemodelWorkingwiththeinputmodelSummaryViewfundamentalsIntroducingviewsExaminingtheViewDataDictionaryStronglytypedviewswithaviewmodelDisplayingviewmodeldatainaviewUsingstronglytypedtemplatesEditorForandDisplayFortemplatesBuiltintemplatesSelectingtemplatesCustomizingtemplatesSummaryControllerbasicsTheanatomyofacontrollerStoryboardinganapplicationTransformingamodeltoaviewmodelAcceptinginputHandlingthesuccessfulstoryboardpathinanactionUsingthePostRedirectGetpatternHandlingthefailureprocessingoftheactioninputTestingcontrollersTestingtheRedirectControllerMakingdependenciesexplicitUsingtestdoubles,suchasstubsandmocksElementsofagoodcontrollerunittestSummaryConsumingthirdpartycomponentsTheMvcContribGridcomponentUsingtheMvcContribGridMvcContribGridadvancedusageLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSixDownloadatPiniComTheSlickUploadcomponentSummaryHostingASPNETMVCapplicationsDeploymentscenariosXCOPYdeploymentDeployingtoIISDeployingtoIISandearlierConfiguringroutestousetheaspxextensionConfiguringroutestouseacustomextensionUsingwildcardmappingwithselectivedisablingUsingURLrewritingSummaryLeveragingexistingASPNETfeaturesASPNETservercontrolsTheTextBoxOthercommoncontrolsTheGridViewWheredoIgetthegoodstuffStatemanagementCachingSessionstateCookiesRequeststorageTracinganddebuggingTraceContextHealthmonitoringImplementingpersonalizationandlocalizationLeveragingASPNETpersonalizationLeveragingASPNETlocalizationImplementingASPNETsitemapsSummaryPARTJOURNEYMANTECHNIQUESDomainmodelUnderstandingthebasicsofdomaindrivendesignAsampledomainmodelKeyentitiesandvalueobjectsAggregatesPersistenceforthedomainmodelSummaryLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSxExtendingthecontrollerControllerextensibilityControlleractionsAction,authorization,andresultfiltersActionselectorsUsingactionresultstoreducecomplexityRemovingduplicationwithanactionresultUsingactionresultstoabstracthardtotestdependenciesSummaryAdvancedviewtechniquesEliminatingduplicationintheviewMasterpagesPartialsChildactionsBuildingquerystringparameterlistsExploringtheSparkviewengineInstallingandconfiguringSparkSimpleSparkviewexampleSummarySecurityAuthenticationandauthorizationRequiringauthenticationwithAuthorizeAttributeRequiringauthorizationwithAuthorizeAttributeAuthorizeAttributehowitworksCrosssitescripting(XSS)XSSinactionAvoidingXSSvulnerabilitiesCrosssiterequestforgery(XSRF)XSRFinactionPreventingXSRFJSONhijackingSummaryAjaxinASPNETMVCDivingintoAjaxwithanexampleAjaxwithASPNETWebFormsAjaxinASPNETMVCIntroducingjQueryImplementingtheHijaxtechniqueAjaxwithJSONAddingalternateviewformatstothecontrollerConsumingaJSONactionfromtheviewAjaxhelpersSummaryLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSxiDownloadatPiniComControllerfactoriesWhatarecontrollerfactoriesCreatingacustomcontrollerfactoryEnablingdependencyinjectioninyourcontrollersCreatingaStructureMapcontrollerfactoryCreatingaNinjectcontrollerfactoryCreatingaCastleWindsorcontrollerfactorySummaryModelbindersandvalueprovidersCreatingacustommodelbinderUsingcustomvalueprovidersSummaryValidationValidationwithDataAnnotationsExtendingtheModelMetadataProviderClientsidevalidationwithASPNETAjaxSummaryPARTMASTERINGASPNETMVCRoutingWhatareroutesWhat’sthatcurlcommandTakingbackcontroloftheURLwithroutingDesigningaURLschemaMakesimple,cleanURLsMakehackableURLsAllowURLparameterstoclashKeepURLsshortAvoidexposingdatabaseIDswhereverpossibleConsideraddingunnecessaryinformationImplementingroutesinASPNETMVCURLschemaforanonlinestoreAddingacustomstaticrouteAddingacustomdynamicrouteCatchallroutesUsingtheroutingsystemtogenerateURLsTestingroutebehaviorLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSxiiUsingroutingwithexistingASPNETprojectsSummaryDeploymenttechniquesEmployingcontinuousintegrationEnablingpushbuttonXCOPYdeploymentsManagingenvironmentconfigurationsEnablingremoteserverdeploymentswithWebDeploySummaryMappingwithAutoMapperIntroducingAutoMapperLifebeforeAutoMapperAutoMapperbasicsAutoMapperInitializationAutoMapperprofilesSanitycheckingReducingrepetitiveformattingcodeAnotherlookatourviewsSummaryLightweightcontrollersWhylightweightcontrollersMaintainabilityTestabilityFocusingonthecontroller’sresponsibilityManagingcommonviewdataDerivingactionresultsUsinganapplicationbusSummaryFullsystemtestingTestingtheuserinterfacelayerInstallingthetestingsoftwareWalkingthroughthetestmanuallyAutomatingthetestRunningthetestBuildingmaintainablenavigationInteractingwithformsAssertingresultsSummaryLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSxiiiDownloadatPiniComOrganizationwithareasCreatingabasicareaManaginglinksandURLswithTMVCSummaryPortableareasUnderstandingtheportableareaAsimpleportableareaConsumingportableareasCreatinganRSSwidgetwithaportableareaDistributingtheRssWidgetInteractingwiththeportableareabusSummaryDataaccesswithNHibernateFunctionaloverviewofreferenceimplementationApplicationarchitectureoverviewDomainmodeltheapplicationcoreNHibernateconfigurationinfrastructureoftheapplicationNHibernate’sconfigurationTheNHibernatemappingsimplebutpowerfulInitializingtheconfigurationUIisthepresentationofthemodelPullingittogetherSummaryPARTCROSSCUTTINGADVANCEDTOPICSDebuggingroutesExtendingtheroutingsystemInspectingroutesatruntimeSummaryCustomizingVisualStudioforASPNETMVCCreatingcustomTtemplatesLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSxivAddingacustomtestprojecttemplatetothenewprojectwizardSummaryTestingpracticesTestingroutesAvoidingtestcomplexityTestingcontrollersTestingmodelbindersTestingactionfiltersSummaryRecipe:creatinganautocompletetextboxCreatingthebasicautocompletetextboxStylingtheresultsSummaryindexLicensedtoRobertSeder<robertsederhotmailcom>DownloadatPiniComforewordEveryonceinawhile,ifyouarelucky,youmaygettoseehistoryinthemakingForme,oneofthosemomentsoccurredinOctoberofIsatonthefloorofafilledtocapacityconferenceroomeagerlywatchingMicrosoft’sScottGuthrieunveilthepreviewversionofwhatwouldlaterbecomeMicrosoft’sASPMVCframeworkWhatwasshownthatdaywouldchangethisdeveloper’slifeandmanyotherdevelopers’livesforeverOnegroupofpeoplethatwasdirectlyaffectedbythisconferencesessionweretheauthorsofbotheditionsofthisbook:ASPNETMVCinActionThebookyouholdinyourhandsistheproductofhundredsofhoursofrealworldexperience,experimentation,anddocumentationofhowtobestusethenewestversionoftheMicrosoftASPNETMVCframeworkInASPNETMVCinActionyouwilllearnfromexpertusersoftheASPNETMVCxvframeworkonallsubjects:Routes,Controllers,ControllerFactories,ViewEngines,InputBuilders,Validations,andAreasFinally,youwillfindthediamondsandrubiessprinkledthroughoutthisbook:thetipsandtricksthatyoucanputtoimmediateuseOnethingIamsureofisthatthesecondeditionwillsufferthesamefateasmycopyofthefirsteditionItwillbecomeacoffeestained,dogeared,markedupresourcethatIwillfindinvaluableinmydaytodayworkwiththeASPNETMVCframeworkRODPADDOCKOWNER,DASHPOINTSOFTWAREEDITORINCHIEF,CODEMAGAZINELicensedtoRobertSeder<robertsederhotmailcom>forewordtothefirsteditionThefinalversionofASPNETMVCwasreleasedMarchduringtheMixconferenceandnobodywascaughtbysurprisewithwhatwasinsideandthisisagoodthingBeforethedebutofthefinalversion,theproductteamhadreleasedmultiplepublicpreviewswithfullsourcecodeinanefforttoraisethebaronopennessandcommunityinvolvementforaMicrosoftproductWhywouldwedothisTransparencyandcommunityinvolvementarenoblegoals,buttheyaren’tnecessarilytheendgoalofaprojectWhatwe’rereallyafterisgreatproductIliketothinkofASPNETMVCasalmostanexperimenttodemonstratethattransparencyandcommunityinvolvementweregreatmeanstoachievingthatgoalAfterPreviewofASPNETMVCwasreleased,wereceivedalotoffeedbackfromdevelopersthatwritingunittestswithASPNETMVCwasdifficultJeffreyPalermo,thexvileadauthorofASPNETMVCinAction,wasamongthemostvocalinprovidingfeedbackduringthistimeWetookthisfeedbackandimplementedamajorAPIchangebyintroducingtheconceptofactionresults,whichwasamuchbetterdesignthanwehadbeforeCommunityinvolvementhelpedusbuildabetterproductASPNETMVCfocusesonsolidprinciplessuchasseparationofconcernstoprovideaframeworkthatisextremelyextensibleandtestableWhileit’spossibletochangethesourceasyouseefit,theframeworkisintendedtobeopenforextensionwithoutneedingtochangethesourceAnypartoftheframeworkcanbeswappedwithsomethingelseofyourchoosingDon’tliketheviewengineTrySparkviewengineDon’tlikethewayweinstantiatecontrollersHookinyourowndependencyinjectioncontainerLicensedtoRobertSeder<robertsederhotmailcom>FOREWORDTOTHEFIRSTEDITIONxviiDownloadatPiniComASPNETMVCalsoincludesgreattoolingsuchastheAddViewdialog,whichusescodegenerationtoquicklycreateaviewbasedonamodelobjectThebestpartisthatallthecodegenerationfeaturesinASPNETMVCrelyonTtemplatesandarethuscompletelycustomizableWiththisbook,Jeffreywillshareallthesefeaturesandmore,aswellasshowhowtoputthemtogethertobuildagreatapplicationIhopeyouenjoythebookandshareinhispassionforbuildingwebapplicationsKeepinmindthatthisbookisnotonlyaninvitationtolearnaboutASPNETMVC,butalsoaninvitationtojoininthecommunityandinfluencethefutureofASPNETMVCHappycoding!PHILHAACKSENIORPROGRAMMANAGERASPNETMVCTEAMMICROSOFTLicensedtoRobertSeder<robertsederhotmailcom>prefaceWhenManningPublicationsapproachedmetowritethefirsteditionofthisbook,IwasalreadyafrequentbloggeronthetopicofASPNETMVCandhadalreadypublishedanarticleo

用户评论(0)

0/200

精彩专题

上传我的资料

每篇奖励 +2积分

资料评价:

/49
仅支持在线阅读

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部