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, 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.

Find more quizzes: