HighTechTalks DotNet Forums  

Composite Control as Template ...

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Composite Control as Template ... in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Marc Castrechini
 
Posts: n/a

Default Composite Control as Template ... - 09-14-2006 , 04:17 PM






Currently I have a composite control that has some base functionality that I
want to use for the base of a number of different controls. It has a
multiview to manage a display state and an edit state and a number of
buttons (Edit, Save, Cancel) to drive the display. Furthermore, I've
implemented two Templates to drive the Display and Edit views from the
designer.

When implemented it looks like this:
<MW:mwBaseUserControl runat="server" id="mwTestBase" Width="300px" >

<DisplayTemplate>

<asp:Label runat="Server" ID="lblTest" Text="test" />

</DisplayTemplate>

<EditTemplate>

<asp:TextBox runat="Server" ID="txtEdit" Text="test" />

</EditTemplate>

</MW:mwBaseUserControl>


So far everthing looks great. Now I want to use this control as a base to
create a number of other user controls so the derived controls are wrapped
with the basic functionality and display and can be easily setup using the
two templates

Can anyone point me to a resource to accomplish this?



Reply With Quote
  #2  
Old   
Marc Castrechini
 
Posts: n/a

Default Re: Composite Control as Template ... - 09-14-2006 , 05:09 PM






Disregard that prior post. We were over thinking this.

The command events are already being passed up through the composite control
to the calling page so we just needed to drop an instance of the composite
wrapper on the user control designer and fill in the templates.

Keep it simple ...

- Marc

"Marc Castrechini" <castro_9 (AT) newsgroup (DOT) nospam> wrote

Quote:
Currently I have a composite control that has some base functionality that
I want to use for the base of a number of different controls. It has a
multiview to manage a display state and an edit state and a number of
buttons (Edit, Save, Cancel) to drive the display. Furthermore, I've
implemented two Templates to drive the Display and Edit views from the
designer.

When implemented it looks like this:
MW:mwBaseUserControl runat="server" id="mwTestBase" Width="300px"

DisplayTemplate

asp:Label runat="Server" ID="lblTest" Text="test" /

/DisplayTemplate

EditTemplate

asp:TextBox runat="Server" ID="txtEdit" Text="test" /

/EditTemplate

/MW:mwBaseUserControl


So far everthing looks great. Now I want to use this control as a base to
create a number of other user controls so the derived controls are wrapped
with the basic functionality and display and can be easily setup using the
two templates

Can anyone point me to a resource to accomplish this?




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.