Subclassing a user control containing UI elements

C

Charlie@CBFC

Hi:

When I derive a new user control from an existing user control that contains
UI elements (buttons, textboxes, etc.) and put derived control on a form, UI
elements don't appear when I run the form. Why doesn't derived control
inherit them?

Thanks,
Charlie
 
W

William F. Robertson, Jr.

A derived control will only inherit the codebehind portion. The UI elements
in the .ascx file, postion, etc, are not actually in your (base) class. The
..ascx is "married" to your codebehind on the first time the page is
requested.

If you need to inherit all functionality and UI elements, you should look at
moving to a server control, but there is no GUI for design time UI element
positioning.

HTH,

bill
 

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

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top