Managing Components and .NET Assemblies
70-305 – Developing and Implementing Web Applications with Microsoft Visual Basic .NET and Microsoft Visual Studio .NET
Objective: Creating and Managing Components and .NET Assemblies
SubObjective: Create and modify a .NET assembly
Item Number: 70-305.2.1.4
Single Answer, Multiple Choice
You create a user control named AddressInput that contains several other constituent controls.
You need to expose the pNum property of the control so it will be accessible from the Web Form
that uses the control.
Which statement should you use to expose the property?
- Public Property pNum As Integer
- Public Function pNum As Integer
- Private Property pNum As Integer
- Protected Property pNum As Integer
A. Public Property pNum As Integer
You would use the code that declares a public property. By default, constituent controls are declared as private, so they would not be available to the user. To expose the property, you can create a custom public property and associate that property with the property of the constituent control.
All of the other options are incorrect. You would need to declare the property as public to expose it to the control’s users.
1. MSDN Library Visual Studio .NET – Search
– Visual Basic and Visual C# Concepts – Exposing Properties of Constituent Controls