关闭

关闭

关闭

封号提示

内容

首页 ASP.NET MVC2 in Action

ASP.NET MVC2 in Action.pdf

ASP.NET MVC2 in Action

于庆-甲寅
2010-12-18 0人阅读 0 0 0 暂无简介 举报

简介:本文档为《ASP.NET MVC2 in Actionpdf》,可适用于IT/计算机领域

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:ordersmanningcom©byManningPublicationsCoAllrightsreservedNopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmitted,inanyformorbymeanselectronic,mechanical,photocopying,orotherwise,withoutpriorwrittenpermissionofthepublisherManyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarksWherethosedesignationsappearinthebook,andManningPublicationswasawareofatrademarkclaim,thedesignationshavebeenprintedininitialcapsorallcapsRecognizingtheimportanceofpreservingwhathasbeenwritten,itisManning’spolicytohavethebookswepublishprintedonacidfreepaper,andweexertourbesteffortstothatendRecognizingalsoourresponsibilitytoconservetheresourcesofourplanet,ManningbooksareprintedonpaperthatisatleastpercentrecycledandprocessedwithouttheuseofelementalchlorineTechnicaleditor:JeremySkinnerDevelopmenteditor:KatharineOsborneManningPublicationsCoCopyeditor:AndyCarrollBroadStreet,SuiteCoverdesigner:MarijaTudorStamford,CTTypesetter:GordanSalinovicISBNPrintedintheUnitedStatesofAmerica–MAL–LicensedtoRobertSeder<robertsederhotmailcom>DownloadatPiniCombriefcontentsPARTHIGHSPEEDFUNDAMENTALS■Highspeedbeginnerrampup■Presentationmodel■Viewfundamentals■Controllerbasics■Consumingthirdpartycomponents■HostingASPNETMVCapplications■LeveragingexistingASPNETfeaturesvPARTJOURNEYMANTECHNIQUES■Domainmodel■Extendingthecontroller■Advancedviewtechniques■Security■AjaxinASPNETMVC■Controllerfactories■Modelbindersandvalueproviders■ValidationLicensedtoRobertSeder<robertsederhotmailcom>BRIEFCONTENTSviPARTMASTERINGASPNETMVC■Routing■Deploymenttechniques■MappingwithAutoMapper■Lightweightcontrollers■Fullsystemtesting■Organizationwithareas■Portableareas■DataaccesswithNHibernatePARTCROSSCUTTINGADVANCEDTOPICS■Debuggingroutes■CustomizingVisualStudioforASPNETMVC■Testingpractices■Recipe:creatinganautocompletetextboxLicensedtoRobertSeder<robertsederhotmailcom>DownloadatPiniComcontentsforewordxvforewordtothefirsteditionxviprefacexviiiprefacetothefirsteditionxxacknowledgmentsxxiiiaboutthisbookxxviabouttheauthorsxxxaboutthecoverillustrationxxxiiiPARTHIGHSPEEDFUNDAMENTALSviiHighspeedbeginnerrampupWelcometoASPNETMVCTheMVCpatternCreatingyourfirstASPNETMVCprojectCreatingcontrollersandactionsCreatingviewsImprovingyourapplicationSummaryLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSviiiPresentationmodelTheMinMVCDeliveringthepresentationmodelViewDataModelRepresentinguserinputDesigningthemodel■Presentingtheinputmodelinaview■WorkingwiththesubmittedinputMorecomplexmodelsforbothdisplayandinputDesigningthemodel■WorkingwiththeinputmodelSummaryViewfundamentalsIntroducingviewsExaminingtheViewDataDictionaryStronglytypedviewswithaviewmodelDisplayingviewmodeldatainaviewUsingstronglytypedtemplatesEditorForandDisplayFortemplates■BuiltintemplatesSelectingtemplates■CustomizingtemplatesSummaryControllerbasicsTheanatomyofacontrollerStoryboardinganapplicationTransformingamodeltoaviewmodelAcceptinginputHandlingthesuccessfulstoryboardpathinanaction■UsingthePostRedirectGetpattern■HandlingthefailureprocessingoftheactioninputTestingcontrollersTestingtheRedirectController■Makingdependenciesexplicit■Usingtestdoubles,suchasstubsandmocksElementsofagoodcontrollerunittestSummaryConsumingthirdpartycomponentsTheMvcContribGridcomponentUsingtheMvcContribGrid■MvcContribGridadvancedusageLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSixDownloadatPiniComTheSlickUploadcomponentSummaryHostingASPNETMVCapplicationsDeploymentscenariosXCOPYdeploymentDeployingtoIISDeployingtoIISandearlierConfiguringroutestousetheaspxextension■Configuringroutestouseacustomextension■Usingwildcardmappingwithselectivedisabling■UsingURLrewritingSummaryLeveragingexistingASPNETfeaturesASPNETservercontrolsTheTextBox■Othercommoncontrols■TheGridView■WheredoIgetthegoodstuffStatemanagementCaching■Sessionstate■Cookies■RequeststorageTracinganddebuggingTraceContext■HealthmonitoringImplementingpersonalizationandlocalizationLeveragingASPNETpersonalization■LeveragingASPNETlocalizationImplementingASPNETsitemapsSummaryPARTJOURNEYMANTECHNIQUESDomainmodelUnderstandingthebasicsofdomaindrivendesignAsampledomainmodelKeyentitiesandvalueobjects■AggregatesPersistenceforthedomainmodelSummaryLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSxExtendingthecontrollerControllerextensibilityControlleractionsAction,authorization,andresultfiltersActionselectorsUsingactionresultstoreducecomplexityRemovingduplicationwithanactionresult■UsingactionresultstoabstracthardtotestdependenciesSummaryAdvancedviewtechniquesEliminatingduplicationintheviewMasterpages■Partials■ChildactionsBuildingquerystringparameterlistsExploringtheSparkviewengineInstallingandconfiguringSpark■SimpleSparkviewexampleSummarySecurityAuthenticationandauthorizationRequiringauthenticationwithAuthorizeAttribute■RequiringauthorizationwithAuthorizeAttribute■AuthorizeAttributehowitworksCrosssitescripting(XSS)XSSinaction■AvoidingXSSvulnerabilitiesCrosssiterequestforgery(XSRF)XSRFinaction■PreventingXSRF■JSONhijackingSummaryAjaxinASPNETMVCDivingintoAjaxwithanexampleAjaxwithASPNETWebFormsAjaxinASPNETMVCIntroducingjQuery■ImplementingtheHijaxtechniqueAjaxwithJSON■Addingalternateviewformatstothecontroller■ConsumingaJSONactionfromtheviewAjaxhelpersSummaryLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSxiDownloadatPiniComControllerfactoriesWhatarecontrollerfactoriesCreatingacustomcontrollerfactoryEnablingdependencyinjectioninyourcontrollersCreatingaStructureMapcontrollerfactoryCreatingaNinjectcontrollerfactoryCreatingaCastleWindsorcontrollerfactorySummaryModelbindersandvalueprovidersCreatingacustommodelbinderUsingcustomvalueprovidersSummaryValidationValidationwithDataAnnotationsExtendingtheModelMetadataProviderClientsidevalidationwithASPNETAjaxSummaryPARTMASTERINGASPNETMVCRoutingWhatareroutesWhat’sthatcurlcommand■TakingbackcontroloftheURLwithroutingDesigningaURLschemaMakesimple,cleanURLs■MakehackableURLsAllowURLparameterstoclash■KeepURLsshortAvoidexposingdatabaseIDswhereverpossible■ConsideraddingunnecessaryinformationImplementingroutesinASPNETMVCURLschemaforanonlinestore■Addingacustomstaticroute■Addingacustomdynamicroute■CatchallroutesUsingtheroutingsystemtogenerateURLsTestingroutebehaviorLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSxiiUsingroutingwithexistingASPNETprojectsSummaryDeploymenttechniquesEmployingcontinuousintegrationEnablingpushbuttonXCOPYdeploymentsManagingenvironmentconfigurationsEnablingremoteserverdeploymentswithWebDeploySummaryMappingwithAutoMapperIntroducingAutoMapperLifebeforeAutoMapperAutoMapperbasicsAutoMapperInitialization■AutoMapperprofilesSanitychecking■ReducingrepetitiveformattingcodeAnotherlookatourviewsSummaryLightweightcontrollersWhylightweightcontrollersMaintainability■Testability■Focusingonthecontroller’sresponsibilityManagingcommonviewdataDerivingactionresultsUsinganapplicationbusSummaryFullsystemtestingTestingtheuserinterfacelayerInstallingthetestingsoftware■Walkingthroughthetestmanually■Automatingthetest■RunningthetestBuildingmaintainablenavigationInteractingwithformsAssertingresultsSummaryLicensedtoRobertSeder<robertsederhotmailcom>CONTENTSxiiiDownloadatPiniComOrganizationwithareasCreatingabasicareaManaginglinksandURLswithTMVCSummaryPortableareasUnderstandingtheportableareaAsimpleportableareaConsumingportableareasCreatinganRSSwidgetwithaportableareaDistributingtheRssWidgetInteractingwiththeportableareabusSummaryDataaccesswithNHibernateFunctionaloverviewofreferenceimplementationApplicationarchitectureoverviewDomainmodeltheapplicationcoreNHibernateconfigurationinfrastructureoftheapplicationNHibernate’sconfiguration■TheNHibernatemappingsimplebutpowerful■InitializingtheconfigurationUIisthepresentationofthemodelPullingittogetherSummaryPARTCROSSCUTTINGADVANCEDTOPICSDebuggingroutesExtendingtheroutingsystemInspectingroutesatruntimeSummaryCustomizingVisualStudioforASPNETMVCCreatingcustomTtemplatesLicensedtoRobertSeder<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)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

评分:

/49

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部

举报
资料