Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > more about link buttons

Reply
Thread Tools

more about link buttons

 
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      09-09-2005
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
 
Reply With Quote
 
 
 
 
Lucas Tam
Guest
Posts: n/a
 
      09-09-2005
"=?Utf-8?B?cm9kY2hhcg==?=" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> 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.



--
Lucas Tam ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      09-09-2005
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
"rodchar" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      09-09-2005
you guys are great. thanks for the help.

"S. Justin Gengo" wrote:

> 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
> "rodchar" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid Nav buttons and numeric buttons Jeremy Jones ASP .Net 1 03-22-2007 08:00 AM
Image Buttons/Buttons not responding =?Utf-8?B?QmVu?= ASP .Net 1 07-06-2005 07:34 AM
2 buttons but want enter key in textbox to execute one buttons' click event? Roger ASP .Net 1 05-20-2005 09:47 PM
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM



Advertisments