A simple template control

zhaozj2021-02-16  88

Imports System.comPonentmodelimports SystemImports System.Webimports System.Web.uiimports System.Web.ui.WebControls

Public Class SuperSimpleRepeater: Inherits WebControls.WebControl: Implements INamingContainer Private _repeatCount As Integer Private _itemTemplate As ITemplate Public Property RepeateCount () Get Return _repeatCount End Get Set (ByVal Value) Value = _repeatCount End Set End Property Public property ItemTemplate () AS ITEMPLATE GET RETURN _ITEMTEMPLATE END GET (BYVAL VALUE As Itemplate) _ItemTemplate = Value End SET End Property

Protected Overrides Sub CreateChildControls () Controls.Clear () Dim i As Integer 'For i = 1 To 10 Step 1 Dim container As New Panel _itemTemplate.InstantiateIn (container) Controls.Add (container)' Next i

End Subend Class

转载请注明原文地址:https://www.9cbs.com/read-12079.html

New Post(0)