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.

Find more quizzes: