0

programming languages Online Quiz - 170

Description: programming languages Online Quiz - 170
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

What important standard is used to connect client browsers with web servers ?

  1. HTTP

  2. TCP/IP

  3. ASP.NET

  4. HTML


Correct Option: B

Given an ASP.NET Web Form called WebForm1, what class does the WebForm1 class inherit from by default ?

  1. System.Web.Form

  2. System.Web.GUI.Page

  3. System.Web.UI.Page

  4. System.Web.UI.Form


Correct Option: C

AI Explanation

To answer this question, we need to understand the inheritance hierarchy of ASP.NET Web Forms.

In ASP.NET Web Forms, the WebForm1 class, by default, inherits from the System.Web.UI.Page class.

Let's go through each option to understand why it is correct or incorrect:

Option A) System.Web.Form - This option is incorrect. The correct namespace is System.Web.UI, not System.Web.

Option B) System.Web.GUI.Page - This option is incorrect. The correct namespace is System.Web.UI, not System.Web.GUI.

Option C) System.Web.UI.Page - This option is correct. The WebForm1 class in ASP.NET Web Forms, by default, inherits from the System.Web.UI.Page class.

Option D) System.Web.UI.Form - This option is incorrect. The correct class name is Page, not Form.

Therefore, the correct answer is C. The WebForm1 class inherits from the System.Web.UI.Page class by default.

What tool is used to manage the GAC ?

  1. GacMgr.exe

  2. GacSvr32.exe

  3. GacUtil.exe

  4. RegSvr.exe


Correct Option: C

What is the file extension used for ASP.NET files ?

  1. .ASP

  2. .ASPX

  3. .Web

  4. None of the above


Correct Option: B
Explanation:

To answer this question, the user needs to know the common file extensions used in ASP.NET development.

The correct answer is:

B. .ASPX

Option A (.ASP) is incorrect because it is the file extension used for Classic ASP files, not ASP.NET files.

Option C (.Web) is incorrect because this is not a valid file extension used in ASP.NET development.

Option D (None of the above) is incorrect because .ASPX is, in fact, the correct file extension used for ASP.NET files.

Therefore, the answer is: B. .ASPX

What ASP.NET object is used to get information about the web servers ?

  1. The Server object

  2. The Application object

  3. The Request object

  4. The Response object


Correct Option: A

AI Explanation

To answer this question, you need to understand the different ASP.NET objects and their purposes.

Option A) The Server object - This option is correct. The Server object in ASP.NET provides access to various properties and methods that allow you to get information about the web server. You can use the Server object to retrieve information such as the server's IP address, the server's software version, the server's domain name, and more.

Option B) The Application object - This option is incorrect. The Application object in ASP.NET is used to store and retrieve application-level data. It is not specifically used to get information about the web server.

Option C) The Request object - This option is incorrect. The Request object in ASP.NET is used to retrieve information about the current HTTP request, such as the request URL, query string parameters, form data, headers, and more. It is not specifically used to get information about the web server.

Option D) The Response object - This option is incorrect. The Response object in ASP.NET is used to send output to the client browser. It is not specifically used to get information about the web server.

The correct answer is Option A) The Server object. This option is correct because the Server object in ASP.NET is specifically designed to provide information about the web server.

What method(s) must be used with the Application object to ensure that only one process accesses a variable at a time ?

  1. Synchronize()

  2. Lock() and UnLock()

  3. Lock()

  4. Asynchroize()


Correct Option: B

When an ASP.NET server control is added to a Web Form, Visual Studio .NET adds one item to the class for the form. What item is added ?

  1. The event registration

  2. A protected class member for the control

  3. A default event handler for the click event

  4. A default class that inherits from the control’s base class


Correct Option: C

AI Explanation

To answer this question, you need to understand how Visual Studio .NET handles server controls when they are added to a Web Form.

Option A) The event registration - This option is incorrect. When a server control is added to a Web Form, Visual Studio .NET does not automatically add event registration for the control.

Option B) A protected class member for the control - This option is incorrect. Visual Studio .NET does not add a protected class member for the control when it is added to a Web Form.

