Enviroment: Asp.Net 3.5, VS 2008, Windows XP
Hello, i have a user control (uc:StackUC) such as:
<fieldset>
<legend>blablabla</legend>
<%-- other fields --%>
<asp:PlaceHolder ID="contentHolder" runat="server"></asp:PlaceHolder>
<asp:Button runat="server"/>
</fieldset>
My idea is to use on my pages, like this (due to lots of repetition):
...
<uc:StackUC>
<label>specific content</label>
<%-- blablabla --%>
</uc:StackUC>
...
I believe it has to do with templated user controls, however, all the examples i find have no pre-defined user controls, and are aimed at doing
<%#Container.Index %> (or any other property)
Which is not useful to me.
Thanks in advance.
References for templated user controls: http://leedale.wordpress.com/2007/08/11/creating-a-templated-user-control-with-aspnet-20/, http://msdn.microsoft.com/en-us/library/36574bf6(vs.71).aspx#Y456
The following codes are simplified.
The user-control ascx:
This is my user control code-behind:
My usage in the view:
This is actually a copy of the results of my other question post.