单项选择题

You are implementing an ASP.NET page. You add and configure the following ObjectDataSource. 

The page will be called with a query string field named pid. You need to configure the ObjectDataSource control to pass the value of the pid field to GetProductsByProductId method. What should you do? ()

A.Replace the asp:QueryStringParameter with the following declaration.
B.Replace the asp:QueryStringParameter with the following declaration.
C.Add the following event handler to the Selecting event of the ObjectDataSource control.
D.Add the following code segment to the page’s code-behind.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题You are implementing an ASP.NET page. The page includes a method named GetCustomerOrderDataSet that returns a DataSet. The DataSet includes a DataTable named CustomerDetailsTable and a DataTable named OrderDetailsTable. You need to display the data in OrderDetailsTable in a DetailsView control named dtlView. Which code segment should you use?()

A. dtlView.DataSource = GetCustomerOrderDataSet(); dtlView.DataMember = "OrderDetailsTable"; dtlView.DataBind();
B.dtlView.DataSource = GetCustomerOrderDataSet(); dtlView.DataSourceID = "OrderDetailsTable"; dtlView.DataBind();
C.dtlView.DataSource = GetCustomerOrderDataSet(); dtlView.DataKeyNames = new string [] { "OrderDetailsTable"}; dtlView.DataBind();
D.DataSet dataSet = GetCustomerOrderDataSet(); dtlView.DataSource = new DataTable("dataSet", "OrderDetailsTable"); dtlView.DataBind();

2.单项选择题You deploy an ASP.NET application to an IIS server. You need to log health-monitoring events with severity level of error to the Windows application event log. What should you do?()

A.Run the aspnet_regiis.exe command.
B.Set the Treat warnings as errors option to All in the project properties and recompile.
C.Add the following rule to the  section of the web.config file.
D.Add the following rule to the  section of the web.config file.

4.单项选择题You are implementing an ASP.NET Web site. The site uses a component that must be dynamically configured before it can be used within site pages. You create a static method named SiteHelper.Configure that configures the component. You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first time, and only the first time, that any page in the site is requested. Which code segment should you use? ()

A.void Application_Start(object sender, EventArgs e) { SiteHelper.Configure(); }
B.void Application_Init(object sender, EventArgs e) { SiteHelper.Configure(); }
C.void Application_BeginRequest(object sender, EventArgs e) { SiteHelper.Configure(); }
D.Object lockObject = new Object(); void Application_BeginRequest(object sender, EventArgs e) { lock(lockObject()) { SiteHelper.Configure(); } }

5.单项选择题You are implementing an ASP.NET Web site. The root directory of the site contains a page named Error.aspx. You need to display the Error.aspx page if an unhandled error occurs on any page within the site. You also must ensure that the original URL in the browser is not changed. What should you do?()

A.Add the following configuration to the web.config file.
B.Add the following configuration to the web.config file.
C.Add the following code segment to the Global.asax file.
D.Add the following code segment to the Global.asax file.

6.单项选择题You are creating an ASP.NET Web site. The site is configured to use Membership and Role management providers. You need to check whether the currently logged-on user is a member of a role namedAdministrators. Which code segment should you use?()

A.bool isMember = Roles.GetUsersInRole("Administrators").Any()
B.bool isMember = Membership.ValidateUser(User.Identity.Name, "Administrators")
C.bool isMember = Roles.GetRolesForUser("Administrators").Any()
D.bool isMember = User.IsInRole("Administrators")

7.多项选择题You create an ASP.NET page that contains the following tag.  Page Name  You need to write code that will change the contents of the tag dynamically when the page is loaded. What are two possible ways to achieve this goal?()

A.this.hdr1.InnerHtml = "Text";
B.(hdr1.Parent as HtmlGenericControl).InnerText = "Text";
C.HtmlGenericControl h1 = this.FindControl("hdr1") as HtmlGenericControl;h1.InnerText = "Text";
D.HtmlGenericControl h1 = Parent.FindControl("hdr1") as HtmlGenericControl;h1.InnerText = "Text";

8.单项选择题

