单项选择题
You are implementing an ASP.NET application that includes a page named TestPage.aspx. TestPage.aspx uses a master page named TestMaster.master.You add the following code to the TestPage.aspx code-behind file to read a TestMaster.master public property named CityName. Protected Sub Page_Load(ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.LoadDim s As String = Master.CityNameEnd Sub You need to ensure that TestPage.aspx can access the CityName property. What should you do?()
A.Add the following directive to TestPage.aspx. <%@ MasterType VirtualPath="~/TestMaster.master" %>
B.Add the following directive to TestPage.aspx. <%@ PreviousPageType VirtualPath="~/TestMaster.master" %>
C.Set the Strict attribute in the @ Master directive of the TestMaster.master page to true.
D.Set the Explicit attribute in the @ Master directive of the TestMaster.master page to true.
相关考题
-
单项选择题
YouaretroubleshootinganASP.NETWebapplication.Systemadministratorshaverecentlyexpandedyourwebfarmfromonetotwoservers.Usersareperiodicallyreportinganerrormessageaboutinvalidviewstate.Youneedtofixtheproblem.Whatshouldyoudo?()
A.Set viewStateEncryptionMode to Auto in web.config on both servers.
B.Set the machineKey in machine.config to the same value on both servers.
C.Change the session state mode to SQLServer on both servers and ensure both servers use the same connection string.
D.Override the SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium methods in the page base class to serialize the view state to a local web server file. -
单项选择题
YoucreateanASP.NETpagenamedTestPage.aspxthatcontainsvalidationcontrols.Youneedtoverifythatallinputvaluessubmittedbytheuserhavebeenvalidatedbytestingthe Page.IsValidproperty.Whichpageeventshouldyouaddaneventhandlerto?()
A.Init
B.Load
C.PreInit
D.PreLoad -
单项选择题
YouaredevelopinganASP.NETWebapplication.Youcreateamasterpage.Themasterpagerequiresaregionwhereyoucanaddpage-specificcontentbyusingtheASP.NETpagedesigner.Youneedtoaddacontroltothemasterpagetodefinetheregion.Whichcontrolshouldyouadd?()
A.Content
B.ContentPlaceHolder
C.PlaceHolder
D.Substitution
