2012-02-21 51 views

回答

0

我假设你正在通过设置按钮的CommandName属性来处理DataListItemCommand事件。

Sub Item_Command(sender As Object, e As DataListCommandEventArgs)Handles DataList1.ItemCommand 

    ' What command was triggered? 
    If e.CommandName = "YourCommandName" Then 

     ' Get the Label in the DataListItem of the clicked button 
     Dim lbl = DirectCast(e.Item.FindControl("Label1"), Label) 
     Dim labelText = lbl.Text 
    End If 

End Sub 
相关问题