multiple constructors for custom controls
Hi! Thank you for reading.
Congratulations for your superb book!
I am just starting with Custom Web Controls. I tried to find how to have multiple constructors for custom controls, but I can't find it on the book...
I developed 2 constructors for my first custom control.
The problem is that ONLY the "default"/no arguments constructor gets called.
I think this happens because I do NOT know how to build my control, the right way, in the ASPX:
For example, when I want to pass arguments p1 and p2, I write what follows in the ASPX and it works, as far as passing the values to public properties named p1 and p2, but wonât call a two parameter constructor.
<prefix:class p1="1" p2="2"></prefix:class>
So, my questions are:
#1) can I have multiple constructors with custom web controls?
#2) if yes, then what should I write in the ASPX, to call a specific constructor?
Thank you so much, for your time and teachings!
|