Inherit from a Web User Control

M

Magnus Strandberg

Hi,

Is it possible to inherit from a web user control (*.ascx) created in a
separate class-assembly to a local specialized control that can be used in
an aspx-page ?
What I want to do is to create some sort of base class library of controls
to inherit from, and use in specific dotnet web apps.
Any ideas ?


/Magnus
 
S

Steve C. Orr [MVP, MCSD]

M

MasterGaurav

Yes. You can inherit from the user controls.

I would suggest the following:

1. Create custom user controls without ascx files.
2. Enhance this custom control in the ascx file.

I would rather warn against deriving your class from the dynamically
created user control from the ascx file. DO NOT DO that. It may work
today, but not tomorrow if the strategy of compilation changes.



--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top