欢迎来到牛牛题库网 牛牛题库官网
logo
全部科目 > 微软认证考试 > MCPD > MCPD(70-562)

单项选择题

You are employed as a Web Application Developer at Certkiller.com. You make use of Microsoft.NET Framework v3.5 to create an ASP.NET application. 
You create a class in the application that contains the code below. (The line numbers is includedfor reference purposes)
01 public object GetCachedProducts(sqlConnection conn) {
02
03  if (Cache["products"] == null) {
04  SqlCommand cmd = new SqlCommand("SELECT * FROM Products", conn);
05  conn.Open();
06  Cache.Insert("products", GetData(cmd));
07  conn.Close();
08  }
09  return Cache["products"];
10 }
11
12 public object GetData(SqlCommand prodCmd) {
13
14 } 
You notice that the GetCachedProducts method is called to provide this list from the Cache objectevery time a Web form has to access a list of products. To ensure productivity management wantsyou to make sure that there is always a list of products available in the Cache object. You thusneed to determine the appropriate code that should be added in line 13. 
What should you identify?()

A.A
B.B
C.C
D.D

点击查看答案

相关考题

单项选择题

Certkiller.com has employed you as a Web Application Developer. You are in the process ofcreating an ASP.NET application using Microsoft .NET Framework v3.5. You decide to create acustom Web user control for the application. 
You name this control TestShare. TestShare will be compiled as a library. The code below iswritten for TestShare. (The line numbers is included for reference purposes)
1 Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
2 MyBase.OnInit(e)
3
4 End Sub 
The master pages in the application contains the directive below:<%@ Master Language="VB" EnableViewState="false" %>
You receive an instruction from management to make sure that the state of TestShare is able tocontinue on the pages that reference a master page. You thus need to determine the appropriatecode that should be added at line 3. 
What should you identify?()

A.You should consider adding the Page.RegisterRequiresControlState(Me) code fragment.
B.You should consider adding the Page.UnregisterRequiresControlState(Me) code fragment.
C.You should consider adding the Page.RegisterStartupScript("TestShare", "server") codefragment.
D.You should consider adding the Page.RegisterRequiresPostBack(Me) code fragment.

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题