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.

Find more quizzes: