more about link buttons

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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
 
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

Back
Top