1

I want the programmer to pass a Control to a method, and then I want to add an onclick to it. But control doesn't have an Attributes property. Is there an interface or something deriving from Control that I can use, to add an onclick attribute to it?

Note that I want to add a javascript onclick (clientclick?).

2 Answers 2

4

Check out the System.Web.UI.WebControls.WebControl class - it inherits from System.Web.UI.Control and has an Attributes property.

Sign up to request clarification or add additional context in comments.

Comments

1

D'oh I fixed it now, the solution is to use a WebControl rather than a Control.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.