资源描述:
《外文翻译-Building Client-Side Widgets》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、毕业设计(论文)——外文翻译(原文)BuildingClient-SideWidgetsInChapter3,youlearnedhowtobuildtwoserver-sidewidgets:oneforRSS/AtomfeedsandonetodisplayFlickrphotos.Thebenefitofaserver-sidewidgetisthatyoucanuseVisualStudio’scomfortabledevelopmentenvironmenttowriteanddebugcode,butalsouseyourfavoriteprogramm
2、inglanguage,likeC#orVB.NET.However,server-sidewidgetsslowdownpageloadingandrequiretoomanypostbacks.Allthewidgetsonthepageareloadedontheserversideduringpageloadandasynchronouspostback.So,ifthewidgetsloaddatafromanexternalsource,thepageloadtimebecomesthecumulativeloadingtimeofallwidgets.
3、Moreover,server-sidewidgetsrequiretoomanypostbacksonsimpleactionslikepagingoreditingitemsonagrid.There’snowaytoavoidthepostbackbecauseyouarestoringtheobjectmodelontheserversideandyoufetchdatafromserverside.Nothingisstoredontheclientthatcanhelpfacilitateclient-sideoperations.Althoughser
4、ver-sidewidgetsareeasiertodevelopandmaintain,theyactuallyofferpoorperformancecomparedtoclient-sidewidgets.Ontheotherhand,client-sidewidgetsusemostlyJavaScript,sotheycanofferalotmoreinteractivityandfunctionalityonthebrowserwithoutrequiringanypostback.Becauseclient-sidewidgetsfetchdatafr
5、omexternalsourcesrightfromtheJava-Scriptandmaintainobjectmodelandstateontheclient,theyofferfunctionalitylikepaging,editing,andsortingrightontheclientwithoutmakinganypostback.Moreover,client-sidewidgetscancacheexternaldataonthebrowser,sosubsequentvisitsforclient-sidewidgetsbecomealotfas
6、terthanforserver-sidewidgetsbecausethedataneededforthewidgetiscachedonthebrowser.Inthischapter,youwillseehowyoucanimprovepageloadtimebydelayingserver-sidewidgetloading.Youwillalsolearnhowtomakepageloadingmuchfasterbymakingclient-sideRSSandFlickrphotowidgets,youwilldevelopaproxywebservi
7、ceforclient-sidewidgetsthatcanbeusedtofetchcontentfromexternalsourcesandcacheonthebrowser.OptimizingASP.NETAJAX6Justlikeotherframeworks,theASP.NETAJAXFrameworkisnotcapableofservingallofthespecificneedsforeverytypeofAjaxapplication.Frameworksarekeptsimpleandgenericenoughtosatisfy70per