Multiple choice technology programming languages

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

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

ASP.NET Web Forms inherit from System.Web.UI.Page by default, which provides the page framework, view state management, and event handling infrastructure. System.Web.Form and System.Web.UI.Form don't exist in the framework. System.Web.GUI.Page is also incorrect - the namespace is UI, not GUI.

AI explanation

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

In ASP.NET, a Web Form is represented by a class. By default, the WebForm1 class in ASP.NET 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 because there is no class called System.Web.Form in ASP.NET. The correct class is System.Web.UI.Page.

Option B) System.Web.GUI.Page - This option is incorrect because there is no namespace called System.Web.GUI in ASP.NET. The correct namespace is System.Web.UI.

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

Option D) System.Web.UI.Form - This option is incorrect because there is no class called System.Web.UI.Form in ASP.NET. The correct class is System.Web.UI.Page.

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