Hi,
I am having problems with AddHandlers. These are being fired on alternate clicks. First time they work, second time no, third time they work and fourth no etc ...
I have the following code in Page_Load part
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
ExtractAllTasks()
End Sub
Private Sub ExtractAllTasks()
tblOverDue.Rows.Clear()
Dim myCell As TableCell
Dim myRow As TableRow
.
.
.
.
If drDataReader.HasRows Then
While drDataReader.Read
strButtonID = incremental Value
myCell = New TableCell()
lbButton = New LinkButton
lbButton.Text = "Complete?"
lbButton.CommandArgument = strButtonID
AddHandler lbButton.Command, AddressOf Me.CompleteTask
myCell.Width = 50
lbButton.ForeColor = Drawing.Color.Blue
myCell.BackColor = AlternateColor
lbButton.Font.Underline = False
myCell.Controls.Add(lbButton)
myRow.Cells.Add(myCell)
tblOverDue.Rows.Add(myRow)
.
.
.
.
END SUB
Can anyone please help?
I am having problems with AddHandlers. These are being fired on alternate clicks. First time they work, second time no, third time they work and fourth no etc ...
I have the following code in Page_Load part
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
ExtractAllTasks()
End Sub
Private Sub ExtractAllTasks()
tblOverDue.Rows.Clear()
Dim myCell As TableCell
Dim myRow As TableRow
.
.
.
.
If drDataReader.HasRows Then
While drDataReader.Read
strButtonID = incremental Value
myCell = New TableCell()
lbButton = New LinkButton
lbButton.Text = "Complete?"
lbButton.CommandArgument = strButtonID
AddHandler lbButton.Command, AddressOf Me.CompleteTask
myCell.Width = 50
lbButton.ForeColor = Drawing.Color.Blue
myCell.BackColor = AlternateColor
lbButton.Font.Underline = False
myCell.Controls.Add(lbButton)
myRow.Cells.Add(myCell)
tblOverDue.Rows.Add(myRow)
.
.
.
.
END SUB
Can anyone please help?