ccrookston
12-28-2004, 05:14 PM
I'm adding a serires of linkbuttons based on database rows. Two questions. First, is the linkbutton.CommandArgument the appropiate property to use to assign a value to the link button? I need to match the button with the database row key id. Second, how do you assign an on_click event? The way I have it does not work:
While myMemberListDtr.Read()
Dim LnkBtn As New LinkButton()
plhPlaceHolder.Controls.Add( New LiteralControl( "<td>))
LnkBtn.Text = myMemberListDtr("lname") & ", " & myMemberListDtr("fname")
LnkBtn.CommandArgument = myMemberListDtr("mem_id")
LnkBtn.OnClick = linkbutton_click
plhPlaceHolder.Controls.Add(LnkBtn)
plhPlaceHolder.Controls.Add( New LiteralControl( "</a></td>" ))
End While
Thanks!!!
Casey
While myMemberListDtr.Read()
Dim LnkBtn As New LinkButton()
plhPlaceHolder.Controls.Add( New LiteralControl( "<td>))
LnkBtn.Text = myMemberListDtr("lname") & ", " & myMemberListDtr("fname")
LnkBtn.CommandArgument = myMemberListDtr("mem_id")
LnkBtn.OnClick = linkbutton_click
plhPlaceHolder.Controls.Add(LnkBtn)
plhPlaceHolder.Controls.Add( New LiteralControl( "</a></td>" ))
End While
Thanks!!!
Casey