repeater button controls

G

guoqi zheng

Dear sir,

I have two button controls in a repeater, when clicked, it fire an event
R1_ItemCommand, but how can I know which button controls user click?? there
are two there???


Sub R1_ItemCommand(Sender As Object, e As RepeaterCommandEventArgs)
'button has just been clicked;
End Sub

regards,

Guoqi Zheng
http://www.ureader.com
 
D

David Lloyd

Guoqi:

You can cast the CommandSource property of the RepeaterEventArgs class to a
Button and examine its properties.

For example:

void R1_ItemCommand(Object Sender, RepeaterCommandEventArgs e) {
Label2.Text = "The " + ((Button)e.CommandSource).Text + " button has
just been clicked; <br>";
}


--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top