Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Web UserControl and Visual Inheritance

Reply
Thread Tools

Web UserControl and Visual Inheritance

 
 
Ben Fidge
Guest
Posts: n/a
 
      06-08-2004
Hi

I have a situation where it would be very advantageous to
be able to derive a new web UserControl from an existing
one, making the bases server controls available to the
derived class (and therefore, visible to the user).

I know how to derive from a base class so that common
code is available to the derived class, but I need to UI
elements to be visible in the new usercontrol too.

Any ideas?

Ben
 
Reply With Quote
 
 
 
 
Oleg Ogurok
Guest
Posts: n/a
 
      06-08-2004


I believe that's impossible.
When you execute a page (view it in browser), your ASPX or ASCX content is
transformed into a classon the fly. This class is always inherited from the
codebehind (.cs).
As far as I know, you can't derive from ASPX or ASCX. Therefore you can't
create a derived user control that would include the visual parts of the
base one.
Your only choice is to add your controls programmatically in the codebehind
of the base class, and then inherit.

-Oleg.


"Ben Fidge" <> wrote in message
news:1984c01c44d36$fcf27f60$...
> Hi
>
> I have a situation where it would be very advantageous to
> be able to derive a new web UserControl from an existing
> one, making the bases server controls available to the
> derived class (and therefore, visible to the user).
>
> I know how to derive from a base class so that common
> code is available to the derived class, but I need to UI
> elements to be visible in the new usercontrol too.
>
> Any ideas?
>
> Ben



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web UserControl inheritance Ivan A. Vasilyev ASP .Net Web Controls 4 07-02-2007 05:40 AM
web usercontrol + delegates or specialised usercontrol base class info@record-play.com ASP .Net 0 06-23-2006 09:41 AM
Web UserControl inheritance in VS 2005 Yuan ASP .Net 1 01-26-2006 02:15 AM
want to have <cc:UserControl>some text and tags</cc:UserControl>... How? ThunderMusic ASP .Net 4 12-21-2005 11:59 AM
Web Usercontrol in a Web Usercontrol not displaying... Kan Grewal ASP .Net Web Controls 2 07-07-2004 08:12 AM



Advertisments