You are implementing an ASP.NET page that includes the following drop-down list.
You need to dynamically add values to the end of the drop-down list. What should you do? ()

A.Add the following OnPreRender event handler to the asp:DropDownList
B.Add the following OnPreRender event handler to the asp:DropDownList
C.Add the following event handler to the page code-behind.
D.Add the following event handler to the page code-behind.

9.多项选择题

You create a custom server control named Task that contains the following code segment.
You need to ensure that adding a Task control from the Toolbox creates markup in the following format. 
  
Which two actions should you perform?()

A.Add the following code segment to the project’s AssemblyInfo.cs file. [assembly: TagPrefix("DevControls", "Dev")]
B.Replace line 05 with the following code segment. [DefaultValue("New Task")]
C.Insert the following code segment immediately before line 03. [ToolboxData("<{0}:Task runat=\"server\" Title=\"New Task\" />")]
D.Replace line 10 with the following code segment. output.Write("<Dev:Task runat=\"server\" Title=\"New Task\" />");

10.多项选择题You use the following declaration to add a Web user control named TestUserControl.ascx to an ASP.NET page named TestPage.aspx.    You add the following code to the code-behind file of TestPage.aspx.  private void TestMethod(){ ...}You define the following delegate.  public delegate void MyEventHandler();  You need to add an event of type MyEventHandler named MyEvent to TestUserControl.ascx and attach the page’s TestMethod method to the event. Which two actions should you perform?()

A.Add the following line of code to TestUserControl.ascx.cs. public event MyEventHandler MyEvent;
B.Add the following line of code to TestUserControl.ascx.cs. public MyEventHandler MyEvent;
C.Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration. <uc:TestUserControl ID="testControl" runat="server" OnMyEvent="TestMethod"/>
D.Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration. <uc:TestUserControl ID="testControl" runat="server" MyEvent="TestMethod"/>

最新试题

The page will be posted to the server after one or more image files are selected for upload.You need to ensure that all unuploaded files are saved to the server within one call to a single event handler. What should you do? ()

题型:单项选择题

You are developing an ASP.NET MVC 2 Web Application. You need to implement an asynchronous controller named AccountingController, and you must ensure that the export action required proper authorization.Which code segment should you use?()

题型:单项选择题

In a web page with chechboxes you need to write e jquery that retruns the number checked checkboxes.()

题型:单项选择题

In a page there is a div (I guess it was a div) and you need to execute a javascript function when if first moves the mouse over the element.()

题型:单项选择题

You have to store user data of 200 KB in an object. Which state management technique to use:()

题型:单项选择题

Which method of the Page class searches the page naming container for a server control with a particular identifer?()

题型:单项选择题

You work as an ASP.NET Web Application Developer for SomeCompany. The company uses Visual Studio .NET 2010 as its application development platform.  You create an ASP.NET Web application using .NET Framework 4.0. The ASP.NET application is used to track employee performance. It uses Microsoft Windows authentication. Employees are members of a group named Employees.  Managers are members of a group named Managers.  The root folder of the application is named Details. The Details folder displays information about employees„ performance.  The Details folder has a subfolder named MoreDetails. You need to ensure that employees and managers can access pages stored in the Details folder. However, only managers can access pages stored in the MoreDetails folder.   You make the following entries in the Web.config file in the Details folder.You make the following entries in the Web.config file in the MoreDetails folder.When managers try to access pages stored in the MoreDetails folder, they receive the following error message:"An error occurred during the processing of a configuration file required to service this request." You must ensure that managers are able to access pages stored in the MoreDetails folder. What will you do to accomplish this?()

题型:单项选择题

You are developing an ASP.NET Web application.The application is configured to use the membership and role providers. You need to allow all users to perform an HTTP GET for application resources, but you must allow only the user named Moderator to perform a POST operation.Which configuration should you add to the web.config file?()

题型:单项选择题

Which tool is used to simplify the migration, management and deployment of IIS Web servers, Web applications and Web sites?()

题型:单项选择题

A library called contosobuisness.dll has been created and u need to accept it in a page.. all options had the <%assembly tag but the att differed.()

题型:单项选择题