By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,327 Members | 849 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,327 IT Pros & Developers. It's quick & easy.

how to trigger event with HtmlInputButton?

P: n/a
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
Oct 29 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Britt,

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

HTH
"Britt" wrote:
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
Oct 29 '06 #2

P: n/a
Thanks Sergey

"Sergey Poberezovskiy" <Se*****************@discussions.microsoft.com>
schreef in bericht
news:CA**********************************@microsof t.com...
Britt,

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

HTH
"Britt" wrote:
>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

Oct 29 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.