control question
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolscs' list.


Cameron Elliot
-- Copied from [aspngfreeforall] to [aspngcontrolscs] by Tim Musschoot <Click here to reveal e-mail address> --

Hi,
I have created a few of my own user and custom controls and have =
discovered through msdn how to created databound templated controls. =
What I would like to know is how to create a control/class similar to =
ListItem where free text can go in between the open and close tag.

ie <blah:CustomListItem value=3D"1">one</blah:CustomListItem>

How is it the the text 'one' gets assigned to the ListItem's Text =
property? Would be great if I had the source code so I could see how =
this is done.

Any suggestions welcome.
Cameron

Reply to this message...
 
    
Tuukka Haapaniemi
Hi Cameron!

The easiest way of completing this is by inheriting your class from
panel. This also gives you a very flexible solution that you can
endevelop.

<code>

namespace CustomControls
{
    public class MyTest : Panel
    {
         //set your propertiest etc. here
    }
}

</code>

Then call it from the aspx page like follows:

<code>

<%@ Register TagPrefix="Custom" Namespace="CustomControls" Assembly =
"CustomControls" %>

...

<Custom:MyTest runat=server>
    This is the inner text
</Custom:MyTest>

</code>

"Cameron Elliot" <Click here to reveal e-mail address> wrote in
news:658029@aspngcontrolscs:

[Original message clipped]

Reply to this message...
 
    
TIM ELLISON
Look at Persist... design-time attributes. These attributes are at class
level and affect where in the ASPX persistence for the class the attributes
for the class will store the values.

Off the top of my head, one is "PersistChildren(true|false)" which specifies
whether or not to have a class store its children in the persistible medium
(aspx).

Regards,

Tim Ellison
Senior Web Applications Developer,
Long and Foster Real Estate
703-359-1884
Click here to reveal e-mail address

-----Original Message-----
From: Cameron Elliot [mailto:Click here to reveal e-mail address]
Sent: Monday, May 20, 2002 4:39 PM
To: aspngcontrolscs
Subject: [aspngcontrolscs] control question

-- Copied from [aspngfreeforall] to [aspngcontrolscs] by Tim Musschoot
<Click here to reveal e-mail address> --

Hi,
I have created a few of my own user and custom controls and have =
discovered through msdn how to created databound templated controls. =
What I would like to know is how to create a control/class similar to =
ListItem where free text can go in between the open and close tag.

ie <blah:CustomListItem value=3D"1">one</blah:CustomListItem>

How is it the the text 'one' gets assigned to the ListItem's Text =
property? Would be great if I had the source code so I could see how =
this is done.

Any suggestions welcome.
Cameron
| [aspngcontrolscs] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcontrolscs.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.Web.UI.WebControls.ListItem




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com