
No click event from a button in a TableCell
I found my problem.
I was initializing the event handler in the form load inside a
if Not IsPostBack
end if
which meant that when the user clicked th button and the postbak occured the
reloaded form didn't have an event handler..
rich
Quote:
> I'm doing the following
> Protected WithEvents m_lnkNext As LinkButton
> Protected WithEvents tbl As System.Web.UI.WebControls.Table
> ...
> m_lnkNext = New LinkButton
> m_lnkNext.Text = "Next..."
> m_lnkNext.Width = New Unit(54, UnitType.Pixel)
> m_lnkNext.Height = New Unit(25, UnitType.Pixel)
> m_lnkNext.CausesValidation = True
> AddHandler m_lnkNext.Click, AddressOf btnNext_Click
> tbl.Rows(1).Cells(1).Controls.Add(m_lnkNext)
> I seem to get other events fired but not click.
> It behaves the same with a regular button and the AddHandler and
WithEvents
> are interchangeable with no effect
> Any help is appreciated.
> Rich