|
Public Class BindingSample
Inherits System.Web.UI.Page
Protected repeater As System.Web.UI.WebControls.Repeater
#Region " Web Form Designer Generated Code "
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim arr As New ArrayList(5)
arr.Add(New DummyUser(1, "Paul", DateTime.Now.AddHours(-32), "Mahdi"))
arr.Add(New DummyUser(3, "Leto II", DateTime.Now.AddHours(-332), "God Emperor"))
arr.Add(New DummyUser(4, "Jessica", DateTime.Now.AddHours(-22), "Witch"))
arr.Add(New DummyUser(7, "Chani", DateTime.Now.AddHours(-112), "Faroula"))
arr.Add(New DummyUser(12, "Teg", DateTime.Now.AddHours(-2), "Bashar"))
repeater.DataSource = arr
repeater.DataBind()
End Sub
Public Class DummyUser
#Region "Fields and Properties"
Private _userId As Integer
Private _userName As String
Private _lastLogin As DateTime
Private _name As String
Public Property UserId() As Integer
Get
Return _userId
End Get
Set(ByVal Value As Integer)
_userId = Value
End Set
End Property
Public Property UserName() As String
Get
Return _userName
End Get
Set(ByVal Value As String)
_userName = Value
End Set
End Property
Public Property LastLogin() As DateTime
Get
Return _lastLogin
End Get
Set(ByVal Value As DateTime)
_lastLogin = Value
End Set
End Property
Public Property Name() As String
Get
Return _name
End Get
Set(ByVal Value As String)
_name = Value
End Set
End Property
#End Region
Public Sub New()
End Sub
Public Sub New(ByVal userId As Integer, ByVal userName As String, ByVal lastLogin As DateTime, ByVal name As String)
Me._userId = userId
Me._userName = userName
Me._lastLogin = lastLogin
Me._name = name
End Sub
End Class
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.