ASP .Net Quiz 3

Description: ASP .Net Quiz 3
Number of Questions: 13
Created by:
Tags: .net asp
Attempted 0/13 Correct 0 Score 0

Custom Controls are derived from which of the classes

  1. System.Web.UI.Webcontrol

  2. System.Web.UI.Customcontrol

  3. System.Web.UI.Customcontrols.Webcontrol


Correct Option: C

How ASP.Net Different from classic ASP?

  1. Scripting is separated from the HTML, Code is interpreted seperately

  2. Scripting is separated from the HTML, Code is compiled as a DLL, the DLLs can be executed on server

  3. Code is separated from the HTML and interpreted Code is interpreted separately


Correct Option: B

AI Explanation

To answer this question, you need to understand the differences between ASP.Net and classic ASP. Let's go through each option to understand why it is correct or incorrect:

Option A) Scripting is separated from the HTML, Code is interpreted separately This option is incorrect because it describes the behavior of classic ASP, not ASP.Net. In classic ASP, the code and HTML are mixed together, and both are interpreted together.

Option B) Scripting is separated from the HTML, Code is compiled as a DLL, the DLLs can be executed on the server This option is correct. In ASP.Net, the code and HTML are separated, with code typically written in a separate file called a code-behind file. The code is then compiled into a DLL (Dynamic Link Library) file, which can be executed on the server. This separation allows for better organization and performance.

Option C) Code is separated from the HTML, and interpreted code is interpreted separately This option is incorrect because it is unclear and redundant. It is similar to Option A but adds the unnecessary phrase "interpreted code is interpreted separately."

The correct answer is B. This option correctly describes the behavior and key difference between ASP.Net and classic ASP, highlighting the separation of code and HTML and the compilation of code into DLLs.

What's the difference between Response.Write() andResponse.Output.Write()?

  1. Response.Output.Write() allows you to flush output

  2. Response.Output.Write() allows you to buffer output

  3. Response.Output.Write() allows you to write formatted output

  4. Response.Output.Write() allows you to stream output


Correct Option: C

Why is Global.asax is used?

  1. Implement application and session level events

  2. Declare Global variables

  3. No use


Correct Option: A

AI Explanation

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

Option A) Implement application and session level events - This option is correct. The Global.asax file is used in ASP.NET applications to handle application-level events, such as Application_Start, Application_End, Session_Start, Session_End, etc. These events allow you to run code at specific points during the application's lifetime, such as initializing global variables, setting up database connections, or managing session variables.

Option B) Declare Global variables - This option is incorrect. While it is possible to declare global variables in the Global.asax file, it is not the primary purpose of this file.

Option C) No use - This option is incorrect. The Global.asax file serves a specific purpose in ASP.NET applications, as mentioned in Option A.

The correct answer is A) Implement application and session level events. This option is correct because the Global.asax file is primarily used to handle application-level events and manage session-related tasks.

There can be more than 1 machine.config file in a system

  1. True

  2. False


Correct Option: A

What is the extension of a web user control file?

  1. .Asmx

  2. .Ascx

  3. .Aspx


Correct Option: B

AI Explanation

To answer this question, you need to understand the file extensions used in web development.

Option A) .Asmx - This option is incorrect because the .asmx extension is used for ASP.NET web services, not web user control files.

Option B) .Ascx - This option is correct. The .ascx extension is used for web user control files in ASP.NET. These files contain reusable UI components that can be added to web pages.

Option C) .Aspx - This option is incorrect because the .aspx extension is used for web forms in ASP.NET, not web user control files.

The correct answer is B) .Ascx. This option is correct because it represents the file extension of a web user control file in ASP.NET.

Which of the following is true?

  1. IsPostBack is a method of System.UI.Web.Page class

  2. IsPostBack is a method of System.Web.UI.Page class

  3. IsPostBack is a readonly property of System.Web.UI.Page class


Correct Option: C

The number of forms that can be added to a aspx page is.

  1. 1

  2. 2

  3. 3

  4. More than 3


Correct Option: A

How do you manage states in asp.net application

  1. Session Objects

  2. Application Objects

  3. Viewstate

  4. All of the above


Correct Option: D

AI Explanation

To manage states in an ASP.NET application, you can use the following methods:

A. Session Objects: The Session object is used to store and retrieve user-specific data across multiple web pages during a user's session. It allows you to store data that is accessible to the user throughout their visit to the website.

B. Application Objects: The Application object is used to store and retrieve data that is accessible to all users of the application. It allows you to store data that is common to all users and persists throughout the lifetime of the application.

C. ViewState: ViewState is used to store and retrieve the state of a web form between postbacks. It allows you to maintain the state of controls and their values across multiple postbacks, ensuring that user input is not lost.

Therefore, the correct answer is D) All of the above. All three options (Session Objects, Application Objects, and ViewState) can be used to manage different types of states in an ASP.NET application.

Select the caching type supported by ASP.Net

  1. Output Caching

  2. DataCaching

  3. a and b

  4. none of the above


Correct Option: C

AI Explanation

To answer this question, you need to have knowledge about the caching types supported by ASP.Net.

Option A) Output Caching - This option is correct. Output caching is a caching technique in ASP.Net where the output of a page or user control is stored in memory and reused for subsequent requests. This can improve performance by reducing the processing and rendering time.

Option B) Data Caching - This option is correct. Data caching is a caching technique in ASP.Net where frequently accessed data is stored in memory for quick retrieval. This can improve performance by reducing the need to retrieve data from a database or other external sources.

Option C) a and b - This option is correct. Both output caching and data caching are supported by ASP.Net.

Option D) none of the above - This option is incorrect. Both output caching and data caching are supported by ASP.Net, so option D is not correct.

The correct answer is option C) a and b. Both output caching and data caching are supported by ASP.Net.

Where is the default Session data is stored in ASP.Net?

  1. InProcess

  2. StateServer

  3. Session Object

  4. al of the above


Correct Option: A

Select the type Processing model that asp.net simulate

  1. Event-driven

  2. Static

  3. Linear

  4. Topdown


Correct Option: A

AI Explanation

To answer this question, you need to understand the different types of processing models.

Option A) Event-driven - This option is correct because ASP.NET simulates an event-driven processing model. In an event-driven model, the program responds to user actions or events, such as button clicks or mouse movements. ASP.NET uses events and event handlers to handle user interactions and perform the necessary processing.

Option B) Static - This option is incorrect because ASP.NET is not a static processing model. In a static model, the program follows a predetermined sequence of steps and does not respond to user actions or events.

Option C) Linear - This option is incorrect because ASP.NET does not follow a linear processing model. In a linear model, the program executes a series of steps in a sequential order without branching or looping.

Option D) Topdown - This option is incorrect because ASP.NET does not follow a top-down processing model. In a top-down model, the program starts with a high-level overview and progressively breaks it down into smaller steps or subroutines.

The correct answer is A) Event-driven. ASP.NET simulates an event-driven processing model, where the program responds to user actions or events.

- Hide questions