Can User Control inherted from a User Controls?

M

Mr Newbie

When you Inherit from a base class. You do not see the base code in the
class definition of your derived class. However, if you have given anything
other than private as the accessor privilage , then you will be able to
'Use' those properties or methods etc from the derived class.

Hope this answers you question.
 
A

ABC

I write a Base Web User Control which contains several public properties and
a Inherited Web User Control which only have some codes in new method. When
I use the Inherited Web User Control on Web Form, I don't know why the
Inherited Web User Control have not any properties inherited from Base Web
User Control.
How should I do?

The based web user control as:
using System;
....
....

namespace xxxx.UserControls
{
public class SystemTableDropDownListBase : System.Web.UI.UserControl
{

public SystemTableDropDownListBase() : base ()
{
...
}

public override void DataBind()
{
...
}

...

// Properties

public string ViewName
{
...
}

public string DataTextField
{
...
}

...
}
}



The Inherited Web User Control as:
namespace xxxx.UserControls
{
public class xxxxDropDownList : SystemTableDropDownListBase
{

public xxxxDropDownList() : base()
{
ViewName = "vstSalutation";
}
}
 

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,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top