how to trigger event with HtmlInputButton?

  • Thread starter Thread starter Britt
  • Start date Start date
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
 
Britt,

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

HTH
 
Back
Top