HTMLregisterstartupscript

registerstartupscript  时间:2021-02-21  阅读:()
RealWorldASP.
NETBestPracticesFARHANMUHAMMADANDMATTMILNERApressTMRealWorldASP.
NETBestPracticesCopyright2003byFarhanMuhammadandMattMilnerOriginallypublishedbyApressin2003Allrightsreserved.
Nopartofthisworkmaybereproducedortransmittedinanyformorbyanymeans,electronicormechanical,includingphotocopying,recording,orbyanyinformationstorageorretrievalsystem,withoutthepriorwrittenpermissionofthecopyrightownerandthepublisher.
ISBN978-1-59059-100-0ISBN978-1-4302-0769-6(eBook)DOI10.
1007/978-1-4302-0769-6Trademarkednamesmayappearinthisbook.
Ratherthanuseatrademarksymbolwitheveryoccurrenceofatrademarkedname,weusethenamesonlyinaneditorialfashionandtothebenefitofthetrademarkowner,withnointentionofinfringementofthetrademark.
TechnicalReviewer:ScottStabbertEditorialDirectors:DanAppleman,GaryCornell,SimonHayes,MartinStreicher,KarenWatterson,JohnZukowskiAssistantPublisher:GraceWongProjectManager:TracyBrownCollinsDevelopmentEditor:AmiKnoxCopyEditor:KristenImlerCompositorandProofreader:KineticPublishingServices,LLCIndexer:LynnArmstrongCoverDesigner:KurtKramesProductionManager:KariBrooksManufacturingManager:TomDebolskiTheinformationinthisbookisdistributedonan"asis"basis,withoutwarranty.
Althougheveryprecautionhasbeentakeninthepreparationofthiswork,neithertheauthor(s)norApressshallhaveanyliabilitytoanypersonorentitywithrespecttoanylossordamagecausedorallegedtobecauseddirectlyorindirectlybytheinformationcontainedinthiswork.
Iwouldliketodedicatethisbooktomylovelywife,Luna,whosecontinuoussupportandencouragementmadethisbookpossible.
Iwouldalsoliketodedicatethisbooktomyparents,whotaughtmetodomybestineverythingIstart.
-FarhanMuhammadIwouldliketodedicatethisbooktomywife,Kristen,forthepatiencesheexhibitsaboutthemanyhoursspentinfrontofthecomputerandtheunlimitedamountofsupportsheprovidesforallmyendeavors.
IwouldnotbewhereIamwithouther.
-MattMilnerContentsataGlanceAbouttheAuthorxiAbouttheTechnicalReviewerxiiIntroductionxiiiChapter1Chapter2Chapter3Chapter4Chapter5Chapter6Chapter7Chapter8TheAgeofASP.
NET1Cache,Session,andViewState11Client-SideJavaScript:Oh,WhatFun!
51HandlingDataEffectively71UsingASP.
NETtoManageLists109UserControlsandServerControls137RemotingandWebServices161ConfiguringASP.
NETApplications179Index203vContentsAbouttheAuthorsxiAbouttheTechnicalReviewerxiiIntroductionxiiiChapter1TheAgeofASP.
NET.
1TheConceptofCodeBehind:SeparatingFactfromFiction1UsingInheritanceinCodeBehind5EventWiring8StayingAwayfromtheInitializeComponentMethod9Summary10Chapter2Cache,Session,andViewState.
11BeMindfuloftheCacheI11CacheProsandCons11PerformanceTestingwithDataCaching13WhenGoodCacheGoesBad19It'sStillTooSlow!
22RefreshingCachedData23ExtractingDatafromaDatabaseandSavingItintoanXMLFile24ExpiringCache27TheCacheltemRemovedCallbackDelegate27UnderstandingtheCacheDependencyClass29LosingCachedInformationWhenRestartingtheApplication30TheScalabilityIssuewithCachedObjects30Thrbo-ChargingwithOutputCaching31DecidingWhethertoMaintainViewState36ViewState:BehindtheScenes38UnderstandingtheSessionObject42In-ProcessSession43StateServer43SQLServerSession43PerformanceTestingtheSessionObject44SummarysoviiContentsChapter3Client-SideJavaScript:Oh,WhatFun!
51CapturingEventsRaisedbyHTMLControlswithJavaScript52ServerControlAttributes53JavaScriptinASP.
NET:AProblematicSolution54DynamicallyGeneratingJavaScriptCode55UsingtheRegisterArrayDeclarationMethod56UsingtheRegisterClientScriptBlockMethod62UsingtheRegisterStartupScriptMethod65UsingtheRegisterOnSubmitStatementMethod68RemovingJavaScriptCodeProgrammatically69Summary69Chapter4HandlingDataEffectively71HandlingDatabyUsingDataSet71AnInherentProblemwithDataSet71UsingtheRawDataSettoCreateaVendorManagementSystem72HandlingDatabyUsingBusinessObjects:ABetterApproach76MethodsoftheCustomersClass79AddingBusinessRulestotheCustomersClass80HandlingDatabyUsingStronglyTypedCollections87GettingtoKnowtheCollectionBaseClass87MakingCustomerCollectionStronglyJYped90UsingaStronglyJYpedCollectionwithASP.
NETServerControls95TheMagicIsStillwiththe!
ListInterface98AddingaSearchMechanismtotheStronglyJYpedCollection98AddingRowStateCapabilitytotheStronglyJYpedCollection100ProvidingtheAbilitytoSorttheStronglyJYpedCollection104Summary107Chapter5UsingASP.
NETtoManageLists109DataBindingPerformanceDifferences109DataBindingPerformanceoftheDataGridControl110DataBindingPerformanceoftheDataListControl113DataBindingPerformanceoftheRepeaterControl116viiiContentsDataBindingTechniquesandTheirEffects120UsinganInlineFormatExpressionforDataBinding120UsinganEventHandlerforDataBinding122UsingMemberMethodsforDataBinding128UsingUserControlsEffectively132Summary136Chapter6UserControlsandServerControls.
137ChoosingaControlType137WorkingwithUserControls137BenefitsofPartial-PageCaching138WorkingwithServerControls141UserControlsvs.
ServerControls142BestPracticeswithUserControls143ExposingDatatoSubclasses,Containers,andSiblings143UsingEventstoCommunicateBetweenControls146SupportingTemplateswithUserControls149DynamicallyLoadingUserControls152BestPracticeswithServerControls153RaisingandHandlingEventsinServerControls153DesignTimeExperiencewithServerControls154AdditionalControlBestPractices155UsingViewStateSparinglybutEffectively155UsingClient-SideScriptwithControls156IndicatingtheScriptFileVersion157Summary160Chapter1RemotingandWebServices161RemotingOverview162Transport162SerializationFormat162ServerHost162Activation162StateManagement163WebServicesOverview163TellMeAlready!
WhenShouldIUseOneortheOther163BestPracticesThatAreCommontoRemotingandWebServices164SecuringYourRemoteCommunication165Performance166ixContentsRemotingBestPractices169ManagingTypesandInterfaces170WebServicesBestPractices174ManagingWSDLontheServerandServiceLocationsontheClient174Summary177Chapter8ConfiguringASP.
NETApplications179UnderstandingtheXMLConfigurationSystem179IdentifyingConfigurationSectionsandHandlers181LeveragingtheBuilt-InConfigurationHandlers185User-orEnvironment-SpecificSettings186ApplicationDomainsandAutomaticReloadingofConfigurationSettings190CascadingConfiguration191CreatingCustomConfigurationSectionHandlers197Summary201Index203XAbouttheAuthorsFARHANMUHAMMADistheChiefArchitectatILMProfessionalServices.
Heisatechnologyenthu-siastandhasbeenanevangelistforthe.
NETtechnologysinceitsinception.
Heleadsthe1\vinCities.
NETUserGroup,a400-member-strongcommunitythatfocusesonsharing.
NETknowl-edgeamongitsmembers.
HesitsontheboardofdirectorsfortheInternational.
NETAssociation(INETA),whereheisresponsiblefordevelopingstrategiesforsupporting.
NET-focusedcommuni-tiesineverycorneroftheworld.
HealsoleadsINETA'sSpeakersBureau,averysuccessfulpro-gramthatconnectsusergroupsthroughouttheU.
S.
withtop-notch.
NETexperts.
FarhanhoststheExecutive.
NETseminaronaregularbasis,whereexec-utivesareeducatedontheshort-andlong-termimpactofthe.
NETtechnologyontheirbusinesses.
HehasamastersdegreeinsoftwareengineeringfromtheUniversityofMinnesota.
MATTMILNERisaconsultantinMinneapolis,wherehedesignsanddevelops.
NETapplications.
HefocusesonsolvingbusinessproblemsbyusingMicrosofttechnologiesandisenthusiasticabout.
NET'scapabilitiesforbuildingenterpriseclassapplications.
Inadditiontohisworkwithclients,Mattenjoyshelpingotherslearnabout.
NET,whichiswhyhehascontributedtoseveralotherbooksandarticleson.
NET,andisanactivepartic-ipantandpresenterinthelocal.
NETusergroup.
xixiiAbouttheTechnicalReviewerSCOTTSTABBERTisaProgramManageratMicrosoft.
HehasbeenaleadfortheASPdevelopersupportteams,writtenandconductedtrainingforASP.
NETandWebservicesforMicrosoftaroundtheworld,andiscurrentlyatechnicalresourceforpartnersthatareimplementingMicrosoft's.
NETPassportandMSNAlertsservices.
ScottisanativeofRedmond,WA,andusedtolaunchrocketsinthebigemptyfieldwhereMicrosoftnowsits.
IntroductionWEHAVEBEENUSINGtheASP.
NETframeworkactivelysinceitsearlyinfancy(morethanayearbeforeofficialrelease)toprogrambusinesssolutionsforcor-porateAmerica.
Justlikemostpeople,westartedbypurchasingabunchofbooksandtriedtousethemtoabsorbasmuchknowledgeaswepossiblycould.
Itdidn'ttaketoolongforustorealizethatnoneofthosebooksgaveuswhatwereallyneeded.
Whatwereallyneededwaswisdom(notknowledge)onhowtousetheframeworkproperly-whattodo,whatnottodo,whythingsarethewaytheyare,andwhyASP.
NETisnotthebestthingsinceslicedbread.
Knowledgeisoverrated.
Itcanevenbeaplague,thekindthatcaneatyourskillsfromtheinside.
Awisemanoncesaid,don'tgivemetheknowledgeofahundredtoolstodotenthings;instead,showmetenwaystodoahundredthingsbetter.
Thepointwearetryingtomakeisthis:Itisofhigherimportanceforallofustolearntouseourtoolsappropriately,byleveragingotherpeople'swisdom.
Thedepthoftheknowledgewillcomeintime.
Whatweallneedcurrentlyistofocusonnotmakingrookiemistakes.
Thereisnoshameinfailure.
Wearenotagainstfailure.
Infact,weacquiremostofourwisdombymakingmistakesandlaterrectifyingthosemistakes.
However,whileweworkforotherindividualsorcorporations,itisourresponsibilitytomakefewermistakesbylearningfromotherpeople'sexperiences.
Thisbookisalsofullofouropinions.
Wefiguredthatifyouspendyourmoneybuyingourbook,youdeservetoknowwhatwereallythink.
Feelfreetodisagreewithusandevenletusknowwhyyoudo.
ThisbookshowsbestpracticesandsomecautionsrelatedtovariousareasoftheASP.
NETframework.
Westartthisbookbyadmiringthecode-behindpro-grammingmodel,arguablyoneofthebestfeaturesthatASP.
NETprovides.
Weareinlovewiththecode-behindstyleofWebprogramming.
Infact,itwasthisparticularfeaturethatinitiallyattractedbothofustowardexploringtherestofASP.
NETframework.
Afteradmiringthecode-behindstyleofprogramming,wemoveontoChapter2,wherewediscusswaystostoredatainmemorysothatwecanpro-videmuch-neededrelieftothedatabaseservers.
Inparticular,wespendmuchtimediscussingvariouscachingmechanismsandconductaseriesofperfor-manceteststodiscussbestpractices.
Afterdiscussingcachingmechanisms,westartonbestpracticesrelatedtosessionmanagement.
Agooddiscussiononcachingwouldn'tbecompletewithoutdelvingintoadiscussiononviewstate,andweclosethischapterbyshowingvariousissuesrelatedtoviewstateandhowtobestuseittoouradvantage.
xiiiIntroductionx:ivOneofourpetpeeveswith.
NETisitssupportofclientsideJavaScript,orlackthereof.
WededicatedallofChapter3todiscussingJavaScriptwhileshow-ingbestpractices,aswellasahealthydoseofcautions.
Abestpracticesbookwouldn'tbecompletewithoutadiscussionondatamanagement,soinChapter4,weshowbestpracticesrelatedtousingADO.
NET.
Wehavefoundmanynovice.
NETprogrammersusingtheDataSetobjectexten-sivelyandfeltthatweshouldeducateourreadersonother,moreadvancedmechanisms.
ThoughtheDataSetobjectprovidesmanyusefulfeatures,italsocomeswithaprice.
SuchshortfallsencouragedustousethischaptertocompareandcontrasttheDataSetobjectwithothermechanisms.
WefeelthatwewereextremelyluckytobeconsultantsduringtheearlydaysofASP.
NETtechnology.
Itgaveusopportunitiestoworkcloselywithmanyearlyadoptersandlearnaboutthecommonmistakesmostnoviceprogrammersmade.
OnesuchmistakewasusingtheDataGridWebservercontrolforalllistmanagementneeds.
AswiththeDataSetobject,wefeelthattheDataGridcon-trolisoverused.
Sure,itissimpleandeasytouseandcanbeconfiguredvisually,butasamuchheaviercontrol,itcausesmanyperformanceandscalabilityprob-lems.
Wedon'tdiscourageyoufromusingthiscontrol,butwewantedtodedicateChapter5todiscussinglistmanagementbestpractices.
Programmersoftenaskusaboutthedifferencebetweenusercontrolsandservercontrols.
ItcanbedifficulttodeterminewhichmechanismtousewhiledevelopingreusableWebcontrolsforyourprojects.
TheASP.
NETframeworkcansometimesbealittleambiguous;itprovidesmultiplewaysinwhichtoaccom-plishthesamepurposewithsubtledifferencesineachway.
WededicatedChapter6todiscussingthedifferencebetweenthesetwowaysofcreatingWebcontrolsandshowingyouthebestpracticesrelatedtoeachmechanism.
Notamonthgoesbywhenwedon'tseeatleastoneexampleofnovice.
NETprogrammersusingWebservicesfordistributedprogrammingwhenremotingwouldbeabetteralternative.
WefeltthatthesheervolumeofsuchclearmisuseofWebserviceswarrantedachapterofitsown.
Hence,Chapter7focusesentirelyoncomparingthedifferencesbetweenremotingandWebservicesandshowingbestpracticesforeachapproach.
ASP.
NETintroducesaninnovativemechanismtoconfigureWebappli-cations:theweb.
configfile.
Chapter8focusesoneducatingreadersonbestpracticesforusingtheweb.
configfile,includingcreatingcustomXML-basedconfigurationsections.
ASP.
NETisawonderfulnewenablingtechnologythatallowsustocreatebusinesssolutionsmuchmoreeffectivelythaneverbefore.
However,thereismuchroomforimprovement.
Youwon'toftenseethepotholesandpitfallsrelatedtothesetechnologiessimplybyreadingthebooks.
Instead,youmustexperiencethembysheddingsweatandblood.
(Okay,notblood!
)Wehopethisbookhelpsyou,thereader,avoidsuchroadblocksandfindeasierwaysasyoubecomeaccustomedtoASP.
NET.

