Hi there,

I have a listview control, on which I have two buttons 1) Wesite 2)Email Me. Note the listview only has the Item and Layout Templates as I will not be editing or inserting.
I have assigned both the controls the CommandName="select" so that they both fire the SelectedIndexChanged event. There I can access the website address and email address held in datakeys.
In the listviews SelectedIndexChanged event I need to work out which control fired the event.
Ie if it was the website button then I will redirect the user to the website...

Code in VB please.

Kind regards,

Simon

Add an OnItemCommand="MyItemCommandHandler" to your ListView markup.

For each button in your listview add a CommandName and CommandArgument and in your handler figure out which button got pressed.

Remember that the Select button will also fire the OnItemCommand.


Hi there,

I have a listview control, on which I have two buttons 1) Wesite 2)Email Me. Note the listview only has the Item and Layout Templates as I will not be editing or inserting.
I have assigned both the controls the CommandName="select" so that they both fire the SelectedIndexChanged event. There I can access the website address and email address held in datakeys.
In the listviews SelectedIndexChanged event I need to work out which control fired the event.
Ie if it was the website button then I will redirect the user to the website...

Code in VB please.

Kind regards,

Simon

@phmurton

We appreciate your help. Please do not resurrect threads that are years old.

Thread Closed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.