Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Inner Tags and inheirited controls, only want one property

Reply
Thread Tools

Inner Tags and inheirited controls, only want one property

 
 
Sally
Guest
Posts: n/a
 
      04-13-2004
I want to write a custom control that allows inner tags. Something like:

<test:Blob>
<test:ElementBase/>
<test:Element1/>
<test:Element2/>
<test:Element1/>
</test:Blob>

Since Element1 and Element2 are derived from ElementBase, I would
like to only have to have one property in my Blob Class. This does
not seem to be the case. But if I derive a new TableCell class
from TableCell, Table understands my new class without any changes.
How can do I do this for my class?

namespace test
{
public class Blob : WebControl
{
private void AddIt(Element e)
{
// do something here
}

public ElementBase Element {set{AddIt(value);}}
// shouldn't need each of these, but complains without them
public Element1 Element1 {set {AddIt(value);}}
public Element2 Element1 {set {AddIt(value);}}
}

public class ElementBase
{}
public class Element1 : ElementBase
{}
public class Element2 : ElementBase
{}
}
 
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
Designer Property Serialization -- Sycning inner properties to designer property window Alexander Higgins ASP .Net Building Controls 3 07-30-2007 09:09 PM
Designer Property Serialization -- Sycning inner properties to designer property window Alexander Higgins ASP .Net Web Controls 0 07-21-2007 12:58 AM
What the diff between a virtual method and an inheirited method jlopes C++ 5 11-19-2004 09:43 PM
I see no difference in an inheirited non-virtual method and an inheirited virtual method jlopes C++ 7 11-19-2004 07:47 PM
Am I the only one who questions JSTL, Struts Tags, XSL Tags? Greg Smith Java 35 10-24-2004 07:46 AM



Advertisments