| Installation |
UserPreferences |
| SiteMesh Wiki | FrontPage | RecentChanges | TitleIndex | WordIndex | SiteNavigation | HelpContents |
Installing SiteMesh.NET is simple. Follow these steps and check against the supplied example.
Step 1. Copy the SiteMesh.dll assembly into your bin directory or create references in your web application project using Visual Studio.NET.
Step 2. Add the configSections group to the configuration section of the web.config for your web application. This defines a custom section group of the web.config specifically for sitemesh. Its is made up of three sections, one for page parsers, one for decorators-mappers, and one for decorators (see step 3. below for more on these)
<configuration>
...
<configSections>
<sectionGroup name="sitemesh">
<section name="page-parsers" type="SiteMesh.Factory.PageParsersSectionHandler, SiteMesh" />
<section name="decorator-mappers" type="SiteMesh.Factory.DecoratorMappersSectionHandler, SiteMesh" />
<section name="decorators" type="SiteMesh.Mapper.DecoratorSectionHandler, SiteMesh" />
</sectionGroup>
</configSections>
...
</configuration>
Step 3. Next add the sitemesh section group to the configuration section of the web.config. Currently there is only one in the PageParsers and DecoratorMappers sections, but there will be more added here in future releases. User customization of these sections is only needed for advanced deployments. The Decorators section is for the definition of named decorators. This will be the section you will need to customize for your own application.
<configuration>
...
<sitemesh>
<page-parsers>
<parser default="true" type="SiteMesh.Parser.HtmlPageParser, SiteMesh" />
<parser content-type="text/html" type="SiteMesh.Parser.HtmlPageParser, SiteMesh" />
</page-parsers>
<decorator-mappers>
<mapper type="SiteMesh.Mapper.ConfigDecoratorMapper, SiteMesh"></mapper>
</decorator-mappers>
<decorators defaultdir="decorators">
<decorator name="simple" page="Decorator.aspx">
<pattern>*</pattern>
</decorator>
<decorator name="inline" page="inline.aspx"></decorator>
</decorators>
</sitemesh>
...
</configuration>
Step 4. Create YourFirstDecorator.