多项选择题你正在开发一个显示产品信息的 Web 应用。你的 Web 应用的不同页面上都会显示产品信息。为此,你需要开发一个用于产品信息显示的用户控件,并且需要为控件实现一个默认的用户界面。另外,你的控件需要为开发者提供可自定义的界面布局的功能。为了达到这个目的,你应该通过下面哪三步操作完成?()

A. 为类型为Itemplate的属性声明一个属性TemplateContainerAttribute。并且传递模板的命名 容器类型作为参数。
B. 为用户控件的类定义声明属性TemplateContainerAttribute 。
C. 在用户控件的code-behind 类中实现一个类型为INamingContainer 的属性。
D. 在用户控件的code-behind 类中实现一个类型为ITemplate的属性。
E. 定义一个从ITemplate 继承的新类。实现ITemplate 接口的InstantiateIn 方法。


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题你正在创建一个将包含几个子控件的自定义控件,你应该从下面那个类继承?()

A.DetailsView
B.ObjectDataSource
C.Content
D.CompositeControl

2.多项选择题你正在为 Web 应用创建一个控件 ContosoUI。你需要增加这个控件到 Microsoft VisualStudio .NET 的工具栏。你应该通过下面那两个操作完成?()

A. 创建ContosoUI控件为Web控件库。
B. 创建ContosoUI控件为Web用户控件。
C. 在Visual Studio .NET 工具栏,浏览并选择ContosoUI.ascx。
D. 在Visual Studio .NET 工具栏,浏览并选择ContosoUI.dll.

3.单项选择题你正在创建一个 Web 应用。你在 Web.config 文件中增加了如下的配置: 请问,你在代码中如何引用连接字符串?()

A.ConfigurationManager.ConnectionStrings.MyDB
B.ConfigurationManager.ConnectionStrings.System.Data.SqlClient
C.ConfigurationManager.ConnectionStrings[";MyDB";]
D.ConfigurationManager.ConnectionStrings[";System.Data.SqlClient";]

5.单项选择题你在创建一个 Web 窗体。这个 Web 窗体允许用户计算值并在名为 lblResults 的 Label 控件中显示结果。你需要在 Web 窗体通过 Error 事件截获所有未处理的异常并显示异常在 Web 窗体上。你可以使用下面那个代码段实现?()

A. protected void Page_Error(object sender, EventArgs e) { lblResults.Text = e.ToString();e=null;}
B. protected void Page_Error(object sender, EventArgs e) { lblResults.Text =Server.GetLastError().ToStri();Server.ClearError();}
C. protected void Page_Error(object sender, EventArgs e) Response.Write(e.ToString());e=null;}
D. protected void Page_Error(object sender, EventArgs e) Response.Write(Server.GetLastError().ToString()); Server.ClearError();}

6.单项选择题你的 Web 站点使用自定义主题,并且要求站点必须支持额外的基于公司名称的主题。公司名称在用户登录到 Web 站点时进行设置。公司的主题名存储在变量 ThemeName 中。你需要使用这个变量动态的设置 Web 站点的主题,你应该如何做?()

A.在Web站点的每个页面的声明标记中增加<%@pagetheme=”themename”…%>
B.在Web站点的每个页面的Load事件中增加Page.Theme=ThemeName;
C.在Web站点的每个页面的PreInit事件中增加Page.Theme=ThemeName;
D.在Web站点的配置文件中增加

7.单项选择题你正在创建一个 Web 窗体。它包含一个让用户关闭页面的按钮 btnCancel。当用户单击这个按钮的时候需要跳过验证。在测试过程中,你发现单击 Cancel 按钮并不能关闭页面。你需要确保用户始终能够关闭页面,你应该如何做?()

A. 设置Web窗体上验证控件的Enabled 属性为False。
B. 设置btnCancel 按钮的CausesValidation 属性为False.
C. 设置btnCancel 按钮的CausesValidation 属性为True.
D. 设置Web窗体上验证控件的Visible 属性为False。

