473,395 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Can User Control inherted from a User Controls?

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";
}
}


Nov 19 '05 #1
1 1170
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.

--
Best Regards

The Inimitable Mr Newbie º¿º


"ABC" <ab*@abc.com> wrote in message
news:eq*************@TK2MSFTNGP15.phx.gbl...
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";
}
}

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jean-dot-paul-at-opelwilly-dot-com | last post by:
Hello, Can I use the ToolboxBitmap from the inherted Control to show up in my toolbox and if so how? Greetings Jean Paul
0
by: ABC | last post by:
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...
1
by: Robert Howells | last post by:
Perhaps I'm just too new at this to pull it off, or perhaps it's just bad architecture. I'd appreciate some feedback on the the wisdom (or lack thereof) in attempting the following: I'm not new...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
4
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
2
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
0
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
0
by: ABC | last post by:
I created a base control which will be inherted from another Custom UI control. When I draw Custom UI control on Web Page, and try to change properties. Oh, my god, no one properties from...
0
by: ABC | last post by:
Why the properties of web user controls which inherted from my custom base UI controls MISSED? How should I to set enable?
0
by: ABC | last post by:
Why the properties of web user controls which inherted from my custom base UI controls MISSED? How should I to set enable?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.