more about link buttons

G

Guest

hey all,

i have 4 link buttons on my page. could i just i have 1 handler for all
these buttons? if so, how can i let the handler which button got clicked?

thanks,
rodchar
 
L

Lucas Tam

hey all,

i have 4 link buttons on my page. could i just i have 1 handler for all
these buttons? if so, how can i let the handler which button got clicked?


Yes you can.

You can use the CommandArguement or CommandName properties of the
linkbutton to specify which button was clicked.
 
S

S. Justin Gengo

Rodchar,

In the handler cast the sender to a link button and then check it's client
ID.

In vb it looks like:

Dim LinkButtonSent As LinkButton = CType(Sender, LinkButton)

Select Case LinkButton.ID
Case "LinkButton1"
'---Do something here.
Case "LinkButton2"
'---Do something here.
End Select

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
G

Guest

you guys are great. thanks for the help.

S. Justin Gengo said:
Rodchar,

In the handler cast the sender to a link button and then check it's client
ID.

In vb it looks like:

Dim LinkButtonSent As LinkButton = CType(Sender, LinkButton)

Select Case LinkButton.ID
Case "LinkButton1"
'---Do something here.
Case "LinkButton2"
'---Do something here.
End Select

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top