单项选择题
You are implementing an ASP.NET MVC 2 Web application that contains several folders. The Views/Shared/DisplayTemplates folder contains a templated helper named Score.ascx that performs custom formatting of integer values. The Models folder contains a class named Player with the following definition.Public Class Player Public Property Name As String Public Property LastScore As IntegerPublic Property HighScore As IntegerEnd Class You need to ensure that the custom formatting is applied to LastScore values when the HtmlHelper.DisplayForModel method is called for any view in the application that has a model of type Player. What should you do?()
A.Rename Score.ascx to LastScore.ascx.
B.Move Score.ascx from the Views/Shared/DisplayTemplates folder to the Views/Player/DisplayTemplates folder.
C.Add the following attribute to the LastScore property. <UIHint("Score")>
D.Add the following attribute to the LastScore property. <Display(Name:="LastScore", ShortName:="Score")>
相关考题
-
单项选择题
YouareimplementinganASP.NETapplicationthatincludesapagenamedTestPage.aspx.TestPage.aspxusesamasterpagenamedTestMaster.master.YouaddthefollowingcodetotheTestPage.aspxcode-behindfiletoreadaTestMaster.masterpublicpropertynamedCityName.ProtectedSubPage_Load(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMe.LoadDimsAsString=Master.CityNameEndSubYouneedtoensurethatTestPage.aspxcanaccesstheCityNameproperty.Whatshouldyoudo?()
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
