Home All Groups Group Topic Archive Search About

how to trigger event with HtmlInputButton?

Author
29 Oct 2006 4:31 PM
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

Author
29 Oct 2006 8:11 PM
Sergey Poberezovskiy
Britt,

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

HTH
Show quoteHide quote
"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
>
>
>
Author
29 Oct 2006 11:05 PM
Britt
Thanks Sergey

"Sergey Poberezovskiy" <SergeyPoberezovs***@discussions.microsoft.com>
schreef in bericht
Show quoteHide quote
news:CA6046E5-BD6D-4FA1-8485-785F575C42D6@microsoft.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
>>
>>
>>