Dim j As Integer
For j = 0 To k
Dim r As New TableRow()
Dim c As New TableCell()
textb = New System.Web.UI.WebControls.TextBox
textb.ID = "txtBar" & (j + 1).ToString
textb.Text = textb.ID
AddHandler textb.TextChanged, AddressOf OnTextChanged
c.Controls.Add(textb)
r.Cells.Add(c)
Table1.Rows.Add(r)
Next
Public Class Attribute
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'*** Label ***'
With Me.lblText
.Attributes.Add("OnClick", "alert('Sawatdee');")
.Style.Add("cursor", "hand")
End With
'*** Hyperlink ***'
With Me.hplText
.NavigateUrl = "#"
.Attributes.Add("OnClick", "fncTest();")
End With
'*** Button ***'
With Me.btnSubmit
.Attributes.Add("Onclick", "return confirm('Do you want to...?');")
.Style.Add("cursor", "hand")
End With
End Sub
End Class
Dim j As Integer
For j = 0 To k
Dim r As New TableRow()
Dim c As New TableCell()
textb = New System.Web.UI.WebControls.TextBox
textb.ID = "txtBar" & (j + 1).ToString
textb.Text = textb.ID
Me.textb.Attributes.Add("onKeyDown", "setNextFocus('txtBar'" & j + 2 & ");")
AddHandler textb.TextChanged, AddressOf OnTextChanged
c.Controls.Add(textb)
r.Cells.Add(c)
Table1.Rows.Add(r)
Next