asp.netFlash应用基础

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

FoundationASP.NETforFlashRyanMooreLeadEditorsChrisMillsandMatthewMoodieTechnicalReviewerJoshuaBloomEditorialBoardSteveAnglin,DanAppleman,EwanBuckingham,GaryCornell,TonyDavis,JasonGilmore,JonathanHassell,ChrisMills,DominicShakeshaft,JimSumserProjectManagerBethChristmasCopyEditManagerNicoleLeClercCopyEditorLizWelchAssistantProductionDirectorKariBrooks-CoponyProductionEditorEllieFountainCompositorandArtistKatyFreerProofreaderAprilEddyIndexerBroccoliInformationManagementCoverImageDesignerCornévanDoorenInteriorandCoverDesignerKurtKramesManufacturingDirectorTomDebolskiFoundationASP.NETforFlashCopyright©2006byRyanMooreAllrightsreserved.Nopartofthisworkmaybereproducedortransmittedinanyformorbyanymeans,electronicormechanical,includingphotocopying,recording,orbyanyinformationstorageorretrievalsystem,withoutthepriorwrittenpermissionofthecopyrightownerandthepublisher.ISBN(pbk):1-59059-517-3PrintedandboundintheUnitedStatesofAmerica987654321DistributedtothebooktradeworldwidebySpringer-VerlagNewYork,Inc.,233SpringStreet,6thFloor,NewYork,NY10013.Phone1-800-SPRINGER,fax201-348-4505,e-mailorders-ny@springer-sbm.com,orvisit@apress.com,orvisit“asis”basis,withoutwarranty.Althougheveryprecautionhasbeentakeninthepreparationofthiswork,neithertheauthor(s)norApressshallhaveanyliabilitytoanypersonorentitywithrespecttoanylossordamagecausedorallegedtobecauseddirectlyorindirectlybytheinformationcontainedinthiswork.Thesourcecodeforthisbookisfreelyavailabletoreadersat’vegotyourdevelopmentenvironmentsetupandreadytogo,andyouunderstandsomeofthebasicconceptsofC#,we’rereadytomoveforwardintoASP.NETandthecreationofyourfirstASP.NETpage.Aswewalkthroughtheprocess,we’llinvestigatetheASP.NETcode-behindmodelandhowitcanbeusedtomanipulateASP.NETservercontrols.Usingthisknowledge,we’llthenwalkthroughabasicexampleofembeddinganASP.NETFlashservercontrolintoanASP.NETwebpageandpassingdatafromASP.NETtoaFlashmovieusingtheFlashVarsmethodofcommunication.GettingstartedinASP.NETNowthatwehaveagoodunderstandingofobject-orientedprogrammingconceptsandhaveaC#developmentenvironmentsetup,let’sgetstartedwithsomeASP.NETbasics.VisualStudio.NET2005hasmadetheprocessofcreatinganASP.NETprojectandjumpingrightinaneasyone.Muchofthesetupworkisdoneforyouorcanbeconfiguredthroughrichinterfaces.Firstthingsfirst,let’suseVS.NETtocreateanewASP.NETwebsite.1.OpenVS.NET2005andselectFile➤New➤Website.2.IntheNewWebSitedialogbox,selectVisualC#astheprojecttype,ASP.NETWebSiteastheprojecttemplate,andadirectoryofyourchoiceforthelocation,asshowninFigure3-1.Inthisbook,Iwillusethec:\foundationaspnet\directoryformyexamplefiles.Figure3-1.CreatinganASP.NETwebsiteusingVisualStudio.NET20053.ClickOK,andjustlikethat,youhavecreatedyourfirstASP.NETwebproject!62CHAPTER3Ifyourinstallationislikemine,yourdefaultscreenwilllooksimilartoFigure3-2.Thisscreenisdis-playingtheHTMLSourceviewofyourfirstASP.NETwebpage.AsyoucanseebylookingattheSolutionExplorerintheupper-rightdockablewindow,thenameofthisfirstfileisDefault.aspx.BeforemovingfurtherintothecodingofanASP.NETpage,let’stakeacloserlookatthewindowsintheVisualStudiointerfacethatImentionedinChapter1.Figure3-2.HTMLSourceviewinVisualStudio.NET2005First,let’sexaminetheDesignviewoftheDocumentwindow.IfyouarecurrentlyintheSourceview,youcaneasilyaccesstheDesignviewbyclickingtheDesignbuttonatthelowerleftoftheDocumentwindow,asshowninFigure3-3.63BASICSOFANASP.NETPROJECTFigure3-3.DesignviewinVisualStudio.NET2005TheDesignviewinVisualStudioissimilartomanyotherWYSIWYG(WhatYouSeeIsWhatYouGet)editors.ThevisualrepresentationofanASP.NETpageintheDesignviewisassimilaraspossibletowhatyourpagewilllooklikewhenpublishedfortheWeb.Asafirsttest,let’strytypingsometextdirectlyonthedesigninterface.Figure3-4showstheDesignview,afterthetext“FoundationASP.NETforFlash”hasbeentypeddirectlyontothescreen.Figure3-4.Designviewwiththetext“FoundationASP.NETforFlash”64CHAPTER3Asyoucansee,IhavealsoformattedthistextusingtheFormattingtoolbarinthetoptrayofVisualStudio.Thistoolbar,showninFigure3-5,functionsverysimilarlytooneintheFlashIDEorMicrosoftWord,providingoptionssuchasfontformattingandlinking.Figure3-5.TheFormattingtoolbarNowthatwehaveanASP.NETpagewithsometextcreatedintheDesignview,let’stakealookatwhatVisualStudiohasdonebehindthescenesforusbyselectingtheSourcetabatthebottomofthiswin-dow,asshowninFigure3-6.Figure3-6.TheSourceviewThisSourceviewdisplaystheHTMLthathasbeengeneratedbyVisualStudiofromyourdesign.IfyouarefamiliarwithotherwebWYSIWYGeditorslikeMacromediaDreamweaver,this

1 / 40
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功