Inheriting a .net class

Ok here's what I'm trying to do I want to write a class that inherits everything from the class ListItem

class RealListItem : ListItem
{

  public string anExtraStringINeed;

}

For some reason or another .net is treating all the members like they are private when I try to do this so my class is worthless.

I tried to do a work around and do it like this:

class RealListItem : ListItem
{
  public string anExtraStringINeed;
  public ListItem list;
}

but it still doesn't work because I need to use it in a function that uses the accepts type ListItem and RealListItem isn't playing nice like it should. I can do aRealListItem.list but that only passes the list from RealListItem I need the whole object to be passed along.

Whats with this am I doing something wrong or will microsoft just not let you inherit .net classes?

Answers


The System.Web.UI.Controls.ListItem class is "sealed"... That means you cannot inherit from it...


Need Your Help

Python not showing decimals

python

Python is exhibiting a strange behaviour that I didnt witness before, not sure what I did or what happened but basically it doesnt operate in shell with decimals

R + Org-mode: how to avoid naming plot files?

r emacs latex org-mode sweave

When I use Sweave with R, I can avoid explicitly naming the plot files by simply enclosing the plot commands within a code-chunk like <<fig=TRUE>> ... @. The Sweave driver automatically

Changing existing pass phrase to non obvious hard to guess phrase

c# security

Here is what I am trying to do. I have a program which stores data into MS Access file with database password. All data in table is encrypted by using user name ans password. They both use the same

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.