how to trigger event with HtmlInputButton?

B

Britt

Hi,

I created a HtmlInputButton in the code-behind of a asp.net application like
this:
Dim bt As HtmlInputButton
bt = New HtmlInputButton
bt.ID = "bt1"
frm.Controls.Add(bt)

But there is no 'click' or 'onclick' or 'onclientclick' property. I see it
but of course nothing happen when clicking on it.
How can i link a function in Javascript to that button.

Thanks
Britt
 
G

Guest

Britt,

You just add an attribute to your button:
bt.Attributes.Add("onclick", "your_javascript")

HTH
 

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