8.多项选择题你正在开发一个使用 SqlConnection 对象连接到 Microsoft SQL Server 数据库的应用。你的连接对象正在使用连接池。当连接池满的时候请求将被排队或者某些连接请求可能被拒绝。你需要确保应用能够尽早的释放连接给连接池。因此,为了减少连接被拒的可能性,你应该从下面那三个方法着手解决?()

A. 确保完成执行后调用每个连接对象的Close方法。
B. 确保完成执行后每个连接对象保持打开状态。
C. 在连接字符串内增加Max Pool Size的值。
D. 在连接字符串内增加Min Pool Size的值。
E. 在连接字符串内增加Connection Lifetime的值。
F. 增加SqlConnection对象的ConnectionTimeout属性的值。

10.单项选择题你有一个需要大约执行一分钟的 SQL 查询。为此,你使用如下的代码段异步执行这个查询:IAsyncResult ar = cmd.BeginExecuteReader()。当上面SQL查询在执行的过程中,你需要同时执行一个方法Do Work(),这个方法大约需要1秒钟的执行时间。而且在SQL 查询执行的过程中需要尽可能的多次执行Do Work()方法,你应该使用下面那个代码段?()

A. while (ar.AsyncWaitHandle == null) { DoWork();}dr = cmd.EndExecuteReader(ar);
B. while (!ar.IsCompleted) { DoWork();}dr = cmd.EndExecuteReader(ar);
C. while (Thread.CurrentThread.ThreadState == ThreadState.Running) { Do Work();}dr =cmd.EndExecuteReader(ar);
D. while (!ar.AsyncWaitHandle.WaitOne()) { DoWork();}dr = cmd.EndExecuteReader(ar);

最新试题

You are creating a composite control for capturing user address information in a Web application. You define a number of properties that the user can set at design time. You need to group these properties in the Properties dialog box. In addition, you need to ensure that when users click on a particular property, they receive a short explanation of that property. The properties are shown in the exhibit.Which two actions should you perform?()

题型:多项选择题

You are creating a Web application that will run on an intranet. The Web application reads comma-delimited text files. The text files reside in a subdirectory below the Web application's root directory. Users must not be able to navigate directly to these files in a Web browser unless they are members of the Accounting role. You need to write an ASP.NET HTTP handler that will use the FileAuthorizationModule class.Which form of authentication should you use?()

题型:单项选择题

You create a Web site with membership and personalization enabled. You must use an existing CRM database for storing the membership information. You need to implement the Membership Provider.What should you do?()

题型:单项选择题

You create an intranet Web site for management of project documents. You need to enable all users to browse documents on the site. Only members of the administrators group must be ble to upload files.Which code segment of the Web.config file should you use?()

题型:单项选择题

Certkiller .com's e-Commerce Web application contains a page named Products.aspx that uses data source and data-bound server controls. Customers use the server controls to search for products. The Products.aspx page does not have an associated code-behind file. You need to convert the Products.aspx page to a user control so that its functionality can be reused on other pages.What should you do?()

题型:多项选择题

You create a Web Form that allows users to create a new account. You add a CreateUserWizard control by using the following code segment.You need to ensure that the wizard automatically sends an e-mail message to users when they finish creating their accounts. You add a valid element to the Web.config file.Which code segment should you add to the Page_Load event?()

题型:单项选择题

You create a large, n-tier Web application that has a custom event tracking system. You need to create a custom event type that enables your event tracking system to record all relevant event details for all types of events. The events must be stored in Microsoft SQL Server.From which base type should your custom event type inherit? ()

题型:单项选择题

You create a Web site. The Web site has many predefined roles and associated users that will be used for security purposes. You need to manage these roles and user accounts.Which tool should you use? ()

题型:单项选择题

You create a Web site that stores users' active themes in user profile objects. You need to apply users' preferred themes when they log on to the Web site.What should you do? ()

题型:单项选择题

You are developing a page named Process.aspx in a shopping cart Web application that will be integrated into Certkiller .com's existing e-Commerce Web site. The Process.aspx page allows customers to pay for purchases using their credit cards. The Process.aspx page contains a Button control that confirms the customer's payment and calls an external Web service that charges the customer's credit card. You must implement confirmation and prevent postback unless the customer confirms payment.What should you do?()

题型:单项选择题