LinkButton

H

Hugo Flores

Hi,
I create a LinkButton in runtime, and I want to be able to
access a function when a user clicks on the generated link
in the page.
My problem is that I don't know how to asociate the
function to the link in runtime.

Any one knows this?
 
J

Jos Branders

Hugo said:
Hi,
I create a LinkButton in runtime, and I want to be able to
access a function when a user clicks on the generated link
in the page.
My problem is that I don't know how to asociate the
function to the link in runtime.

Any one knows this?

AddHandler myLinkButton.Click, AddressOf myLinkButton_Click
 
J

Jurjen de Groot

After you create the object at runtime, use the AddHandler command.

AddHandler Button1.Click, AddressOf Button1_Click


Hope this helps,

Jurjen de Groot
G.I.T.S. Netherlands
 
D

David Waz...

As Jurjen pointed out, ADD HANDLER works,
OR - Create a page-level WITHEVENTS variable

in either case, be sure the dynamic control is created on all post-back
operations. If you don't, the event won't be trapped.

If you are referring to client-side (java script):

MyControl.Attributes.item("OnClick") = "return MyFunction();"

G.L.
 

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,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top