R
rn5a
Consider the following code which creates LinkButtons dynamically:
For i = 1 to 5
lnkBut = New LinkButton
lnkBut.ID = "lnkBut" & i
lnkBut.Text = i.ToString & " "
lnkBut.CommandName = i
pnlLinks.Controls.Add(lnkBut)
Next
The above code will display 5 LinkButtons in the Panel named 'pnlLinks'
like this
1 2 3 4 5
When any of the LinkButtons is clicked, the page gets posted.
After postback, how do I find out which of the 5 LinkButtons has been
clicked by the user in the Page_Load sub?
For i = 1 to 5
lnkBut = New LinkButton
lnkBut.ID = "lnkBut" & i
lnkBut.Text = i.ToString & " "
lnkBut.CommandName = i
pnlLinks.Controls.Add(lnkBut)
Next
The above code will display 5 LinkButtons in the Panel named 'pnlLinks'
like this
1 2 3 4 5
When any of the LinkButtons is clicked, the page gets posted.
After postback, how do I find out which of the 5 LinkButtons has been
clicked by the user in the Page_Load sub?