Option C) A default event handler for the click event - This option is correct. When an ASP.NET server control is added to a Web Form, Visual Studio .NET adds a default event handler for the click event. This allows you to write code to handle the click event of the control.

Option D) A default class that inherits from the control’s base class - This option is incorrect. Visual Studio .NET does not add a default class that inherits from the control's base class when a server control is added to a Web Form.

The correct answer is C) A default event handler for the click event. This option is correct because Visual Studio .NET automatically adds a default event handler for the click event when an ASP.NET server control is added to a Web Form.

What is the Web.config file used for ?

  1. To store the global information and variable definitions for the application

  2. Configures the time that the server-side codebehind module is called

  3. To configure the web server

  4. To configure the web browser


Correct Option: A

After capturing the SelectedIndexChanged event for a ListBox control, you find that the event handler doesn’t execute. What could the problem be ?

  1. The AutoEventWireup attribute is set to False

  2. The AutomaticPostBack attribute is set to False

  3. The codebehind module is not properly compiled

  4. The ListBox must be defined WithEvents


Correct Option: B

What HTML element is the asp:Label control rendered as when the target is Netscape Communicator ?


Correct Option: B

AI Explanation

To answer this question, let's understand the purpose of the asp:Label control and how it is rendered in different web browsers.

The asp:Label control in ASP.NET is used to display text on a web page. It is rendered as an HTML element based on the target browser's capabilities.

In the case of Netscape Communicator, the asp:Label control is rendered as the element.

Therefore, the correct answer is:

B)

This option is correct because the asp:Label control is rendered as the element when the target browser is Netscape Communicator.

What method must be overridden in a custom control ?

  1. The Paint() method

  2. The Control_Build() method

  3. The Render() method

  4. The default constructor


Correct Option: C

AI Explanation

To answer this question, you need to understand the concept of custom controls in programming.

Option A) The Paint() method - This option is incorrect. The Paint() method is used to specify the custom drawing behavior of a control, but it is not required to be overridden in a custom control.

Option B) The Control_Build() method - This option is incorrect. There is no Control_Build() method in the context of custom controls.

Option C) The Render() method - This option is correct. The Render() method must be overridden in a custom control. It is responsible for rendering the control's visual representation.

Option D) The default constructor - This option is incorrect. The default constructor is not specific to custom controls and does not need to be overridden.

The correct answer is C) The Render() method. This option is correct because the Render() method is required to be overridden in a custom control to define how the control should be rendered visually.

What is used to validate complex string patterns like an e-mail address ?

  1. Extended expressions

  2. Regular expressions

  3. Irregular expressions

  4. Basic expressions


Correct Option: B

You are the developer of a web application that is retrieving historical books information from a database server and displays it to the users of your application. What cache strategy will give you the best performance ?

  1. Use the output cache

  2. Use the cache object

  3. Use the ASP.NET central cache

  4. Use the client cache


Correct Option: A

Which is not ture about Smartnavigation ?

  1. retain only the last page visited in the browser's history

  2. eliminate any flash caused by navigation

  3. Doesn't work with sites protected with SSL

  4. persist scroll position when moving from page to page


Correct Option: C

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) retain only the last page visited in the browser's history - This option is incorrect. SmartNavigation does not affect the browser's history. It is a technique used to prevent screen flickering during page navigation.

Option B) eliminate any flash caused by navigation - This option is correct. SmartNavigation is designed to eliminate the flickering effect that occurs when a page is being reloaded.

Option C) Doesn't work with sites protected with SSL - This option is incorrect. SmartNavigation does work with sites protected with SSL. It is not dependent on the security protocol being used.

Option D) persist scroll position when moving from page to page - This option is correct. SmartNavigation has the capability to remember the scroll position of a page when navigating to another page.

The correct answer is C. This option is incorrect because SmartNavigation works with sites protected with SSL.