易探云:香港CN2云服务器低至18元/月起,183.60元/年

易探云怎么样?易探云最早是主攻香港云服务器的品牌商家,由于之前香港云服务器性价比高、稳定性不错获得了不少用户的支持。易探云推出大量香港云服务器,采用BGP、CN2线路,机房有香港九龙、香港新界、香港沙田、香港葵湾等,香港1核1G低至18元/月,183.60元/年,老站长建站推荐香港2核4G5M+10G数据盘仅799元/年,性价比超强,关键是延迟全球为50ms左右,适合国内境外外贸行业网站等,如果需...

hostkvm:7折优惠-香港VPS韩国VPS,8折优惠-日本软银、美国CN2 GIA、新加坡直连VPS

hostkvm本月对香港国际线路的VPS、韩国CN2+bgp线路的VPS正在做7折终身优惠,对日本软银线路、美国CN2 GIA线路、新加坡直连线路的VPS进行8折终身优惠促销。所有VPS从4G内存开始支持Windows系统,当然主流Linux发行版是绝对不会缺席的!官方网站:https://hostkvm.com香港国际线路、韩国,7折优惠码:2021summer日本、美国、新加坡,8折优惠码:2...

月费$389,RackNerd美国大硬盘独立服务器

这次RackNerd商家提供的美国大硬盘独立服务器,数据中心位于洛杉矶multacom,可选Windows、Linux镜像系统,默认内存是64GB,也可升级至128GB内存,而且硬盘采用的是256G SSD系统盘+10个16TSAS数据盘,端口提供的是1Gbps带宽,每月提供200TB,且包含5个IPv4,如果有需要更多IP,也可以升级增加。CPU核心内存硬盘流量带宽价格选择2XE5-2640V2...

registerstartupscript为你推荐
iphone5解锁iphone5怎么解锁最新qq空间代码QQ空间代码吴晓波频道买粉五大知识付费平台有哪些?bluestacksbluestacks怎么用百度手写百度如何手写:办公协同软件最好用的协同办公软件是哪个直播加速有没有软件使已经下载好了的视频播放加速,例如30分钟的视频15分钟或者20分钟播放完vbscript教程请教一下高手们,这个VBS脚本难不难啊,我想学学这个,但是又不知道该从哪入手,希望高手指点指点??ios7固件下载ios 7及以上固件请在设备上点信任在哪点安装迅雷看看播放器迅雷看看播放器下了安装不了
com域名 n点虚拟主机管理系统 万网域名证书查询 westhost mach5 cloudstack payoneer 网站保姆 免费个人空间申请 adroit 流量计费 qq云端 爱奇艺vip免费领取 网游服务器 中国电信测速器 阿里云官方网站 789 web应用服务器 net空间 阵亡将士纪念日 更多