70528课后题.docx
《70528课后题.docx》由会员分享,可在线阅读,更多相关《70528课后题.docx(64页珍藏版)》请在冰点文库上搜索。
70528课后题
Chapter1
Lesson1
1.WhatisthenameoftheWebpagepropertythatyoucanquerytodeterminethataWebpageisbeingrequestedwithoutdatabeingsubmitted?
(Chooseone.)
A.FirstGet
B.Initialized
C.IncludesData
D.IsPostBack
CorrectAnswer:
D
A.Incorrect:
Thisisnotavalidpropertyname.
B.Incorrect:
Thisisnotavalidpropertyname.
C.Incorrect:
Thisisnotavalidpropertyname.
D.Correct:
ThispropertyistrueifdataisbeingsenttotheWebserverorfalseifthepageissimplybeingrequested.
Lesson2
1.IfyouwanttocreateaWebsiteonaremotecomputerthatdoesnothaveFrontPageServerExtensionsinstalled,whichWebsitetypewillyoucreate?
(Chooseone.)
A.RemoteHTTP
B.File
C.FTP
D.LocalHTTP
CorrectAnswer:
C
A.Incorrect:
ThisrequiresFrontPageServerExtensionsontheremotecomputer.
B.Incorrect:
ThisisonlyapplicableforWebsitesthatarecreatedonthelocaldevelopercomputer.
C.Correct:
YoucancreateaWebsiteonaremotecomputerusingFTPifFrontPageServerExtensionsarenotinstalledonthere
2.IfyouwanttocreateanewWebsiteonaWebserverthatishostedbyyourISPandtheWebserverhasFrontPageServerExtensionsinstalled,whattypeofWebsitewouldyoucreate?
(Chooseone.)
A.LocalHTTP
B.File
C.FTP
D.RemoteHTTP
CorrectAnswer:
D
A.Incorrect:
ThisisforlocalWebserversonly.
B.Incorrect:
ThisisonlyapplicableforWebsitesthatarecreatedonthelocaldevelopercomputer.
C.Incorrect:
ThisoptionisonlyusablewhencreatingaWebsiteonaremotecomputerusingFTPinsteadofFrontPageServerExtensions.
D.Correct:
ThisoptionworkswithFrontPageServerExtensionsontheremotecomputer.
3.Ifyouwanttoseparateyourserver-sidecodefromyourclient-sidecodeonaWebpage,whatprogrammingmodelshouldyouimplement?
(Chooseone.)
A.Separationmodel
B.Code-Behindmodel
C.In-Linemodel
D.ClientServermodel
CorrectAnswer:
B
A.Incorrect:
Thereisnosuchmodel.
B.Correct:
Thecode-behindmodelprovidesseparationofclient-sideandserver-sidecode.
C.Incorrect:
Thismodeldoesnotprovideseparation.
D.Incorrect:
Thereisnosuchmodel.
4.JoecreatedanewWebsiteusingVisualStudio2005,settingtheWebsitetypetoFile,andtheprogramminglanguagetoC#.Later,JoereceivedanelaborateWebpagefromhisvendor,whichconsistedoftheVendor.aspxfileandtheVendor.
aspx.vbcode-behindpage.WhatmustJoedotousethesefiles?
(Chooseone.)
A.JoecansimplyaddthefilesintotheWebsite,becauseASP.NET2.0supports
WebsitesthathaveWebpagesthatwereprogrammedwithdifferentlanguages.
B.TheVendor.aspxfilewillwork,butJoemustrewritethecode-behindpageusingC#.
C.BothfilesmustberewritteninC#.
D.JoemustcreateanewWebsitethatcontainsthesefilesandsetaWebreference
tothenewsite.
CorrectAnswer:
A
A.Correct:
ASP.NET2.0supportssitescontainingWebpagesthatarewrittenusingdifferentprogramminglanguages.
B.Incorrect:
Thecode-behindpagedoesnotneedtoberewritten.
C.Incorrect:
Thefilesdonotneedtoberewritten.
D.Incorrect:
WebreferencesareonlyusedwithWebservices.
Lesson3
1.YouwanttomakeaconfigurationsettingchangethatwillbeglobaltoallWebandWindowsapplicationsonthecurrentcomputer.Whichfiledoyouchange?
(Chooseone.)
A.Global.asax
B.Web.config
C.Machine.config
D.Global.asa
CorrectAnswer:
C
A.Incorrect:
ThisfileisusedinaWebapplicationonly.
B.Incorrect:
ThisfileneveraffectsanyWindowapplications.
C.Correct:
MakingchangestotheMachine.configfileaffectsWindowsandWebapplications.
D.Incorrect:
ThisisanASPfileandhasnoeffecton.NETapplications.
2.YouwanttomakeaconfigurationsettingchangethatwillaffectonlythecurrentWebapplication.Whichfilewillyouchange?
(Chooseone.)
A.Web.configthatisinthesamefolderastheMachine.configfile
B.Web.configintherootoftheWebapplication
C.Machine.config
D.Global.asa
CorrectAnswer:
B
A.Incorrect:
ThisfileisusedfordefaultWebsettings.
B.Correct:
ThisfileisusedtochangesettingsthataffectonlythecurrentWebapplication.
C.Incorrect:
SettingchangestotheMachine.configfilecanaffectWindowsandWebapplications.
D.Incorrect:
ThisisanASPfileandhasnoeffecton.NETapplications.
3.YouwanttomakeaconfigurationsettingchangethatwillaffectonlythecurrentWebapplication,andyouwanttouseatoolthathasauser-friendlyGraphicalUserInterface(GUI).Whichtoolshouldyouuse?
(Chooseone.)
A.TheMicrosoftManagementUtility
B.MicrosoftWord
C.VisualStudio,usingthe|Tools|Optionspath
D.WebSiteAdministrationTool
CorrectAnswer:
D
A.Incorrect:
Thereisnosuchtool.
B.Incorrect:
Thisprogramisusedtocreateandeditwordprocessingdocuments,
notmodifyWebapplications.
C.Incorrect:
ThisisusedtomakeglobalsettingchangestoVisualStudio2005.
D.Correct:
Thistoolpresentsauser-friendlyGUIthatcanbeusedtomodifyaWebsite’ssettings.
Lesson4
1.YouwanttoidentifywhicheventintheWebpagelifecycletakesthelongesttimetoexecute.Howcanyouaccomplishthis?
(Chooseone.)
A.TurnonASP.NETtraceandruntheWebapplication.Afterthat,reviewthetraceresults.
B.Addalineofcodetoeachofthelife-cycleeventsthatwillprintthecurrenttime.
C.IntheWeb.configfile,addthemonitorTimingsattributeandsetittoTrue.
D.IntheWebsiteproperties,turnontheperformancemonitorandruntheWebapplication.Afterthat,openperformancemonitortoseethetimings.
CorrectAnswer:
A
A.Correct:
UsetheASP.NETtracefacilitytoviewlife-cycleeventtimings.
B.Incorrect:
Thisisawasteofyourtime.
C.Incorrect:
ThereisnosuchattributeintheWeb.configfile.
D.Incorrect:
ThereisnosuchsettingintheWebsiteproperties.
2.Youwanttorunthetracecontinuouslytoenableyoutoquicklylookatthe10mostrecenttracesfromanyoneusingyourWebsite,butyouareconcernedaboutfillingyourharddrivewithanexcessiveamountofdata.Whichofthefollowing
settingswillaccomplishyourobjective?
(Chooseone.)
A.enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
mostRecent="true"/>
B.enabled="true"
requestLimit="10"
pageOutput="true"
traceMode="SortByTime"
localOnly="true"
mostRecent="true"/>
C.enabled="true"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
mostRecent="false"/>
D.enabled="true"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="false"
mostRecent="true"/>
CorrectAnswer:
D
A.Incorrect:
Youmustmakeenabled=”true”andlocalOnly=”false.”
B.Incorrect:
YoumustmakepageOutput=”false”andlocalOnly=”false.”
C.Incorrect:
YoumustmakemostRecent=”true.”
D.Correct:
Thesettingsarecorrect.
3.YouareinterestedinexaminingthedatathatispostedtotheWebserver.Whattraceresultsectioncanyouusetoseethisinformation?
(Chooseone.)
A.ControlTree
B.HeadersCollection
C.FormCollection
D.ServerVariables
CorrectAnswer:
C
A.Incorrect:
TheControlTreeshowsinformationabouteachcontrolontheWebpage,butnottheposteddata.
B.Incorrect:
TheHeadersCollectiondoesnotcontaintheposteddata.
C.Correct:
TheFormcollectioncontainstheposteddata.
D.Incorrect:
TheServerVariablesdon’tcontaintheposteddata.
Chapter2
Lesson1
1.ToaddanHTMLWebservercontroltotheWebpage,youmustdraganHTMLelementfromtheToolBoxtotheWebpageandthenperformwhichofthefollowing
tasks?
(Chooseone.)
A.Right-clicktheHTMLelementandclickRun=Server.
B.Double-clicktheHTMLelementtoconvertittoanHTMLservercontrol.
C.Right-clicktheHTMLelementandclickRunAsServerControl.
D.ClicktheHTMLelementandsetServerControltotrueinthePropertieswindow.
CorrectAnswer:
C
A.Incorrect:
Thisisnotavalidoptionwhenright-clicking.
B.Incorrect:
ThisisnotavalidoperationtoconverttoHTMLservercontrol.
C.Correct:
Right-clickandselectRunAsServerControltoconverttheHTMLelement.
D.Incorrect:
ThisisnotavalidoptioninthePropertieswindow.
2.YounoticedthatclickingaCheckBoxdoesnotcauseaPostBack;youneedtheCheckBoxtoPostBacksoyoucanupdatetheWebpagebasedonserver-sidecode.HowdoyoumaketheCheckBoxcauseaPostBack?
(Chooseone.)
A.SettheAutoPostBackpropertytotrue.
B.AddJavaScriptcodetocalltheForcePostBackmethod.
C.SetthePostBackAllpropertyoftheWebpagetotrue.
D.Addserver-sidecodetolistenfortheclickeventfromtheclient.
CorrectAnswer:
A
A.Correct:
SimplysettheAutoPostBackpropertyofthecontroltotrue.
B.Incorrect:
ThereisnomethodcalledForcePostBack.
C.Incorrect:
ThereisnopropertycalledPostBackAll.
D.Incorrect:
TheclientmakesnoattempttocommunicatewiththeserveruntilyousettheAutoPostBackpropertytotrue.
3.AfterwritingcodetocreateanewinstanceofaTextBoxservercontrol,whatdoyouneedtodotogettheTextBoxtodisplayontheWebpage?
(Chooseone.)
A.CalltheShowControlmethodontheTextBox.
B.SettheVisibleControltotrueontheTextBox.
C.AddtheTextBoxinstancetotheform1.Controlscollection.
D.ExecutetheAddControlmethodontheWebpage.
CorrectAnswer:
C
A.Incorrect:
ThereisnoShowControlmethodontheTextBox.
B.Incorrect:
ThereisnopropertycalledVisibleControlontheTextBox.
C.Correct:
TheTextBoxinstancemustbeaddedtotheControlscollectionofform1ortheControlscollectionofanyservercontrolthatexistsonthepage.
D.Incorrect:
ThereisnoAddControlmethodontheWebpage.
Lesson2
1.Ifyouwan