单项选择题
You have created an ASP.NET server control named ShoppingCart for use by other developers. Some developers report that the ShoppingCart control does not function properly with ViewState disabled. You want to ensure that all instances of the ShoppingCart control work even if ViewState is disabled. What should you do?()
A.Require developers to set EnableViewStateMac to true.
B.Store state in ControlState instead of ViewState.
C.Serialize the state into an Application state entry called "MyControl"
D.Require developers to change the session state mode to SQL Server.
相关考题
-
多项选择题
YouareimplementinganASP.NETpagethathostsausercontrolnamedCachedControl.Youneedtoensurethatthecontentoftheusercontroliscachedfor10secondsandthatitisregeneratedwhenfetchedafterthe10secondselapse.Whichtwoactionsshouldyouperform?()
A.Modify the hosting page’s caching directive as follows.
B.Add the following meta tag to the Head section of the hosting page.
C.Add the following caching directive to the hosted control.
D.Add the following caching directive to the hosted control. -
单项选择题
YoucreateanASP.NETpagenamedTestPage.aspxthatcontainsvalidationcontrols.YouneedtoverifythatallinputvaluessubmittedbytheuserhavebeenvalidatedbytestingthePage.IsValidproperty.Whichpageeventshouldaddaneventhandlerto?()
A.Ini
B.Load
C.PreInit
D.PreLoad -
单项选择题
You are implementing a read-only page that includes the following controls. You disable view state to improve performance. You need to ensure that the page is updated to display the latest data when the user clicks the refresh button. Which code segment should you use?()
A.protected void Page_PreInit(object sender, EventArgs e) { if (!IsPostBack) { gvCustomers.DataSource = GetCustomers(); gvCustomers.DataBind(); } }
B.protected void Page_Load(object sender, EventArgs e) { gvCustomers.DataSource = GetCustomers(); gvCustomers.DataBind(); }
C.protected void gvCustomers_DataBinding(object sender, EventArgs e) { gvCustomers.DataSource = GetCustomers(); gvCustomers.DataBind(); }
D.protected void Page_PreRender(object sender, EventArgs e) { if (!IsPostBack) { gvCustomers.DataSource = GetCustomers(); gvCustomers.DataBind(); } }