Can two different .net programming languages be mixed in a single ASPX file ?

  1. Yes

  2. No

  3. May be

  4. None of the above


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Yes - This option is incorrect because two different .NET programming languages cannot be mixed in a single ASPX file. An ASPX file is a web page file that contains HTML markup and server-side code written in a .NET programming language such as C# or Visual Basic. While you can have multiple programming languages in a single solution or project, each ASPX file should be written in a single programming language.

Option B) No - This option is correct. Two different .NET programming languages cannot be mixed in a single ASPX file. Each ASPX file should be written in a single programming language.

Option C) Maybe - This option is incorrect because the possibility of mixing different .NET programming languages in a single ASPX file is not dependent on any conditional factors. It is simply not allowed.

Option D) None of the above - This option is incorrect because the correct answer is B, as explained above.

The correct answer is B. Two different .NET programming languages cannot be mixed in a single ASPX file. Each ASPX file should be written in a single programming language.

Which is true about ASP.net support ?

  1. ASP.NET doesn't support server-side includes

  2. ASP.NET doesn't support server-side includes but supports server-side object tags

  3. ASP.NET doesn't server-side object tags

  4. ASP.NET support server-side includes and server-side object tags


Correct Option: D

What HTML element is the asp:Label control rendered as when the target is Netscape Communicator ?


Correct Option: B

AI Explanation

To answer this question, we need to understand how the asp:Label control is rendered in different browsers.

The asp:Label control is a server-side control in ASP.NET that is used to display text on a webpage. The control is rendered as an HTML element based on the target browser.

When the target browser is Netscape Communicator, the asp:Label control is rendered as a <span> element.

Let's go through each option to understand why it is correct or incorrect:

Option A) - This option is incorrect because the asp:Label control is not rendered as a `` element in Netscape Communicator.

Option B) - This option is correct. The asp:Label control is rendered as a <span> element when the target browser is Netscape Communicator.

Option C)

- This option is incorrect because the asp:Label control is not rendered as a <div> element in Netscape Communicator.

Option D) - This option is incorrect because the asp:Label control is not rendered as a `` element in Netscape Communicator.

Therefore, the correct answer is Option B. The asp:Label control is rendered as a <span> element when the target is Netscape Communicator.

What tool is used to manage the GAC ?

  1. GacMgr.exe

  2. GacSvr32.exe

  3. GacUtil.exe

  4. RegSvr.exe


Correct Option: C

What is the Web.config file used for ?

  1. To store the global information and variable definitions for the application

  2. Configures the time that the server-side codebehind module is called

  3. To configure the web server

  4. To configure the web browser


Correct Option: A

After capturing the SelectedIndexChanged event for a ListBox control, you find that the event handler doesn’t execute. What could the problem be ?

  1. The AutoEventWireup attribute is set to False

  2. The AutomaticPostBack attribute is set to False

  3. The codebehind module is not properly compiled

  4. The ListBox must be defined WithEvents


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) The AutoEventWireup attribute is set to False - This option is incorrect because the AutoEventWireup attribute is used in ASP.NET Web Forms to automatically wire up event handlers based on their naming conventions. However, it is not directly related to the execution of the SelectedIndexChanged event for a ListBox control.

Option B) The AutomaticPostBack attribute is set to False - This option is correct because the AutomaticPostBack attribute determines whether a postback to the server should occur when the selected index of the ListBox control is changed. If it is set to False, the event handler for the SelectedIndexChanged event will not execute.

Option C) The codebehind module is not properly compiled - This option is incorrect because the compilation of the codebehind module is not directly related to the execution of the SelectedIndexChanged event for a ListBox control. If the codebehind module is not properly compiled, it may result in other errors, but it is not the direct cause of the event handler not executing.

Option D) The ListBox must be defined WithEvents - This option is incorrect because the WithEvents keyword is used in VB.NET to declare event handlers for controls. However, it is not required for the ListBox control to execute the SelectedIndexChanged event. It is a standard event that can be handled without using WithEvents.

The correct answer is B) The AutomaticPostBack attribute is set to False. This option is correct because if the AutomaticPostBack attribute is set to False, the event handler for the SelectedIndexChanged event will not execute.

- Hide questions