How to set the Attributes of a control in Template

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

Hi,
If a control in in web form, I can set the Attributes in Page_load event,
like:
Button1.Attributes["onclick"] = "return confirm('Are you sure?');";
But If the cotrol is in a DataGrid's template, if I use the same code
above, it will fail when compile (can't find MyButtonInTemplte)

How can I set thee attribute of a control in temple by code (not in the
..aspx)?
 

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