資源描述:
《ASP英文文獻(xiàn) - 副本》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、■■■ASP.NETAJAXSofar,you’velearnedtobuildwebpagesthatusethepostbackmodel.Withthepostbackmodel,pagesareperpetuallybeingsentbacktothewebserverandregenerated.Forexample,considerthegreetingcardmakeryoufirstsawinChapter6.Whentheuserpicksafont,enterssometext,orchoosesnewcol
2、ors,thepageispostedbacktothewebserver,allowingyourcodetorun.Thewebpagecodemakesthenecessaryadjustments,ASP.NETrendersthepagetoHTMLalloveragain,andthebrowserreceives(anddisplays)thenewversionofthepage.Thisprocessseemssomewhatlaborintensive,butit’sactuallynotthatbad.Th
3、etimerequiredtocompletethewholeprocess(transmittingtheposted-backpage,runningthecode,renderingthepage,andreturningthefinalHTML)issurprisinglyshort.However,theprocessisn’tseamless.Whenthegreetingcardisupdatedinthegreetingcardmaker,theentirepageisrefreshed,includingthe
4、partsthathaven’tchanged.Thisproducesadistractingflicker.Thisbrowserrefreshisalsoabitintrusive—forexample,thisprocessmightinterruptuserswhilethey’reinthemiddleofenteringinformationinanothercontrol,oritmightscrollthembacktothebeginningofthepageeventhoughtheywerepreviou
5、slylookingattheend.TheoverallexperienceofusingthegreetingcardmakerisquitedifferentfromtheexperienceofusingarichWindowsapplication,whichhasnonoticeableflickerandfeelsmuchmoreresponsive.Today,there’sanewgenerationofwebapplicationsthatbehavemorelikeWindowsapplicationsth
6、antraditionalwebpages.Theseapplicationsrefreshthemselvesquicklyandflicker-freeandsometimesincludeslicknewfeaturessuchasanimationanddraganddrop.Notableexamplesincludeweb-basedemailapplicationssuchasGmailandmappingtoolssuchasGoogleMaps.Otherwebsites—fromFacebooktoFlick
7、r—useAjaxfeaturesmoresubtlytoimproveresponsivenessandaddfrills.ThisnewbreedofwebapplicationsusesasetofdesignpracticesandtechnologiesknownasAjax.Ajaxisprogrammingshorthandforasetoftechniquesthatcreatemoreresponsive,dynamicpages.OneofthehallmarksofAjaxistheabilitytoref
8、reshpartofthepagewhileleavingtherestuntouched.Inthischapter,you’lllearnhowAjaxworksandyou’llseehowyoucanuseittocreaterich,responsiv