I am adding a series of LinkButtons to a Panel in the code behide page and I have a Function called RemoveItem that I want it to run when clicked also in the code behind page. So I add the buttons like this:
Code:
fo i=0 to Session("ttlitems")
Dim b As New LinkButton
b.ID = "lbutton" & i
b.Text = "Remove"
b.ToolTip = "Remove this item"
b.Attributes.Add("onclick", "RemoveItem(" & i & ");")
panel1.controls.add(b)
next
And when I click the button I get an error. I can not setup button click events on the code behind because the buttons dont exist yet. So I'm kind of lost on this one.