单项选择题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.


您可能感兴趣的试卷

你可能感兴趣的试题

2.单项选择题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(); } }

3.单项选择题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.

4.单项选择题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")

5.多项选择题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";

6.单项选择题

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.

7.多项选择题

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\" />");

8.多项选择题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"/>

9.多项选择题You create a Web page named TestPage.aspx and a user control named TestUserControl.ascx. TestPage.aspx uses TestUserControl.ascx as shown in the following line of code. On TestUserControl.ascx, you need to add a read-only member named CityName to return the value "New York". You also must add code to TestPage.aspx to read this value. Which two actions should you perform?()

A.Add the following line of code to the TestUserControl.ascx.cs code-behind file. public string CityName { get { return "New York"; } } 
B.Add the following line of code to the TestUserControl.ascx.cs code-behind file. protected readonly string CityName = "New York"; 
C.Add the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.CityName; } 
D.Add the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.Attributes["CityName"]; } 

10.单项选择题You create a Web page named TestPage.aspx and a user control named contained in a file named TestUserControl.ascx.You need to dynamically add TestUserControl.ascx to TestPage.aspx. Which code segment should you use?()

A.protected void Page_Load(object sender, EventArgs e) { Control userControl=Page.LoadControl("TestUserControl.ascx"); Page.Form.Controls.Add(userControl); }
B.protected void Page_Load(object sender, EventArgs e) { Control userControl = Page.FindControl("TestUserControl.ascx"); Page.Form.Controls.Load(userControl); }
C.protected void Page_PreInit(object sender, EventArgs e) { Control userControl =Page.LoadControl("TestUserControl.ascx");Page.Form.Controls.Add(userControl); }
D.protected void Page_PreInit(object sender, EventArgs e) { Control userControl = Page.FindControl("TestUserControl.ascx"); Page.Form.Controls.Load(userControl); }

最新试题

Which class defines the contract that ASP.NET implements to provide membership services using custom membership providers?()

题型:单项选择题

You are developing an ASP.NET Web application. The application must pass an object that contains user-specific data between multiple pages. The object ismore than 100 KB in size when serialized.You need to minimize the amount of data is sent to the user.What should you do?()

题型:单项选择题

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?()

题型:单项选择题

You work as an ASP.NET Web Application Developer for SomeCompany. The company uses Visual Studio .NET 2010 as its application development platform.  You are creating an ASP.NET Web application using .NET Framework 4.0. The Web application comprises a class named Employee with properties named as First Name, Last Name, and Age. You add a Web page in which you get a list of Employee objects and display those objects in a GridView control. You are required to add code so that the GridView row is highlighted in red color if the age of the employee is less than 21 years.  What will you do to accomplish this?()

题型:单项选择题

You are implementing an ASP.NET Web page. The page includes several controls, but only a GridView requires view state. You set the GridView… You need to ensure that the page will omit unneeded view state. Wich @ Page directive should you use?()

题型:单项选择题

You are developing a Asp.net web application tht includes a panel control that has ID contentsection.You need to add a textBox control to the panel control.()

题型:单项选择题

Which utility allows you to pre-compile and publish your Web site to a new location?()

题型:单项选择题

You are developing a WCF service. The service includes an operation names GetProduct. You need to ensure that GetProduct will accept a POST request and will indicate that the returned data is XML.  Which two actions should you perform?()

题型:多项选择题

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?()

题型:单项选择题

Which control allows you to bind to data items that are returned from a data source and display them?()

题型:单项选择题