Repeater button and javascript

  • Thread starter Thread starter Lukas Kurka
  • Start date Start date
L

Lukas Kurka

Hi,

I have a asp:repeater and inside it I have asp:button control. How can I add
javascript onclick function (and also another) to the button.

Thank you for your help
 
In the ItemDataBound event of the repeater:

Button b = (Button) e.Item.FindControl ("Button ID");
if (b != null)
{
b.Attributes.Add ("onclick", "javascript function or code");
}

Hi,

I have a asp:repeater and inside it I have asp:button control. How can I add
javascript onclick function (and also another) to the button.

Thank you for your help
 

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

Back
Top