Version

ControlPrefix Property (SmartWebControl)

Gets a short prefix qualifying this instance uniquely by it's control type.
Syntax
'Declaration
 
Protected Overridable ReadOnly Property ControlPrefix As String
protected virtual string ControlPrefix {get;}

Property Value

By default, the base implementation of ControlPrefix always returns an empty string.
Remarks

This prefix will be rendered in front of CSS classes and other identifying labels to ensure their uniqueness for a given type of control. The timing when this prefix gets applied may be prior to the Init event firing, therefore it should not be used for differentiating control instances.

Inheritors should override this property and provide a short non-null string uniquely identifying the Type of their control. Failure to override ControlPrefix may cause some CSS class name collisions between different types of controls. For example, when a WebMonthView and a WebDayView are on the same page, a name conflict is possible between their DayStyle CSS classes (whose default CSS class name could be Day) unless they override ControlPrefix. If WebMonthView returned the prefix, "month", from its override then it's DayStyle would render with the CSS class name monthDay and no longer be in conflict with other controls on the page with a different type.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also