Control Inheritance in Code (without using Web User Control)

  • Thread starter Thread starter rodwilnot
  • Start date Start date
R

rodwilnot

This is a very basic question. I've searched around a bunch on groups,
the web, etc., and found tons of information but nothing that
specifically answers my question. My suspicion is that I am so clueless
that I'm looking at the answer but not even realizing it, so bear with
me.

I want to override some of the default behavior for ASP.NET controls.
Can this be done purely in class library code, i.e., without using a
Web User Control?

Let's take a really bogus example: suppose that I want to add a
property "LastClickedTime" to a custom class CMyButton derived from
Button.

Then I would want to be able to drag a normal Button control onto a web
form, and somewhere specify that the class is actually CMyButton,
rather than Button. Once I do that, I can then reference the
LastClickedTime just like a "normal" property.

This seems so easy, but I cannot see how to do it. Am I going
completely in the wrong direction?

Thanks in advance,
Rod
 
Thanks Steve. Unfortunately I had seen that article in my searching.
It's exactly what I want to do, but I was hoping to find a way to do
the same thing without having to actually create a DLL. Sounds like I
need to just get over it and move on!

Rod
 
Back
Top