UserControl Required Property

G

Guest

Hopefully a simple one, what is the syntax to force a property to be required
in a user control?

I thought it would below, but it's not:

Public Required Property propName() As String
 
G

Guest

You need to create Interface class for that

Interface Icontrol
' Declare an interface.
Property MustHave() As String

End Interface

Then in your user control include
Public Class mycontrol
Inherits System.Web.UI.UserControl
Implements Icontrol

It makes this propery required
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top