单选题In your web application,you need to execute a block of code whenever the session object is first created. Which design will accomplish this goal?()A Create an HttpSessionListener class and implement the sessionInitialized method with that block ofcode.

题目
单选题
In your web application,you need to execute a block of code whenever the session object is first created. Which design will accomplish this goal?()
A

Create an HttpSessionListener class and implement the sessionInitialized method with that block ofcode.

B

Create an HttpSessionActivationListener class and implement the sessionCreated method with thatblock of code.

C

Create a Filter class, call the getSession(false) method, and if the result was null, then execute that block of code.

D

Create an HttpSessionListener class and implement the sessionCreated method with that block of code.


相似考题

3. You work as a Web Developer at Certkiller.com. You are in the process of creating a Webapplication using Microsoft ASP.NET 3.5.  You host the Web application in Microsoft Internet Information Services (IIS) 6.0. You browse theapplication and receive the following error message:  Server Application Unavailable  The web application you are attempting to access on this web server is currently unavailable.Please hit the "Refresh" button in your web browser to retry your request.  You view the Application event log and discover the following message:  It is not possible to run two different versions of ASP.NET in the same IIS process. Please use theIIS Administration Tool to reconfigure your server to run the application in a separate process.  To ensure productivity you need to solve this problem as quick as possible.  What should you do?()A、You should change the IIS isolation mode.B、You should assign the application to another application pool.C、You should configure all applications that are part of your application's application pool in orderto use the same version of ASP.NET.D、You should run the Aspnet_regiis.exe Tool.E、You should restart the application pool that hosts the application.

