tags:

views:

549

answers:

1

hi guys, Following is code for buttonclick in gridview.

Protected Sub lnkChangeStatus_Click(ByVal sender As Object, ByVal e As EventArgs) 

    Dim gvr As GridViewRow = TryCast(DirectCast(sender, LinkButton).Parent.Parent, GridViewRow) 

    Dim lngProfileId As Long = Convert.ToInt64(gvwBusinessProfiles.DataKeys(gvr.RowIndex).Value) 

End Sub

I want to get commandargument of lnkChangeStatus in its click.Is there any way

A: 

I guess the syntax for the eventhandler (Command event as against Click) should be as below.


Protected Sub lnkChangeStatus_Command(ByVal sender As Object, ByVal e As CommandEventArgs) 
.....

End Sub

You can use e.CommandName or e.CommandArgument inside the code block.
Refer this

shahkalpesh