资源描述:
《ASP英文文献 - 副本》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
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