更多“In your web application,you need to execute a block of code ”相关问题
  • 第1题:

    As an administrator at Cer-tech .com, you install Web server (IIS) role on a server that runs WindowsServer 2008. You created a new site called Cer-tech .com. You need to install an application on thewebsite called web content. You copy the application to the server. What should you do to add theapplication on the website?()

    • A、Create a virtual directory and copy the website contents in it. Copy the application in the directory andinstall it
    • B、Execute appcmd command on the command prompt on the server
    • C、Open the IIS Manager Console and select the website. Select Add Application
    • D、Execute appcmd -t on the command prompt on the server

    正确答案:C

  • 第2题:

    You are creating a templated Web control for use in your Web application. You need to add the Web control to your Web application pages without compiling your control into a .dll file. What should you do?()

    • A、Ensure that the Web control inherits from the WebControl class.
    • B、Ensure that the Web control inherits from the Control class.
    • C、Ensure that the Web control inherits from the CompositeControl class.
    • D、Ensure that the Web control inherits from the UserControl class.

    正确答案:D

  • 第3题:

    You develop a Web application. Your application contains two settings in the Web.config file. You deploy your application to production. You need to modify the application settings in the production environment without manually editing the XML markup in the Web.config file. What should you do? ()

    • A、Modify the application settings by using the Web Site Administration Tool.
    • B、Modify the application settings by using the Visual Studio property page editor for the project.
    • C、Modify the application settings by using the resource editor.
    • D、Modify the application settings by using the Visual Studio start options editor.

    正确答案:A

  • 第4题:

    You create a Web Form. The Web Form allows users to log on to a Web site. You implement the login logic using a Login control named Login1. The membership data for the application is stored in a SQL Express database in the App_Data directory. You need to configure your application so that the membership data is stored in a local Microsoft SQL Server database. You add the following code segment to the Web.config file. Which two additional actions should you perform?()

    • A、Use Aspnet_regsql.exe to create the Microsoft SQL Server database.
    • B、Set Login1's MembershipProvider property to MySqlProviderConnection.
    • C、Add the following code segment to the Web.config file.<connectionStrings> <add name="MySqlProviderConnection" connectionString="valid connection string" /></connectionStrings>
    • D、Add the following code segment to the Web.config file.  <appSettings><add key="MySqlProviderConnection" value="valid connection string" /></appSettings>
    • E、In the ASP.NET configuration settings within IIS, ensure that Role Management Enabled is selected.
    • F、Use the Web Site Administration Tool to select AspNetSqlMembershipProvider as the membership provider for your application.

    正确答案:B,D

  • 第5题:

    单选题
    You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You plan to deploy the application to a test server.  You need to ensure that during the initial request to the application, the code-behind files for the Web pages are compiled. You also need to optimize the performance of the application.  Which code fragment should you add to the Web.config file?()
    A

    <compilation debug=true> 

    B

    <compilation debug=false> 

    C

    <compilation debug=true batch=true> 

    D

    <compilation debug=false batch=false>


    正确答案: B
    解析: 暂无解析

  • 第6题:

    多选题
    You are creating a new JSP page and you need to execute some code that acts when the page is firstexecuted, but only once. Which three are possible mechanisms for performing this initialization code?()
    A

    In the init method.

    B

    In the jspInit method.

    C

    In the constructor of the JSP’s Java code.

    D

    In a JSP declaration, which includes an initializer block.

    E

    In a JSP declaration, which includes a static initializer block.


    正确答案: B,C
    解析: 暂无解析

  • 第7题:

    单选题
    You want to enable users of a Web application to modify the Web application's UI and behavior. These modifications must be maintained at the user level so that when users return to the Web application, the changes are still in effect. You need to achieve this goal by using the minimum amount of custom code. What should you do?()
    A

    Persist control data by using view state.

    B

    Use Web Part controls.

    C

    Maintain a profile for each user.

    D

    Enable session state on the Web application.


    正确答案: B
    解析: 暂无解析

  • 第8题:

    多选题
    You work as a Web Developer at Certkiller.com. You are in the process of creating a Webapplication using Microsoft ASP.NET 3.5.  You host the Web application in Microsoft Internet Information Services (IIS) 6.0. You browse theapplication and receive the following error message:  Server Application Unavailable  The web application you are attempting to access on this web server is currently unavailable.Please hit the "Refresh" button in your web browser to retry your request.  You view the Application event log and discover the following message:  It is not possible to run two different versions of ASP.NET in the same IIS process. Please use theIIS Administration Tool to reconfigure your server to run the application in a separate process.  To ensure productivity you need to solve this problem as quick as possible.  What should you do?()
    A

    You should change the IIS isolation mode.

    B

    You should assign the application to another application pool.

    C

    You should configure all applications that are part of your application's application pool in orderto use the same version of ASP.NET.

    D

    You should run the Aspnet_regiis.exe Tool.

    E

    You should restart the application pool that hosts the application.


    正确答案: A,D
    解析: 暂无解析

  • 第9题:

    You are creating a new JSP page and you need to execute some code that acts when the page is firstexecuted, but only once. Which three are possible mechanisms for performing this initialization code?()

    • A、In the init method.
    • B、In the jspInit method.
    • C、In the constructor of the JSP’s Java code.
    • D、In a JSP declaration, which includes an initializer block.
    • E、In a JSP declaration, which includes a static initializer block.

    正确答案:B,D,E

  • 第10题:

    You are working with a team of developers on a Web site. You copy the Web site from the staging server to work on it locally. While making changes, you create new C# source code files and delete old ones. You need to ensure that your changes propagate to the staging server without affecting any files that you have not modified. Which tool should you use? ()

    • A、XCOPY
    • B、the Copy Web tool
    • C、the Publish Web tool
    • D、a Web Setup project

    正确答案:B

  • 第11题:

    You are developing a Web application. The Web application restricts access to an administrative page. The Web application uses the following code segment to protect the page.if (Page.User.Identity.Name != @"CONTOSO/Administrator") { the page, you are redirected to Login.aspx. You discover that the User.Identity.Name property is not being correctly populated. You need to ensure that you can access the page when you are logged on as Administrator. Which two actions should you perform? ()

    • A、In the Web.config file, enable impersonation.
    • B、In IIS, enable anonymous access.
    • C、In IIS, disable anonymous access.
    • D、In the Web.config file, set the authentication mode to Windows.

    正确答案:C,D

  • 第12题:

    You work as a Web Application Developer at Certkiller.com. You make use of .NET Frameworkv3.5 to create an ASP.NET application.  You decide to create a Web user control named KingShare. KingShare is compiled as a library.The code segment below is written for KingShare. (The line numbers is included for reference purposes) 1 protected override void OnInit(EventArgs e) 2 { 3 base.OnInit(e); 4 5 }  The master pages in the application contains the <%@ Master Language="C#" EnableViewState="false" %> directive. You receive an instruction from the network administratorto make sure that the KingShare state is able to persist on the pages that reference the masterpage. You should thus identify the appropriate code segment you need to add to line 4 to achievethis.  What should you do?()

    • A、Your best option would be to insert Page.RegisterRequiresPostBack(this)
    • B、Your best option would be to insert Page.RegisterRequiresControlState(this)
    • C、Your best option would be to insert Page.UnregisterRequiresControlState(this)
    • D、Your best option would be to insert Page.RegisterStartupScript("KingShare","server")

    正确答案:B

  • 第13题:

    单选题
    You are developing a Web application. Your code restricts access to some pages based on the users credentials. You need to configure IIS to supply the user's Windows credentials to your Web application. These credentials must be encrypted. What should you do? ()
    A

    Enable Anonymous access. Enable Integrated Windows authentication.

    B

    Enable Anonymous access. Enable Basic authentication.

    C

    Disable Anonymous access. Enable Integrated Windows authentication.

    D

    Disable Anonymous access. Enable Basic authentication.


    正确答案: A
    解析: 暂无解析

  • 第14题:

    单选题
    You deploy your companys Internet Web site. You need to deny anonymous access to the Web site, allowing only authenticated users. Which code segment should you use?()
    A

    <authorization> <allow users=?/> </authorization>

    B

    <authorization> <deny users=?/> </authorization>

    C

    <authorization> <deny users=*/></authorization>

    D

    <authorization> <allow users=*/> </authorization>


    正确答案: C
    解析: 暂无解析

  • 第15题:

    单选题
    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application requires frequent updates. You want to use the ClickOnce technology to distribute the application to Internet users. You need to ensure that the application is automatically updated without requiring user intervention. You also need to ensure that the users execute the most recent version of the application. What should you do when you publish the application? ()
    A

     Use Install the application from a file share. Select the Application is available online and offline option.

    B

     Use Install the application from CD-ROM or a DVD-ROM. Select the Application will not check for updates option.

    C

     Use Install the application from a Web site. Select the Application is available online only option.

    D

     Use Install the application from a Web site. Select the Application is available online and offline option.


    正确答案: D
    解析: 暂无解析

  • 第16题:

    多选题
    You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.  When you review the application performance counters, you discover that there is an unexpected increase in the value of the Application Restarts counter. You need to identify the reasons for this increase.  What are three possible reasons that could cause this increase?()
    A

    Restart of the Microsoft IIS 6.0 host.

    B

    Restart of the Microsoft Windows Server 2003 that hosts the Web application.

    C

    Addition of a new assembly in the Bin directory of the application.

    D

    Addition of a code segment that requires recompilation to the ASP.NET Web application.

    E

    Enabling of HTTP compression in the Microsoft IIS 6.0 manager for the application.

    F

    Modification to the Web.config file in the <system.web> section for debugging the application.


    正确答案: E,F
    解析: 暂无解析