This project is read-only.

Skin Template Workings

Topics: Developer Forum, User Forum
May 8, 2008 at 7:44 PM
I'm a very experienced developer and am baffled as to how the .skin file is used to insert the 'Top' and 'Bottom' TemplatedContent in this apps architecture.

The MS documentation/samples, etc on Themes/Skins say you can only apply 'skin' styling to Themeable attributes.

The <cc1:TemplatedContent runat="server" SkinID="Top"> in the .skins files appear to be very similar to adding a control on a normal page but it's a skin file? The TemplatedContent has fully defined controls embedded in it, again defying all documentation I read for what goes in a .skin file..

Can someone point me to help file/page/blog I have not found?


May 8, 2008 at 8:03 PM
Hi
The skinfile contains a TemplateContent with an id top and bottom.
Between these the content are rendered(where the sections are going). In Site.master, <asp:ContentPlaceHolder ID="mainContent" runat="server"></asp:ContentPlaceHolder> is where the sections are loaded.
You can only add controls add html in <ContentTemplate>.

The TemplatedContent is a UserControl(Composite) as same as you add a regular usercontrol, the diffrens is that this control is a holder of other controls for eg a Menu and your html.

You can read the post I did earlier and see if it makes any sense to you: http://www.codeplex.com/MyWebPagesStarterKit/WorkItem/View.aspx?WorkItemId=15307

Let me know if I you need more help.
May 9, 2008 at 12:52 PM
Thanks for the quick response but I have inferred all you state above by looking at the code. It hasn't taken me this long to figure out how something was done in quite awhile.

My problem/question is how did you know (documentation) relating to using the technique of adding content from within a .skin file. I'm not necessarily looking to change things I'm wanting to learn about this technique of adding content from a .skin file.

Everything I have read on .skin's is all related to styling server controls. Nowhere have I read anything about the ability to declare and actually cause additional content/controls to be be rendered to a page via a .skin file.

Did you reverse engineer source to know you could declare and add content or is it documented somewhere I have not yet found?

May 9, 2008 at 5:46 PM
Hello again

Theres no documentation. I studied the code and learned how it's done. The code is available as open source.

The sections are not rendered via the Skinfile. The top and bottom in skinfile is only a definition of a layout for that page.
Alla sections are loaded in default.aspx.cs to phSection in default.aspx. In Page_Init all controls for the specific page are loaded.
It loops thrue all section from WebPage.cs(guid.config) and put's them in the phSection control

In my application I removed all code from default.aspx.cs (created a dll for all classes) and added a new Composite class "SectionControls", this makes the load and compiletime faster.