In order to use the sample control on a page all you need to do is add a @Register
directive to the assembly: <%@ Register TagPrefix="MySite" Namespace="MySite.Controls" Assembly="MySite" %>
And to add the actual control to the page: <MySite:SampleControl SkinVirtualPath="SampleSkin.ascx" runat="server"/>
The property SkinVirtualPath
is optional, but I thought I'd just show you how you can easily override the default skin for a control.
And of course you need to create a skin - here is an example: <%@ Control Language="C#" %>
<asp:label id="Label1" cssclass="header" runat="server"/><br/>
<asp:repeater id="Repeater1" runat="server">
<itemtemplate><%# Container.DataItem %></itemtemplate>
<separatortemplate>, </separatortemplate>
</asp:repeater>
Well that's it basically – I hope you've enjoyed reading this.
Comments