<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.sharepointblogs.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Michael Hofer - SharePoint Blog</title><link>http://www.sharepointblogs.com/michael/default.aspx</link><description>Michael Hofer&amp;#39;s blog about adventures in SharePoint land, including tips and tricks for all products and technologies used in Information Worker solutions.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>SharePoint Wiki: Create pages based on a template</title><link>http://www.sharepointblogs.com/michael/archive/2007/09/27/sharepoint-wiki-create-pages-based-on-a-template.aspx</link><pubDate>Thu, 27 Sep 2007 08:13:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:6392</guid><dc:creator>mhofer1976</dc:creator><slash:comments>12</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/michael/rsscomments.aspx?PostID=6392</wfw:commentRss><comments>http://www.sharepointblogs.com/michael/archive/2007/09/27/sharepoint-wiki-create-pages-based-on-a-template.aspx#comments</comments><description>&lt;h2 style="MARGIN:10pt 0cm 0pt;"&gt;&lt;span&gt;&lt;font face="Cambria" color="#4f81bd" size="4"&gt;Creating Wiki-Pages from a Template&lt;/font&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 10pt;"&gt;&lt;span&gt;&lt;font face="Calibri"&gt;To make Wiki pages look uniform, it would be handy if there was always the same template used when the pages &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;are created. Unfortunately, WSS 3.0/MOSS 2007 doesn’t support this functionality (yet). The below paragraphs show the concept on how to achieve this functionality. Neither the code nor the configuration steps described are suitable for a production environment – they are just the proof-of-concept that it is possible. Adopt it freely!&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 style="MARGIN:10pt 0cm 0pt;"&gt;&lt;span&gt;&lt;font face="Cambria" color="#4f81bd" size="4"&gt;The configuration part&lt;/font&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p class="MsoListParagraphCxSpFirst" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;1.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Create a WIKI site&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;2.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Create a Custom List called something like “Page Templates”&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;3.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Add a custom column “Template” and make it multi-line rich-text including pictures etc.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;4.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Now create your HTML Template.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;5.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Copy your HTML (only the part inside the &amp;lt;body&amp;gt; of course) and add an entry in your custom list. In my example, the title is “Wikipedia” and in the “Template Column” switch to HTML view and paste your HTML Teplate&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;6.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;If your template needs a separate stylesheet, you must proceed like with any other stylesheet in MOSS (and make sure it doesn’t interfere with the standard styles so your layout gets corrupted…):&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 72pt;TEXT-INDENT:-18pt;mso-add-space:auto;mso-list:l0 level2 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;a.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Upload the style sheet to the appropriate location in the Styles Library&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpLast" style="MARGIN:0cm 0cm 10pt 72pt;TEXT-INDENT:-18pt;mso-add-space:auto;mso-list:l0 level2 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;b.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Add a link to the style-sheet to the master page (Example: &lt;i style="mso-bidi-font-style:normal;"&gt;&amp;lt;SharePoint:CssRegistration name=&amp;quot;&amp;lt;% $SPUrl:~sitecollection/Style Library/wikipedia_common.css %&amp;gt;&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;/i&gt;)&lt;br style="mso-special-character:line-break;" /&gt;&lt;br style="mso-special-character:line-break;" /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 style="MARGIN:10pt 0cm 0pt;"&gt;&lt;span&gt;&lt;font face="Cambria" color="#4f81bd" size="4"&gt;The development part&lt;/font&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 10pt;"&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Before I show the development steps this warning: This is a quick’n’dirty approach in a development environment and you mustn’t change standard MOSS-files! If you want to use this in a real environment, create a custom site definition where the Wiki Pages list doesn’t point to &lt;i style="mso-bidi-font-style:normal;"&gt;_layouts/CreateWebPage.aspx &lt;/i&gt;but to your own page which is deployed with your custom site definition. However, the scope of this instruction is only to show how it is supposed to work. Please keep this also in mind when looking at the code!&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpFirst" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;1.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Create a new class-library&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;2.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Make sure it will be signed&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;3.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Add two references:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 72pt;TEXT-INDENT:-18pt;mso-add-space:auto;mso-list:l1 level2 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;a.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Microsoft.SharePoint.dll (12\ISAPI)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 72pt;TEXT-INDENT:-18pt;mso-add-space:auto;mso-list:l1 level2 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;b.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Microsoft.SharePoint.ApplicationPages.dll (\12\CONFIG\BIN)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpLast" style="MARGIN:0cm 0cm 10pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;4.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Create your class inheriting from CreateNewWeb as shown in the code example. I guess the code is self-speaking:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class="MsoTableGrid" style="BORDER-RIGHT:medium none;BORDER-TOP:medium none;MARGIN:auto auto auto 36pt;BORDER-LEFT:medium none;BORDER-BOTTOM:medium none;BORDER-COLLAPSE:collapse;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt;" cellspacing="0" cellpadding="0" class="MsoTableGrid"&gt;

&lt;tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes;"&gt;
&lt;td class="" style="BORDER-RIGHT:black 1pt solid;PADDING-RIGHT:5.4pt;BORDER-TOP:black 1pt solid;PADDING-LEFT:5.4pt;PADDING-BOTTOM:0cm;BORDER-LEFT:black 1pt solid;WIDTH:478.8pt;PADDING-TOP:0cm;BORDER-BOTTOM:black 1pt solid;BACKGROUND-COLOR:transparent;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;"&gt;
&lt;p&gt;using System;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using Microsoft.SharePoint.ApplicationPages;&lt;br /&gt;using Microsoft.SharePoint.WebControls;&lt;br /&gt;using Microsoft.SharePoint;&lt;/p&gt;
&lt;p&gt;namespace Mho.SharePoint.Trials&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class EnhancedCreateWebpage : CreateWebPage&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected ListFieldIterator listFieldIterator;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected string template;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public EnhancedCreateWebpage() { }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected override void OnPreRender(EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!this.Page.IsPostBack)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get the templates list&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPList templatesList = this.listFieldIterator.Web.Lists[&amp;quot;Page Templates&amp;quot;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (TemplateSourceDirectory != null &amp;amp;&amp;amp; templatesList.Items.Count &amp;gt; 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Just take the first template for demonstration&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.template = templatesList.Items[0][&amp;quot;Template&amp;quot;].ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; templatesList = null;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.FindRichTextControl(listFieldIterator);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.OnPreRender(e);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void FindRichTextControl(Control control)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Control childControl in control.Controls)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (childControl.GetType().Equals(typeof(Microsoft.SharePoint.WebControls.RichTextField)))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((RichTextField)childControl).Value = this.template;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.FindRichTextControl(childControl);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p class="MsoListParagraphCxSpFirst" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;5.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Compile and deploy to the GAC&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;6.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;&amp;lt;Warning! See above paragraph – this is not supported!&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 72pt;TEXT-INDENT:-18pt;mso-add-space:auto;mso-list:l1 level2 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;a.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Open the file “12\TEMPLATE\LAYOUTS\CreateWebPage.aspx” (a backup could maybe be handy…)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 72pt;TEXT-INDENT:-18pt;mso-add-space:auto;mso-list:l1 level2 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;b.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Change the header to point to your assembly:&lt;br /&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&amp;lt;%@ Assembly Name=&amp;quot;Mho.SharePoint.Trials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=261ba54b9846991b&amp;quot;%&amp;gt;&lt;/i&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 72pt;TEXT-INDENT:-18pt;mso-add-space:auto;mso-list:l1 level2 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;c.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Set the correct class to inherit from&lt;br /&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; Inherits=&amp;quot;Mho.SharePoint.Trials.EnhancedCreateWebpage&amp;quot;…&lt;/i&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN:0cm 0cm 0pt 72pt;TEXT-INDENT:-18pt;mso-add-space:auto;mso-list:l1 level2 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;d.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Add the name of the “ListFieldIterator” control you’ve used in the class code as its ID:&lt;br /&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&amp;lt;SharePoint:ListFieldIterator &lt;b style="mso-bidi-font-weight:normal;"&gt;ID=&amp;quot;listFieldIterator&amp;quot;&lt;/b&gt;…&lt;/i&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpLast" style="MARGIN:0cm 0cm 10pt 36pt;TEXT-INDENT:-18pt;mso-list:l1 level1 lfo2;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri"&gt;7.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;Recycle the application pool and try it out.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=6392" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/michael/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Development/default.aspx">Development</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Collaboration/default.aspx">Collaboration</category></item><item><title>MOSS 2007 profile import using BDC with Single Sing-On: Permissions</title><link>http://www.sharepointblogs.com/michael/archive/2007/09/18/moss-2007-profile-import-using-bdc-with-single-sing-on-permissions.aspx</link><pubDate>Tue, 18 Sep 2007 13:42:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:5945</guid><dc:creator>mhofer1976</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/michael/rsscomments.aspx?PostID=5945</wfw:commentRss><comments>http://www.sharepointblogs.com/michael/archive/2007/09/18/moss-2007-profile-import-using-bdc-with-single-sing-on-permissions.aspx#comments</comments><description>&lt;p&gt;If you want to extend your profiles with data not only coming from an LDAP source, but also from the BDC you have to be aware of some permission settings in order to prevent you from a severe headache. And even more when you connect to your external data source using the Single Sign-On service.&lt;/p&gt;
&lt;p&gt;Configuring the import&amp;#39;s custom datasource is pretty easy, so I won&amp;#39;t get into this. But now comes what is not so obvious: How to set the permissions to make this work&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Make sure you know the account on which the profiles are crawled. This is ususally the default content access account specified for the search (you cannot specifiy a special useraccount for the BDC custom datasource!&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;This account must be member of the group you&amp;#39;ve specified in the Single Sign-On settings page for the SSO application that is used in the BDC instance of your application definition.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Also, this account must have &amp;quot;Execute&amp;quot; rights on the BDC, the application and don&amp;#39;t forget the instance itself! (I&amp;#39;m not so sure here, but there are these 3 levels of permission - instance is needed in any case!)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Make sure that this account hase the &amp;quot;Manage Audiences&amp;quot; right in &amp;quot;Personalization services permissions&amp;quot;.&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Uff... that&amp;#39;s all. Now it should work. Happy trying&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=5945" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/michael/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Security/default.aspx">Security</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/BDC/default.aspx">BDC</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Single+Sign-On/default.aspx">Single Sign-On</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Audiences/default.aspx">Audiences</category></item><item><title>Sharepoint cannot authenticate to ISA Server - Resolved: Kerberos needed</title><link>http://www.sharepointblogs.com/michael/archive/2007/09/06/sharepoint-cannot-authenticate-to-isa-server.aspx</link><pubDate>Thu, 06 Sep 2007 12:37:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:5419</guid><dc:creator>mhofer1976</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/michael/rsscomments.aspx?PostID=5419</wfw:commentRss><comments>http://www.sharepointblogs.com/michael/archive/2007/09/06/sharepoint-cannot-authenticate-to-isa-server.aspx#comments</comments><description>&lt;p&gt;This gave and gives me a hard time! Imagine MOSS 2007 running in a corporate intranet. Your requirement is to connect to datasources on the internet. There are various scenarios, the most common are to&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Consume RSS Feeds using the RSSFeed webpart&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Consume a WebService or Server-Side Script using the SharePoint Designer DataView Webpart&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;When using the DataView WebPart, you&amp;#39;ll get the following error message when trying to show the data from the internet source:&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;b&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;“The server returned a non-specific error when trying to get data from the data source. …”&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;b&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;When connecting using the RSSFeed Webpart, the error message will be even less saying...&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font face="Calibri" size="3"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font face="Calibri" size="3"&gt;OK, what can we do? Make sure that you&amp;#39;ve set the proxy in the web.config of your SharePoint Site Collection, as documented by Microsoft here: &lt;a href="http://support.microsoft.com/kb/923173"&gt;http://support.microsoft.com/kb/923173&lt;/a&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font face="Calibri" size="3"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font face="Calibri" size="3"&gt;However, this might still not do the trick! The DataView WebPart still shows the same error message. However, the RSSFeed Webpart is this time a little bit more specific:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font face="Calibri" size="3"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-fareast-language:DE-CH;mso-bidi-language:AR-SA;"&gt;&lt;strong&gt;“ProxyAuthenticationRequired (The ISA Server requires authorization to fulfill the request…)&amp;quot;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-fareast-language:DE-CH;mso-bidi-language:AR-SA;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-fareast-language:DE-CH;mso-bidi-language:AR-SA;"&gt;So wat is the problem? It seems (and some other bloggers mentioned this explicitely) that SharePoint doesn not authenticate itself towards the ISA Server! The only solution to this problem is to allow requests&amp;nbsp;from all&amp;nbsp;the IP addresses of all SharePoint WFE Servers to pass through ISA! (wheew, I hear your customers start to question you louder than normal - at least this is what happened here ;))&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-fareast-language:DE-CH;mso-bidi-language:AR-SA;"&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-fareast-language:DE-CH;mso-bidi-language:AR-SA;"&gt;Well, this is what I know so far and granting all requests of my SharePoint WFE&amp;#39;s to pass through works just perfectly. I&amp;#39;ll try to investigate in this a bit more internally and make sure that MOSS server-side authentication is included in Office 14...&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-fareast-language:DE-CH;mso-bidi-language:AR-SA;"&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-fareast-language:DE-CH;mso-bidi-language:AR-SA;"&gt;&lt;strong&gt;UPDATE: This is a double-hop problem! If you use Kerberos authenticaion, there is no problem! Thanks &lt;/strong&gt;&lt;a title="smyttie" href="http://www.sharepointblogs.com/user/Profile.aspx?UserID=10497"&gt;&lt;font face="Arial" color="#000000"&gt;&lt;strong&gt;smyttie&lt;/strong&gt;&lt;/font&gt;&lt;/a&gt;&lt;strong&gt;!!!&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-fareast-language:DE-CH;mso-bidi-language:AR-SA;"&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-fareast-language:DE-CH;mso-bidi-language:AR-SA;"&gt;Hope this helps some of you to save a lot of valuable time...&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font face="Calibri" size="3"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=5419" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/michael/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Security/default.aspx">Security</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/ISA+Server/default.aspx">ISA Server</category></item><item><title>ActiveDirectory/LDAP: How to get the logon name of a user?</title><link>http://www.sharepointblogs.com/michael/archive/2007/08/08/activedirectory-ldap-how-to-get-the-logon-name-of-a-user.aspx</link><pubDate>Wed, 08 Aug 2007 15:49:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:4091</guid><dc:creator>mhofer1976</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/michael/rsscomments.aspx?PostID=4091</wfw:commentRss><comments>http://www.sharepointblogs.com/michael/archive/2007/08/08/activedirectory-ldap-how-to-get-the-logon-name-of-a-user.aspx#comments</comments><description>&lt;p&gt;This post demonstrates how to construct the user logonname from an ActiveDirectory DirectoryEntry instance using C#.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Well, this time nothing about SharePoint! Wow! I&amp;#39;ve decided to post this little &amp;quot;How To&amp;quot; since I&amp;#39;ve encountered this problem already many times and spent always a heck of a time looking for an answer.&lt;/p&gt;
&lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;Situation&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;I have the DirectoryEntry instance representing a user-objectClass in ActiveDirectory and I want to get his/her Windows logonname using not the full qualified name, but &amp;quot;&amp;lt;domain&amp;gt;\&amp;lt;username&amp;gt;&amp;quot; format.&lt;/p&gt;
&lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Use the &amp;quot;distinguishedName&amp;quot; property and extract the first &amp;quot;DN=xyz&amp;quot; information. This is tipically the domain name you are looking for. The username portion comes then easily from the &amp;quot;samaccountname&amp;quot; property.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;Example:&lt;/u&gt;&lt;/p&gt;&lt;font color="#0000ff"&gt;
&lt;p&gt;string&lt;/font&gt; distinguishedName = ((&lt;font color="#0000ff"&gt;string&lt;/font&gt;)entry.Properties[&lt;font color="#a31515"&gt;&amp;quot;distinguishedName&amp;quot;&lt;/font&gt;].Value);&lt;br /&gt;&lt;font color="#2b91af"&gt;Regex&lt;/font&gt; regex = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#2b91af"&gt;Regex&lt;/font&gt;(&lt;font color="#a31515"&gt;&amp;quot;(?&amp;lt;=DC=).+?(?=,)&amp;quot;&lt;/font&gt;);&lt;br /&gt;&lt;font color="#2b91af"&gt;Match&lt;/font&gt; match = regex.Match(distinguishedName);&lt;br /&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt; (match.Success)&lt;br /&gt;{&lt;br /&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/font&gt; &lt;font color="#0000ff"&gt;string&lt;/font&gt;.Format(&lt;font color="#a31515"&gt;&amp;quot;WinNT://{0}/{1}&amp;quot;&lt;/font&gt;, match.Value.ToUpper(), entry.Properties[&lt;font color="#a31515"&gt;&amp;quot;samaccountname&amp;quot;&lt;/font&gt;][0]);&lt;br /&gt;}&lt;br /&gt;&lt;font color="#0000ff"&gt;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=4091" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/michael/archive/tags/How+To/default.aspx">How To</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Active+Directory/default.aspx">Active Directory</category></item><item><title>Using the Business Data Catalog with Single Sign-On</title><link>http://www.sharepointblogs.com/michael/archive/2007/07/30/using-the-business-data-catalog-with-single-sign-on.aspx</link><pubDate>Mon, 30 Jul 2007 21:06:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:3748</guid><dc:creator>mhofer1976</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/michael/rsscomments.aspx?PostID=3748</wfw:commentRss><comments>http://www.sharepointblogs.com/michael/archive/2007/07/30/using-the-business-data-catalog-with-single-sign-on.aspx#comments</comments><description>&lt;p&gt;Connecting the Business Data Catalog to a Microsoft SQL Server Database or any other ADO.NET based data source is an easy task when using Windows Credentials since the users own credentials or the application pool identity can be passed to the business application directly or a user/password combination can be used in the definition file (not recommended). &lt;/p&gt;
&lt;p&gt;While it is for many reasons the best practice to use Windows Credentials to connect to any data source, there are sometimes scenarios where other authentication mechanisms have to be used. When connecting the Business Data Catalog to a Microsoft SQL Server Database using SQL Server authentication, user credentials must be transmitted using the Microsoft Single Sign-On Service.&lt;/p&gt;
&lt;p&gt;MOSS 2007 includes an administrative interface to the Microsoft Single Sign-On service as well as an own pluggable Single Sign-On provider implementation. The following paragraphs describe how to setup and configure Single Sign-On and Business Data Catalog for SQL authentication-based data connections.&lt;/p&gt;
&lt;p&gt;For reference, see [1].&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="_Toc173344438" name="_Toc173344438"&gt;&lt;/a&gt;&lt;font size="3"&gt;&lt;b&gt;Setup and configure Single Sign-On&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="_Toc173344439" name="_Toc173344439"&gt;&lt;/a&gt;&lt;b&gt;General&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Installing Single-Sign On capabilities require high attention on security. The following paragraphs describe a step-by-step approach using best practices for security configuration when installing Single Sign-On for the Microsoft Office System Server (MOSS) 2007.&lt;/p&gt;
&lt;p&gt;The general reference on how to install and configure the Single Sign-On Service can be found in Technet (see [2]). &lt;/p&gt;
&lt;p&gt;&lt;a class="" title="_Toc173344440" name="_Toc173344440"&gt;&lt;/a&gt;&lt;b&gt;Step 1: Understanding the architecture&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To use Single Sign-On, the Microsoft Single Sign-On service (SSOSrv) must be installed on all Microsoft Windows front-end Web servers in the farm. &lt;br /&gt;SSOSrv must also be installed on all servers running Excel Services. If the Business Data Catalog search is used, SSOSrv must also be installed on the index server.&lt;br /&gt;In addition, the Encryption-Key server has to be determined. This is always the first server in the system where the SSOSrv is started.&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="_Toc173344441" name="_Toc173344441"&gt;&lt;/a&gt;&lt;b&gt;Step 2: Setting up security accounts and groups&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In order to setup Single Sign-On, it is best practice to setup the following security accounts and groups:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SSO Service Account: &lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The account the Microsoft Single Sign-On Service is running on.&lt;/li&gt;
&lt;li&gt;Must be a domain user account. It cannot be a group account. &lt;/li&gt;
&lt;li&gt;Must be an Office SharePoint Server farm account. &lt;/li&gt;
&lt;li&gt;Must be a member of the local Administrators group on the encryption-key server. &lt;/li&gt;
&lt;li&gt;Must be a member of the Security Administrators role and db_creator role on the computer running Microsoft SQL Server.&amp;nbsp; &lt;/li&gt;
&lt;li&gt;Must be a member of the MOSS SSO Administrators Group.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;MOSS SSO Administrators Group&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Can configure MOSS SSO Server settings such as the database, MOSS SSO Application Definition Administrators or encryption keys.&lt;/li&gt;
&lt;li&gt;Usually, these are the same administrators that also configure MOSS farm-level settings in Central Administration&lt;/li&gt;
&lt;li&gt;Must be a Windows global group, cannot be a domain local group account or a distribution list. &lt;/li&gt;
&lt;li&gt;Must be member of the Farm Administrators SPGroup on Central Administration.&lt;/li&gt;
&lt;li&gt;The single sign-on service account must be a member of that group.&lt;/li&gt;
&lt;li&gt;At least the farm administrator&amp;#39;s account who is configuring Single Sign-On should be member of that group.&lt;/li&gt;
&lt;li&gt;All group members must be local Administrators on the encryption-key server. Do not make this account a member of the local Administrators group on the encryption-key server.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;MOSS SSO Application Definition Administrators Group&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Can manage credentials of an enterprise application definition, including changing the password of a group enterprise application definition and changing or deleting credentials for an individual enterprise application definition.&lt;/li&gt;
&lt;li&gt;Must be a Windows global group, cannot be a domain local group account or a distribution list.&amp;nbsp; &lt;/li&gt;
&lt;li&gt;Must be a member of the Reader SharePoint group on Central Administration.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Please note: It is crucial, that all requirements are met. If not, you will receive an error stating &amp;quot;You do not have the permission to perform this action&amp;quot; when setting up the MOSS SSO Server in Central Administration. &lt;/p&gt;
&lt;p&gt;&lt;a class="" title="_Toc173344442" name="_Toc173344442"&gt;&lt;/a&gt;&lt;b&gt;Step 3: Configuring the Single Sign-On Service&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;On the server, click Start, Control Panel, Administrative Tools, and then click Computer Management.&lt;/li&gt;
&lt;li&gt;In the Computer Management console, expand Services and Applications, and then click Services.&lt;/li&gt;
&lt;li&gt;Right-click Microsoft Single Sign-On Service, and then choose Properties.&lt;/li&gt;
&lt;li&gt;On the General tab, change the Startup type to Automatic.&lt;/li&gt;
&lt;li&gt;On the General tab, under Service Status, click Start.&lt;/li&gt;
&lt;li&gt;Click OK to save your changes and close the Properties window. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Repeat steps 1 through 6 for each applicable server in the farm.&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;a class="" title="_Toc173344443" name="_Toc173344443"&gt;&lt;/a&gt;&lt;b&gt;Step 4: Registering the Single Sign-On Service in MOSS&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This step is not described in [2], however it performs some additional configurations on all servers where Single Sign-On will be enabled. For example, it adds the SSO Service Account to the IIS_WPG local group and configures the SSO Service (Step 3) to run under this account.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;On Central Administration, on the top navigation bar, click Operations. &lt;/li&gt;
&lt;li&gt;On the Operations page, in the Security Configuration section, click Service Accounts.&lt;/li&gt;
&lt;li&gt;Choose Windows Service and the Single Sign-On Service.&lt;/li&gt;
&lt;li&gt;Select Configurable for the account and enter the SSO Service Account by using the form domain\username.&lt;/li&gt;
&lt;li&gt;Click OK to save your changes and close the Properties window. &lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;a class="" title="_Toc173344444" name="_Toc173344444"&gt;&lt;/a&gt;&lt;b&gt;Step 5: Setting up the MOSS Single Sign-On Server&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;You must open Central Administration on the computer that runs Office SharePoint Server 2007 to manage server settings for single sign-on. &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;On Central Administration, on the top navigation bar, click Operations.&amp;nbsp; &lt;/li&gt;
&lt;li&gt;On the Operations page, in the Security Configuration section, click Manage settings for single sign-on. &lt;/li&gt;
&lt;li&gt;On the Manage Settings for Single Sign-On page, in the Server Settings section, click Manage server settings. &lt;/li&gt;
&lt;li&gt;On the Manage Settings for Single Sign-On page, in the Account name box in the Single Sign-On Administrator Account section, type the MOSS SSO Administrators Group by using the form domain/group. &lt;/li&gt;
&lt;li&gt;In the Enterprise Application Definition Administrator Account section, in the Account name box, type the MOSS Application Definition Administrators Group by using the form domain/group or domain/username.&lt;/li&gt;
&lt;li&gt;In the Database Settings section, in the Server name box, type the NetBIOS name of the single sign-on database server (for example, computer_name or computer_name\SQL_Server_instance). Do not type the fully qualified domain name.&amp;nbsp; &lt;/li&gt;
&lt;li&gt;In the Database name box, enter the name of the single sign-on database server.&amp;nbsp; &lt;/li&gt;
&lt;li&gt;In the Time Out Settings section, in the Ticket time out (in minutes) box, type a value for how many minutes passes before a single sign-on ticket expires. The time-out should be long enough to last between the time that the ticket is issued and the time that the enterprise application redeems the ticket. Two minutes is the recommended value. &lt;/li&gt;
&lt;li&gt;In the Delete audit log records older than (in days) box, type a value for how many days the audit log holds records before deleting them. &lt;/li&gt;
&lt;li&gt;Click OK.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;If you should get a &amp;quot;You do not have the permission to perform this action error&amp;quot; check the application log and make sure that all security requirements defined in step 2 are met.&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="_Toc173344445" name="_Toc173344445"&gt;&lt;/a&gt;&lt;b&gt;Step 6: Creating the Application Definition&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the single sign-on environment, the back-end external data sources and systems are referred to as enterprise applications. For each enterprise application that Office SharePoint Server 2007 connects to, a corresponding enterprise application definition needs to be configured.&lt;/p&gt;
&lt;p&gt;In order to connect to a Microsoft SQL Server database using SQL authentication a application definition has to be created in which the credentials of the SQL user will be stored.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;On Central Administration, on the top navigation bar, click Operations.&amp;nbsp; &lt;/li&gt;
&lt;li&gt;On the Operations page, in the Security Configuration section, click Manage settings for single sign-on. &lt;/li&gt;
&lt;li&gt;On the Manage Settings for Single Sign-On page, click Manage settings for enterprise application definitions.&lt;/li&gt;
&lt;li&gt;Click on New Item&lt;/li&gt;
&lt;li&gt;Enter a display name for the application in the Display Name box&lt;/li&gt;
&lt;li&gt;Enter an application name for the application in the Application name box&lt;/li&gt;
&lt;li&gt;In the &amp;quot;Field 1: Display Name&amp;quot; , enter &amp;quot;User ID&amp;quot; and set &amp;quot;Mask&amp;quot; to &amp;quot;No&amp;quot;&lt;/li&gt;
&lt;li&gt;In the &amp;quot;Field 2: Display Name&amp;quot;, enter &amp;quot;Password&amp;quot; and set &amp;quot;Mask&amp;quot; to &amp;quot;Yes&amp;quot;&lt;/li&gt;
&lt;li&gt;Click OK&lt;/li&gt;
&lt;li&gt;Back on the Manage Settings for Single Sign-On page, in the Enterprise Application Definition Settings section, click Manage account information for enterprise application definitions. &lt;/li&gt;
&lt;li&gt;On the Manage Account Information for an Enterprise Application Definition page, in the Enterprise application definition list in the Account Information section, click the application definition for which you want to manage account information. &lt;/li&gt;
&lt;li&gt;In the Group account name box, type the name of the group that is allowed access to the enterprise application.&lt;/li&gt;
&lt;li&gt;In the Enterprise Application Definition section, select Update account information.&lt;/li&gt;
&lt;li&gt;Click Set.&amp;nbsp; &lt;/li&gt;
&lt;li&gt;On the Provide Account Information page, in the Logon Information section, type the user name and password of the SQL user that will be used to connect to the Microsoft SQL Server database.&lt;/li&gt;
&lt;li&gt;Click OK.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;b&gt;Configuration of the Business Data Catalog&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Actually, there is no configuration to be done for the Business Data Catalog itself to interact with Single Sign-On. However, for every Application Definition where Single Sign-On is used, a LobSystemInstance node has to be added to the LobSystemInstances collection. Every LobSystemInstance specifies an &amp;quot;access point - in terms of connection and security information - to the LOB system, the Microsoft SQL Server database in this example scenario.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="1"&gt;...&lt;br /&gt;&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;LobSystemInstance Name=&amp;quot;Demo LOBDatabase&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Properties&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Property Name=&amp;quot;AuthenticationMode&amp;quot; Type=&amp;quot;System.String&amp;quot;&amp;gt;RdbCredentials&amp;lt;/Property&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Property Name=&amp;quot;DatabaseAccessProvider&amp;quot; Type=&amp;quot;System.String&amp;quot;&amp;gt;SqlServer&amp;lt;/Property&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Property Name=&amp;quot;RdbConnection Data Source&amp;quot; Type=&amp;quot;System.String&amp;quot;&amp;gt;moss-sql01&amp;lt;/Property&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Property Name=&amp;quot;RdbConnection Initial Catalog&amp;quot; Type=&amp;quot;System.String&amp;quot;&amp;gt;SQLAuthDemo&amp;lt;/Property&amp;gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Property Name=&amp;quot;RdbConnection Integrated Security&amp;quot; Type=&amp;quot;System.String&amp;quot;&amp;gt;false&amp;lt;/Property&amp;gt;&lt;br /&gt;&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Property Name=&amp;quot;RdbConnection Pooling&amp;quot; Type=&amp;quot;System.String&amp;quot;&amp;gt;false&amp;lt;/Property&amp;gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Property Name=&amp;quot;SsoApplicationId&amp;quot; Type=&amp;quot;System.String&amp;quot;&amp;gt;SQLAuthDemoSSOApp&amp;lt;/Property&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Property Name=&amp;quot;SsoProviderImplementation&amp;quot; Type=&amp;quot;System.String&amp;quot;&amp;gt;Microsoft.SharePoint.Portal.SingleSignon.SpsSsoProvider, Microsoft.SharePoint.Portal.SingleSignon, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;lt;/Property&amp;gt;&lt;br /&gt;&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Properties&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/LobSystemInstance&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="1"&gt;...&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In order to use Single Sign-On, please make sure that besides the regular connection information, the following properties are set:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;RdbConnection Integrated Security: &lt;/strong&gt;Tells the Business Data Catalog explicitly to not use integrated security.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SsoApplicationId: &lt;/strong&gt;Name of the Single Sign-On application as specified in Step 6.5 of the Single Sign-On setup. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SsoProviderImplementation: &lt;/strong&gt;Default pluggable implementation of the SharePoint SsoProvider.&lt;/p&gt;
&lt;p&gt;Besides of the above configuration which is done directly in the application definition file, there are no further actions required to enable Business Data Catalog to connect using Single Sign-On services.&lt;/p&gt;
&lt;h2&gt;&lt;font size="3"&gt;References&lt;/font&gt;&lt;/h2&gt;
&lt;p&gt;[1]: &lt;a class="" href="http://msdn2.microsoft.com/en-us/library/ms566523.aspx" target="_blank"&gt;Microsoft MSDN: Business Data Catalog Authentication&lt;/a&gt;&lt;br /&gt;[2]: &lt;a class="" href="http://technet2.microsoft.com/Office/en-us/library/841080ca-3e3b-4dbc-a081-43c29c76b3551033.mspx?mfr=true" target="_blank"&gt;Microsoft TechNet: Configure single sign-on&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=3748" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/michael/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Infrastructure/default.aspx">Infrastructure</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/BDC/default.aspx">BDC</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Single+Sign-On/default.aspx">Single Sign-On</category></item><item><title>SharePoint's core.css stylesheet: Put it to where it belongs!</title><link>http://www.sharepointblogs.com/michael/archive/2007/07/16/sharepoint-s-core-css-stylesheet-put-it-to-where-it-belongs.aspx</link><pubDate>Sun, 15 Jul 2007 22:25:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:2973</guid><dc:creator>mhofer1976</dc:creator><slash:comments>14</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/michael/rsscomments.aspx?PostID=2973</wfw:commentRss><comments>http://www.sharepointblogs.com/michael/archive/2007/07/16/sharepoint-s-core-css-stylesheet-put-it-to-where-it-belongs.aspx#comments</comments><description>&lt;p&gt;When rendering CSS stylesheets, SharePoint puts core.css always as the last stylesheet. This post is about how to change this sometimes unwanted behaviour.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;OK, why bother with how CSS Stylesheets are rendered? Imagine you create your own Stylesheet overriding a lot of the SharePoint styles defined in core.css (and as you know, there are really &amp;quot;some&amp;quot; styles you might override &lt;img src="http://www.sharepointblogs.com/emoticons/emotion-11.gif" alt="Cool" /&gt;). Now, if you follow the SharePoint &amp;quot;standard&amp;quot; approach and add your StyleSheet using the &amp;lt;SharePoint:CssRegistration&amp;gt; webcontrol, you&amp;#39;ll always have the problem that the Core.css stylesheet (the one you&amp;#39;re actually overriding...) is rendered AFTER your custom stylesheet. Result: All your work is for nothing, since the&amp;nbsp;last one wins when&amp;nbsp;styles will be applied to your web page... So, our friend &amp;quot;core.css&amp;quot; will always be the winner.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;There are several approaches how to handle this problem, they are &lt;a class="" href="http://heathersolomon.com/blog/archive/2006/10/27/sp07cssoptions.aspx" target="_blank"&gt;very well documented by Heather Solomon&lt;/a&gt;. My approach is somewhat different, though.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I&amp;#39;ve examined (thanks to .NET Reflector once more), the webcontrols CssRegistration and CssLink. CssRegistration is used to add custom CSS stylesheets using a &amp;quot;standard&amp;quot; approach with WebControls (thus not hardcoding it). CssLink does not accept any input but just renders all registered Stylesheets that are present in the SPContext where the page is rendered. The problem is that most of the methods, properties etc. are only internal and/or private. It is therefore practially impossible to really work with these types in the page declaration - not even in code...&lt;/p&gt;
&lt;p&gt;However, there is one nice trick you could do - and in fact it works really well! Let&amp;#39;s create a class that inherits from CssLink:&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;using System;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using Microsoft.SharePoint.WebControls;&lt;br /&gt;using Microsoft.SharePoint;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;namespace MichaelHofer.SharePoint.PublishingEnhancements&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class EnhancedCssLink : CssLink&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public EnhancedCssLink() : base() { }&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Now override the render method and do the &amp;quot;magic&amp;quot;: Let the base class render its content, split the rendered &amp;quot;&amp;lt;link&amp;gt;&amp;quot; tags (they are separated by a line-break) and put the last element (= always core.css) on top. But this is not all, you could also do some more stuff. Example? Why not skip rendering of core.css when the current user is an anonymous user who looks at your internet page in &amp;quot;view-only&amp;quot; mode? In these cases, you won&amp;#39;t need the core.css most probably... So why not take the overhead away? See &lt;a class="" href="http://www.ie-soft.de/blog/PermaLink,guid,968b0588-f306-467b-be51-54f7a8f2079d.aspx" target="_blank"&gt;this nice blog&lt;/a&gt; post for details!&lt;/p&gt;
&lt;p&gt;Anyway, back to business, this is the override of the &amp;quot;Render&amp;quot; method:&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected override void Render(System.Web.UI.HtmlTextWriter output)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Let base render the stylesheets&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StringWriter sw = new StringWriter();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.Render(new HtmlTextWriter(sw));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string renderedOutput = originalSw.ToString();&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Split the styleSheets into an array&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string[] styleSheets = renderedOutput.Split(new char[] { &amp;#39;\n&amp;#39; }, StringSplitOptions.RemoveEmptyEntries);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (styleSheets.Length == 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output.Write(renderedOutput);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string[] reorderedStyleSheets = new string[styleSheets.Length];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 1; i &amp;lt; styleSheets.Length; i++)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reorderedStyleSheets&lt;img src="http://www.sharepointblogs.com/emoticons/emotion-55.gif" alt="Idea" /&gt; = styleSheets[i - 1] + &amp;quot;\n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // core.css is always the last stylesheet --&amp;gt; put it in front!&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reorderedStyleSheets[0] = styleSheets[styleSheets.Length - 1] + &amp;quot;\n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output.Write(string.Concat(reorderedStyleSheets));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s all! Now compile and deploy (put to GAC and register as safe control, or build a&amp;nbsp;SharePoint solution; see my previous posts for details).&lt;/p&gt;
&lt;p&gt;In your master&amp;nbsp;page, declare your assembly. Example:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="1"&gt;&amp;lt;%@ Register Tagprefix=&amp;quot;PublishingEnhancements&amp;quot; Namespace=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements&amp;quot; Assembly=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements, Version=1.1.0.0, Culture=neutral, PublicKeyToken=7ce575c89ea427a4&amp;quot; %&amp;gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And instead of &amp;nbsp;&amp;lt;SharePoint:CssLink&amp;gt; use now your own web control. Example:&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;lt;PublishingEnhancements:EnhancedCssLink runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Here you go, all problems with core.css solved, this is what&amp;nbsp;you&amp;#39;ll get rendered:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="1"&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;&amp;nbsp;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/_layouts/1033/styles/core.css?rev=5msmprmeONfN6lJ3wtbAlA%3D%3D&amp;quot;/&amp;gt;&lt;/font&gt;&lt;br /&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/_layouts/1033/styles/controls.css?rev=EhwiQKSLiI%2F4dGDs6DyUdQ%3D%3D&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/_layouts/1033/styles/HtmlEditorCustomStyles.css?rev=8SKxtNx33FmoDhbbfB27UA%3D%3D&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/_layouts/1033/styles/HtmlEditorTableFormats.css?rev=guYGdUBUxQit03E2jhSdvA%3D%3D&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/Style%20Library/schleuni.css&amp;quot;/&amp;gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=2973" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/michael/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/WCM/default.aspx">WCM</category></item><item><title>Creating custom 404 and landing pages (easy to remember URLs that are redirected) in SharePoint</title><link>http://www.sharepointblogs.com/michael/archive/2007/07/12/creating-custom-404-and-landing-pages-easy-to-remember-urls-that-are-redirected-in-sharepoint.aspx</link><pubDate>Thu, 12 Jul 2007 13:44:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:2882</guid><dc:creator>mhofer1976</dc:creator><slash:comments>12</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/michael/rsscomments.aspx?PostID=2882</wfw:commentRss><comments>http://www.sharepointblogs.com/michael/archive/2007/07/12/creating-custom-404-and-landing-pages-easy-to-remember-urls-that-are-redirected-in-sharepoint.aspx#comments</comments><description>&lt;p&gt;This post is about how to create custom landing pages (&lt;a href="http://www.mysite.com/products"&gt;www.mysite.com/products&lt;/a&gt; or &lt;a href="http://www.mysite.com/newsletter"&gt;www.mysite.com/newsletter&lt;/a&gt;) that directs the visitor through and easy to remember URL to any page&amp;nbsp; in your deep site hierarchy. It also contains the approach how to create custom 404 &amp;quot;Page not found&amp;quot; pages.&lt;/p&gt;
&lt;p&gt;In this bost, I&amp;#39;ll only explain you the concepts, since I don&amp;#39;t really know if I get to code this within a reasonable timeframe. Next week, I&amp;#39;ll start at Microsoft, so I&amp;#39;m not sure to have plenty of time for trying things out in the next weeks...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;OK, what are we talking about: SharePoint URLs get constructed today a lot better than before. However, it is still not easily possible to create so called &amp;quot;landing pages&amp;quot;. These are mostly just entry points that let a visitor easily find its content. Marketing campaigns can print easy to remember URLs on their advertisements etc. Need some examples? OK, here we go:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.mycompany.com/winthis"&gt;www.mycompany.com/winthis&lt;/a&gt; -- leads to --&amp;gt; &lt;a href="http://www.mycompany.com/marketing/campaigns/summer07/signup.aspx"&gt;www.mycompany.com/marketing/campaigns/summer07/signup.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mycompany.com/subscribe"&gt;www.mycompany.com/subscribe&lt;/a&gt; -- leads to --&amp;gt; &lt;a href="http://www.mycompany.com/salesandmarketing/ebusiness/newsletters/english/signup.aspx"&gt;www.mycompany.com/salesandmarketing/ebusiness/newsletters/english/signup.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;How should we do this? If you enter such an URL in MOSS you&amp;#39;ll get a 404 error. Of course, because this pages do not exists. You couldn&amp;#39;t work with Redirect Pages either because they would be located in the &amp;quot;Pages/&amp;quot; section of any site.&lt;/p&gt;
&lt;p&gt;Here is now my concept to implement this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Customize the 404 landing page (I follow &lt;a class="" href="http://blogs.msdn.com/jingmeili/archive/2007/04/08/how-to-create-your-own-custom-404-error-page-and-handle-redirect-in-sharepoint-2007-moss.aspx" target="_blank"&gt;Jingmei&amp;#39;s post&lt;/a&gt;): Create your &amp;quot;custom404.html&amp;quot; page. It must be a HTML page that redirects the requsts, cannot be an ASPX page!&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Create a custom &amp;quot;customRedirect.aspx&amp;quot; in the layouts section and implement code:&lt;/div&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Lookup a special list in SharePoint &amp;quot;Landing Pages&amp;quot; using the &amp;quot;oldUrl&amp;quot; provided through the QueryString. The list contains a list of Landing Urls (&amp;quot;/newsletter&amp;quot;) and the real URL (&amp;quot;&lt;a href="http://www.mycompany.com/salesandmarketing/ebusiness/newsletters/english/signup.aspx"&gt;www.mycompany.com/salesandmarketing/ebusiness/newsletters/english/signup.aspx&lt;/a&gt;&amp;quot;) if you find a match, redirect the request to this page (use .NET Reflector how Microsoft does this). If you find no landing page redirect, I would redirect to a hidden publishing page on the root of your site that displays a fully branded 404-message.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Strong name the dll, create a feature and solutioni for deployment etc. For testing, it is enough to put the ASPX in the _layouts folder and the DLL in GAC.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;
&lt;div&gt;Some thoughts&lt;/div&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;After reflecting a bit, I think it is only necessary to create one &amp;quot;Landing Pages Redirects&amp;quot; library at the root of your site. URLs tipically should be as short and &amp;quot;human readable&amp;quot; as possible.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;With this approach, you have a very robust 404-handling implemented. Do you need additional logic? Just implement it in the already created ASPX-logic.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;
&lt;p&gt;If I get to it, I&amp;#39;ll implement this scenario and create an easy to deploy SharePoint solution out of it. I think this could be interesting to add as a feature to any internet site.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If you are interested in such a WSP solution&amp;nbsp;download&lt;/strong&gt; as well as the controls described in my posts &amp;quot;Building professional websites using MOSS 2007&amp;quot;, basically custom MetaTags and PageTitles, &lt;strong&gt;please leave a comment&lt;/strong&gt;. &lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=2882" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/michael/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/WCM/default.aspx">WCM</category></item><item><title>Building professional internet sites using MOSS 2007 - Page Titles (Part 3)</title><link>http://www.sharepointblogs.com/michael/archive/2007/07/08/building-professional-internet-sites-using-moss-2007-page-titles-part-3.aspx</link><pubDate>Sun, 08 Jul 2007 12:35:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:2767</guid><dc:creator>mhofer1976</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/michael/rsscomments.aspx?PostID=2767</wfw:commentRss><comments>http://www.sharepointblogs.com/michael/archive/2007/07/08/building-professional-internet-sites-using-moss-2007-page-titles-part-3.aspx#comments</comments><description>&lt;p&gt;This post is how to build composite page titles using an enhanced FieldValue WebControl.&lt;/p&gt;
&lt;p&gt;Page Titles&amp;nbsp;are very important for&amp;nbsp;internet sites since more and more search engines rank pages higher that contain (parts of) the search phrase in the page title. That&amp;#39;s why it makes sense to show keywords of your site in your page title - together with the actual location and maybe even the company name. This is what I would call a &amp;quot;composite page title&amp;quot;.&lt;/p&gt;
&lt;p&gt;Example? See &lt;a href="http://www.schleuniger.com/DesktopDefault.aspx/tabid-44/74_read-1590/"&gt;http://www.schleuniger.com/DesktopDefault.aspx/tabid-44/74_read-1590/&lt;/a&gt;&amp;nbsp;from site which I&amp;#39;ve built some years ago (yes, I know it was not built using MOSS, but the business case is the same).&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;lt;title&amp;gt;PowerStrip 9500 BF Automatic wire cutting and stripping machine, cut, strip, wire stripping, coaxial cable stripping, automatic&amp;lt;/title&amp;gt;&lt;/em&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The title is built using the following pattern: &amp;lt;current location&amp;gt; &amp;lt;product related keywords (same for all products). If you check the other pages you&amp;#39;ll find out that not all pages have these composite page titles - it is up to the editor to add them or not, but the &amp;lt;current location&amp;gt; part is of course always present.&lt;/p&gt;
&lt;p&gt;I was thinking about how to realize this with MOSS. It is basically a very easy scenario, just add some &amp;quot;FieldValue&amp;quot; web controls in your page layout and that&amp;#39;s it. However, I want things to be more &amp;quot;scalable&amp;quot;. I want to be able to build composite page titles that do have separators, thus a &amp;quot;suffiix&amp;quot; or a &amp;quot;prefix&amp;quot;. I even want to be able to provide a default if one part of the page title pattern does not contain a value (to add some default keywords or whatever). Now this is a little (tiny) bit more complicated.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;u&gt;Creating the control&lt;/u&gt;&lt;/font&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve created a new WebControl that inherits from BaseFieldControl:&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;using System;&lt;br /&gt;using Microsoft.SharePoint.WebControls;&lt;br /&gt;using System.Security.Permissions;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using Microsoft.SharePoint.Security;&lt;br /&gt;using System.ComponentModel;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;namespace MichaelHofer.SharePoint.PublishingEnhancements&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [SharePointPermission(SecurityAction.InheritanceDemand, ObjectModel = true), &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SharePointPermission(SecurityAction.LinkDemand, ObjectModel = true), &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class EnhancedFieldValue : BaseFieldControl&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public EnhancedFieldValue()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.DisableInputFieldLabel = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.ControlMode = SPControlMode.Display;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;ve added the properties I want to be able to configure when I use the control in my page layout or master page:&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected string m_Prefix = default(string);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Bindable(true), Category(&amp;quot;Data&amp;quot;), DefaultValue(&amp;quot;&amp;quot;), Description(&amp;quot;Prefix applied before the field&amp;#39;s value.&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Prefix&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return m_Prefix; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { m_Prefix = value; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected string m_Suffix = default(string);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Bindable(true), Category(&amp;quot;Data&amp;quot;), DefaultValue(&amp;quot;&amp;quot;), Description(&amp;quot;Suffix applied after field&amp;#39;s value.&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Suffix&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return m_Suffix; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { m_Suffix = value; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected string m_Default = default(string);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //[Bindable(true), Category(&amp;quot;Data&amp;quot;), DefaultValue(&amp;quot;&amp;quot;), Description(&amp;quot;Default applied if field value is empty.&amp;quot;)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Default&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return m_Default; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { m_Default = value; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;At last, I implement my own RednerFieldForDisplay-method:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;font size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [SharePointPermission(SecurityAction.Demand, ObjectModel = true)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected override void RenderFieldForDisplay(HtmlTextWriter output)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string fieldValue = base.Field.GetFieldValueAsHtml(this.ItemFieldValue);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (string.IsNullOrEmpty(fieldValue) &amp;amp;&amp;amp; !string.IsNullOrEmpty(m_Default))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldValue = m_Default;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!string.IsNullOrEmpty(fieldValue))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output.Write(string.Format(&amp;quot;{0}{1}{2}&amp;quot;, m_Prefix, fieldValue, m_Suffix));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If there is no value given for the Field, the default will be applied. If even then&amp;nbsp;there is nothing to write,&amp;nbsp;prefix and suffix are not rendered, otherwise, if present, the value is rendered with the corresponding&amp;nbsp;pre- and/or suffix.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;&lt;font size="3"&gt;Deyploment:&lt;/font&gt;&lt;/strong&gt;&lt;/u&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I won&amp;#39;t go into the details of deploment&amp;nbsp;in this post, everything is described in detail in my former post Part 2 (see below)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="3"&gt;Creating composite page titles&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In your page layout/master page editor (in my case SharePoint Designer), make sure that you have a reference to the assembly containing the EnhancedFieldValue control (see also my last post details). For some reason, SPD doesn&amp;#39;t list the control&amp;nbsp;in&amp;nbsp;the &amp;quot;Web Controls (Sharepoint)&amp;quot; section. However, when you start typing the Prefix of the Assembly, it will show you the present controls. Now go ahead and create your composite page title. Example:&lt;/p&gt;
&lt;p&gt;&amp;lt;%@ Register Tagprefix=&amp;quot;PublishingEnhancements&amp;quot; Namespace=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements&amp;quot; Assembly=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements, Version=1.1.0.0, Culture=neutral, PublicKeyToken=7ce575c89ea427a4&amp;quot; %&amp;gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:Content ContentPlaceholderID=&amp;quot;PlaceHolderPageTitle&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;SharePointWebControls:FieldValue id=&amp;quot;PageTitle&amp;quot; FieldName=&amp;quot;Title&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;lt;PublishingEnhancements:EnhancedFieldValue runat=&amp;quot;server&amp;quot; id=&amp;quot;pageTitleExtensions&amp;quot; FieldName=&amp;quot;Title_x0020_Extension&amp;quot; Prefix=&amp;quot; - &amp;quot; Suffix=&amp;quot; - Copyright 2007, Michael Hofer&amp;quot; Default=&amp;quot;MOSS, WSS, SharePoint, Office&amp;quot; /&amp;gt;&lt;br /&gt;&lt;/strong&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;br /&gt;I&amp;#39;m using a custom field &amp;quot;Title Extension&amp;quot; which an editor can fill within the &amp;quot;Edit Mode Panel&amp;quot; for each field. If the field is blank or for some reason not present, the default is rendered, together with the specified pre- and suffix. The page title is then (no value given) rendered as:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enhanced Page Titles - MOSS, WSS, SharePoint, Office - Copyright 2007, Michael Hofer&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I think that justifies the small development that can be easily deployed using a clean and managable SharePoint Solution!&lt;/p&gt;
&lt;p&gt;The next thing I will look at a little bit closer is how to easily (and easy to maintain!) landing pages for a MOSS site. What I mean is:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.myinternetsite.com/products"&gt;www.myinternetsite.com/products&lt;/a&gt; will redirect to &lt;a href="http://www.myinternetsite.com/products/pages/default.aspx"&gt;www.myinternetsite.com/products/pages/default.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.myinternetsite.com/newsletter"&gt;www.myinternetsite.com/newsletter&lt;/a&gt; will redirect to &lt;a href="http://www.myinternetsite.com/signup/default.aspx"&gt;www.myinternetsite.com/signup/default.aspx&lt;/a&gt; etc.&lt;/p&gt;
&lt;p&gt;Please read also &lt;a class="" href="http://www.sharepointblogs.com/michael/archive/2007/07/04/building-professional-internet-sites-using-moss-2007-metatags-part-1.aspx" target="_blank"&gt;Part&lt;/a&gt; 1 &amp;amp; &lt;a class="" href="http://www.sharepointblogs.com/michael/archive/2007/07/07/building-professional-internet-sites-using-moss-2007-metatags-part-2.aspx" target="_blank"&gt;Part 2&lt;/a&gt; of this series who are about building dynamic MetaTags.&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=2767" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/michael/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/WCM/default.aspx">WCM</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Web+Controls/default.aspx">Web Controls</category></item><item><title>Building professional internet sites using MOSS 2007 - Metatags (Part 2)</title><link>http://www.sharepointblogs.com/michael/archive/2007/07/07/building-professional-internet-sites-using-moss-2007-metatags-part-2.aspx</link><pubDate>Sat, 07 Jul 2007 19:20:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:2756</guid><dc:creator>mhofer1976</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/michael/rsscomments.aspx?PostID=2756</wfw:commentRss><comments>http://www.sharepointblogs.com/michael/archive/2007/07/07/building-professional-internet-sites-using-moss-2007-metatags-part-2.aspx#comments</comments><description>&lt;p&gt;(please read the Part 1 &lt;a class="" href="http://www.sharepointblogs.com/michael/archive/2007/07/04/building-professional-internet-sites-using-moss-2007-metatags-part-1.aspx" target="_blank"&gt;here&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;In the second part of building a professional set of Metatags for a public-facing MOSS site, I&amp;#39;m going to explain how to use the &amp;quot;MetaTag&amp;quot; WebControl in a MOSS environment.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;&lt;font size="3"&gt;Deployment&lt;/font&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;There are two ways how to deploy your assembly, in both cases, you need to Strong-Name it if you want to deploy it to the GAC, which I normally do.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Manual deployment&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is the fastest deplyoment, however only suitable for development, staging or maybe environments with only a single frontend web-server. Still, you should prefer the SharePoint solution deployment. All you have to do here is to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Put your assembly into the GAC&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Add your WebControl(s) to the SaveControl section in the web.config file of all SharePoint webapplications where you want to add enhanced MetaTag support (BTW: did you backup it before doing changes!?):&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;font size="1"&gt;&amp;lt;SafeControl Assembly=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7ce575c89ea427a4&amp;quot; Namespace=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements&amp;quot; TypeName=&amp;quot;*&amp;quot; Safe=&amp;quot;True&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;That&amp;#39;s it...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;SharePoint Solution Deployment&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For this deployment method, you create a WSP package that is then added and deployed to SharePoint webapplications using STSADM.exe. This is a pretty common scenario and you&amp;#39;ll find plenty of information on how to create and deploy WSP packages so I won&amp;#39;t go into details here. Personally, I used the way that I&amp;#39;ve documented &lt;a class="" href="http://www.sharepointblogs.com/michael/archive/2007/07/06/sharepoint-solution-deployment-handy-post-build-events.aspx" target="_blank"&gt;here&lt;/a&gt;. Using the PostBuild Commands, the SharePoint Solution containing the WebControl(s) is installed and deployed/installed to my SharePoint web-applications. Nothing more to do at all...&lt;/p&gt;
&lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;&lt;u&gt;Adding MetaTags to your MOSS site&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;I use SharePoint designer to implement the MetaTags, but feel free to use any other tool you might prefer. This is what I would suggest to do:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;In your MasterPage(s) Header, add&lt;/div&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;The static metadata&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;A placeholder that will contain the page-specific metadata&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Optionally dynamic metadata using the &amp;quot;MetaTag&amp;quot; WebControl that you fill somehow (with code, other placeholders etc.)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Example:&lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;asp:ContentPlaceHolder runat=&amp;quot;server&amp;quot; id=&amp;quot;head&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;title&amp;gt;&amp;lt;asp:ContentPlaceHolder id=&amp;quot;PlaceHolderPageTitle&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/asp:ContentPlaceHolder&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- METATAGS --&amp;gt;&lt;br /&gt;&amp;lt;!-- Static Metatags !--&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;author&amp;quot; content=&amp;quot;Schleuniger&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;Classification&amp;quot; content=&amp;quot;Business to Business, B2B, Manufacturing, Industrial Supplies, Machinery and Tools, Machine Tools, Cutting Tools, Wire Strippers&amp;quot; /&amp;gt;&amp;lt;meta http-equiv=&amp;quot;Content-Language&amp;quot; content=&amp;quot;en&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;copyright&amp;quot; content=&amp;quot;2006, MyCompany&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;distribution&amp;quot; content=&amp;quot;global&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;geo.region&amp;quot; content=&amp;quot;CH&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;googlebot&amp;quot; content=&amp;quot;index, follow&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;language&amp;quot; content=&amp;quot;English&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;rating&amp;quot; content=&amp;quot;safe for kids&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;SharePoint:RobotsMetaTag runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;&lt;strong&gt;&amp;lt;asp:ContentPlaceHolder runat=&amp;quot;server&amp;quot; id=&amp;quot;PlaceHolderPageMetaTags&amp;quot;&amp;gt;&amp;lt;/asp:ContentPlaceHolder&amp;gt;&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;
&lt;div&gt;In you PageLayout-Templates you may go ahead now and fill the &amp;quot;PlaceHolderPageMetaTags&amp;quot; content placeholder with your dynamic metatags.&lt;/div&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;First of all, notice that the &amp;quot;MetaTag&amp;quot; Controls is listed in the &amp;quot;Server Controls (SharePoint)&amp;quot; list of web controls. Just drag and drop it onto your pagelayout.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Register the control like this, since SPD doesn&amp;#39;t seem to do it automatically:&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;lt;%@ Register Tagprefix=&amp;quot;PublishingEnhancements&amp;quot; Namespace=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements&amp;quot; Assembly=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7ce575c89ea427a4&amp;quot; %&amp;gt;&lt;br /&gt;&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Example of how your &amp;quot;PlaceHolderPageMetaTags&amp;quot;&amp;nbsp;section could&amp;nbsp;look like:&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;lt;asp:Content ContentPlaceHolderID=&amp;quot;PlaceHolderPageMetaTags&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;PublishingEnhancements:MetaTag runat=&amp;quot;server&amp;quot; name=&amp;quot;title&amp;quot; id=&amp;quot;titleMetaTag&amp;quot;&amp;gt;&amp;lt;SharePointWebControls:FieldValue id=&amp;quot;titleTag&amp;quot; FieldName=&amp;quot;Title&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;&amp;lt;/PublishingEnhancements:MetaTag&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;PublishingEnhancements:MetaTag runat=&amp;quot;server&amp;quot; name=&amp;quot;description&amp;quot; id=&amp;quot;descriptionMetaTag&amp;quot;&amp;gt;&amp;lt;SharePointWebControls:FieldValue id=&amp;quot;commentsTag&amp;quot; FieldName=&amp;quot;Comments&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;&amp;lt;/PublishingEnhancements:MetaTag&amp;gt;&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;/em&gt;&lt;/font&gt;&lt;br /&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Important: Write your metatags all on one line, don&amp;#39;t use any linebreaks or whitespaces since these will also be rendered later (well, I guess I could amend this&amp;nbsp;for the future, but for the moment being...)&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;If not&amp;nbsp;done yet, make sure that you have the corresponding input fields to enter the needed metadata that will be displayed in your MetaTags.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;
&lt;p&gt;That&amp;#39;s it. When you load your page the next time, you will find that all the metatags&amp;nbsp;you&amp;#39;ve defined are there and filled&amp;nbsp;dynamically!&lt;/p&gt;
&lt;p&gt;I think this solution is pretty powerful since it is not limited to&amp;nbsp;fields of a certain content type nor does it have any other restriction. You can fill the metatags by code, by using the available publishing controls Microsoft provides but create also your own etc.&lt;/p&gt;
&lt;p&gt;Just for completeness, I provide you herewith also a list of all the metatags that I find you should&amp;nbsp;provide for your site:&lt;/p&gt;
&lt;p&gt;&amp;lt;meta name=&amp;quot;author&amp;quot; content=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;Classification&amp;quot; content=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;meta http-equiv=&amp;quot;Content-Language&amp;quot; content=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;copyright&amp;quot; content=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;distribution&amp;quot; content=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;geo.region&amp;quot; content=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;googlebot&amp;quot; content=&amp;quot;index, follow&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;language&amp;quot; content=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;rating&amp;quot; content=&amp;quot;safe for kids&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;ROBOTS&amp;quot; content=&amp;quot;all=index, follow&amp;quot;&amp;gt; &amp;lt;!-- you may also use the SharePoint webcontrol --&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;abstract&amp;quot; content=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;description&amp;quot; content=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;keywords&amp;quot; content=&amp;quot;&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=2756" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/michael/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/WCM/default.aspx">WCM</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Web+Controls/default.aspx">Web Controls</category></item><item><title>SharePoint Solution Deployment: Handy Post-Build Events</title><link>http://www.sharepointblogs.com/michael/archive/2007/07/06/sharepoint-solution-deployment-handy-post-build-events.aspx</link><pubDate>Thu, 05 Jul 2007 22:39:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:2716</guid><dc:creator>mhofer1976</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/michael/rsscomments.aspx?PostID=2716</wfw:commentRss><comments>http://www.sharepointblogs.com/michael/archive/2007/07/06/sharepoint-solution-deployment-handy-post-build-events.aspx#comments</comments><description>&lt;p&gt;Having built some nice additional SharePoint WebControls, I want them to be deployed as a SharePoint solution, packed into a WSP file - and of course automated. I was very impressed how easy it is, to deploy Workflows based on the MOSS SDK Visual Studio Templates for Workflows. They use an own file structue in the project (&amp;quot;\DeploymentFiles&amp;quot;) which consists of the needed .xml &amp;amp; .ddf files and also a .bat file that is used in a post-build command. This .bat is very flexible and does all the magic to deploy the solution and any features contained in it (that is the workflow here).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;It is very easy to adopt this to any SharePoint solution. In my case, I just need to deploy a DLL into the GAC and mark it as safe control. However, it is a piece of cake to adopt the files to deploy any kind of feature too. Also, I want to deploy only when I build in &amp;quot;Release&amp;quot; mode, and only if in the post-build command I&amp;#39;ve set the &amp;quot;DEPLOY&amp;quot; option - since my post-build script performs also an IISRESET which costs a lot of time and resources...&lt;/p&gt;
&lt;p&gt;OK, here we go:&lt;/p&gt;
&lt;p&gt;Create a sub-folder in the project called &amp;quot;DeploymentFiles&amp;quot;.&lt;/p&gt;
&lt;p&gt;Add the &amp;quot;manifest.xml&amp;quot; file. This is very simple in my case:&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;&lt;br /&gt;&amp;lt;Solution xmlns=&amp;quot;&lt;/em&gt;&lt;/font&gt;&lt;a href="http://schemas.microsoft.com/sharepoint/"&gt;&lt;font size="1"&gt;&lt;em&gt;http://schemas.microsoft.com/sharepoint/&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;quot; SolutionId=&amp;quot;{91320A34-AC12-4ffa-8076-2ECFBD7BA686}&amp;quot; &amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;Assemblies&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Assembly DeploymentTarget=&amp;quot;GlobalAssemblyCache&amp;quot; Location=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements.dll&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SafeControls&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SafeControl Assembly=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7ce575c89ea427a4&amp;quot; Namespace=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements&amp;quot; TypeName=&amp;quot;*&amp;quot; Safe=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/SafeControls&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Assembly&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/Assemblies&amp;gt;&lt;br /&gt;&amp;lt;/Solution&amp;gt;&lt;/em&gt;&lt;/font&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Add the &amp;quot;wsp_structure.ddf&amp;quot; file:&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;;This file is for WSP CAB Generation&lt;br /&gt;;A WSS or in this case MOSS solution file is essentially a .cab file, &lt;br /&gt;;use the makecab.exe tool to create the solution package. &lt;br /&gt;;The makecab.exe tool takes a pointer to a .ddf file, &lt;br /&gt;;which describes the structure of the .cab file.&amp;nbsp; &lt;br /&gt;;The format of a .ddf file is basically that&lt;br /&gt;;you declare a standard header and &lt;br /&gt;;then enumerate, one file per line, the set of files by where they live on disk, &lt;br /&gt;;separated by where they should live in the .cab file&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;.OPTION EXPLICIT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; Generate errors &lt;br /&gt;.Set CabinetNameTemplate=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements.wsp&amp;quot;&lt;br /&gt;.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory&lt;br /&gt;.Set CompressionType=MSZIP;** All files are compressed in cabinet files&lt;br /&gt;.Set UniqueFiles=&amp;quot;ON&amp;quot;&lt;br /&gt;.Set Cabinet=on&lt;br /&gt;.Set DiskDirectory1=&amp;quot;Package&amp;quot;&lt;br /&gt;;All file reference should be from the project root&lt;br /&gt;;Files to place into the CAB Root&lt;br /&gt;..\..\DeploymentFiles\manifest.xml&lt;br /&gt;MichaelHofer.SharePoint.PublishingEnhancements.dll&lt;/em&gt;&lt;/font&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Add the &amp;quot;PostBuildActions.bat&amp;quot; file. This is a cut-together version of the that is used with workflows:&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;em&gt;@ECHO OFF&lt;br /&gt;:: -----------------------------------------------&lt;br /&gt;::&lt;br /&gt;:: --------------------------&lt;br /&gt;::&amp;nbsp; Post build actions (VS):&lt;br /&gt;:: --------------------------&lt;br /&gt;:: This batch file is run by VS after the user builds the project (F6)&lt;br /&gt;:: It installs a simple solution package to sharepoint. No feature is installed or activated.&lt;br /&gt;:: Adapted by Michael Hofer, originally, this script is used with SharePoint Workflow VS Templates.&lt;br /&gt;:: By default, it skips all deployment steps so that users can build without deploying. &lt;br /&gt;:: Users can use the DEPLOY parameter to install the assembly the GAC and activate &lt;br /&gt;:: stsadm deployment commands.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: --------------------------&lt;br /&gt;::&amp;nbsp; How to deploy:&lt;br /&gt;:: --------------------------&lt;br /&gt;::&amp;nbsp;&amp;nbsp; 1. Sign the assembly&lt;br /&gt;::&amp;nbsp; 2. Use &amp;quot;Release&amp;quot; mode for compilation&lt;br /&gt;::&amp;nbsp;&amp;nbsp; 3. Change &amp;quot;NODEPLOY&amp;quot; to &amp;quot;DEPLOY&amp;quot; in the post build events (in project properties, &lt;br /&gt;::&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; see &amp;quot;Build Events&amp;quot;-&amp;gt;&amp;quot;Post-build event command line&amp;quot;)&lt;br /&gt;::&amp;nbsp; 4. Make sure that the web application urls are set correctly&amp;nbsp; (Ln 88 &amp;amp; 96)&lt;br /&gt;::&amp;nbsp;&amp;nbsp; 5. Press F6 or go to Build-&amp;gt;(Re)Build Solution&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: --------------------------&lt;br /&gt;::&amp;nbsp; Usage:&lt;br /&gt;:: --------------------------&lt;br /&gt;:: - Deployment disabled:&amp;nbsp; call &amp;quot;$(ProjectDir)\DeploymentFiles\PostBuildActions.bat&amp;quot; &amp;quot;$(ConfigurationName)&amp;quot; &amp;quot;$(ProjectDir)&amp;quot; &amp;quot;$(ProjectName)&amp;quot; &amp;quot;$(TargetDir)&amp;quot; &amp;quot;$(TargetName)&amp;quot; NODEPLOY&lt;br /&gt;:: - Deployment&amp;nbsp; enabled:&amp;nbsp; call &amp;quot;$(ProjectDir)\DeploymentFiles\PostBuildActions.bat&amp;quot; &amp;quot;$(ConfigurationName)&amp;quot; &amp;quot;$(ProjectDir)&amp;quot; &amp;quot;$(ProjectName)&amp;quot; &amp;quot;$(TargetDir)&amp;quot; &amp;quot;$(TargetName)&amp;quot; DEPLOY&lt;br /&gt;:: -----------------------------------------------&lt;br /&gt;:: &lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;ECHO.&lt;br /&gt;ECHO Running post build actions.&lt;br /&gt;ECHO.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: e.g.&amp;quot;Debug&amp;quot; or &amp;quot;Release&amp;quot;&lt;br /&gt;SET CONFIG=%1&lt;br /&gt;SET CONFIG=%CONFIG:~1,-1%&lt;br /&gt;ECHO CONFIG: %CONFIG%&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: constant placeholder for branch logic comparison; always &amp;quot;DEPLOY&amp;quot;&lt;br /&gt;SET CONFIGVALUE=Release&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;IF NOT %CONFIG%==%CONFIGVALUE% (ECHO Not in Release mode, skipping deployment &amp;amp; GOTO QUIT)&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: e.g. &amp;quot;C:\Projects\MySolution&amp;quot;&lt;br /&gt;SET PROJECTDIR=%2&lt;br /&gt;SET PROJECTDIR=%PROJECTDIR:~1,-2%&lt;br /&gt;ECHO PROJECTDIR: %PROJECTDIR%&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: e.g. &amp;quot;C:\Projects\MySolution\DeploymentFiles&amp;quot;&lt;br /&gt;SET DEPLOYMENTDIR=%PROJECTDIR%\DeploymentFiles&lt;br /&gt;ECHO DEPLOYMENTDIR: %DEPLOYMENTDIR%&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: e.g. &amp;quot;MySolution&amp;quot;&lt;br /&gt;SET PROJECTNAME=%3&lt;br /&gt;SET PROJECTNAME=%PROJECTNAME:~1,-1%&lt;br /&gt;ECHO PROJECTNAME: %PROJECTNAME%&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: e.g. &amp;quot;C:\Projects\MySolution\bin\Debug&amp;quot;&lt;br /&gt;SET TARGETDIR=%4&lt;br /&gt;SET TARGETDIR=%TARGETDIR:~1,-2%&lt;br /&gt;ECHO TARGETDIR: %TARGETDIR%&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: e.g. &amp;quot;MySolution&amp;quot;(.dll)&lt;br /&gt;SET TARGETNAME=%5&lt;br /&gt;SET TARGETNAME=%TARGETNAME:~1,-1%&lt;br /&gt;ECHO TARGETNAME: %TARGETNAME%&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: cmd parameter, e.g. &amp;quot;DEPLOY&amp;quot; or &amp;quot;NODEPLOY&amp;quot;&lt;br /&gt;SET DEPLOY=%6&lt;br /&gt;ECHO DEPLOY: %DEPLOY%&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: constant placeholder for branch logic comparison; always &amp;quot;DEPLOY&amp;quot;&lt;br /&gt;SET DEPLOYVALUE=DEPLOY&lt;br /&gt;ECHO DEPLOYVALUE: %DEPLOYVALUE%&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;IF NOT %DEPLOY%==%DEPLOYVALUE% (ECHO Skipping deployment &amp;amp; GOTO QUIT)&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;IF EXIST &amp;quot;%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE&amp;quot; (SET STSADM=&amp;quot;%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE&amp;quot;) ELSE (ECHO STSAMD.EXE could not be found! &amp;amp; GOTO QUIT)&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;ECHO.&lt;br /&gt;ECHO Generating %PROJECTNAME%.wsp ...&lt;br /&gt;ECHO.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;makecab /f &amp;quot;%DEPLOYMENTDIR%\wsp_structure.ddf&amp;quot;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;ECHO.&lt;br /&gt;ECHO Retracting and deleting solution (if it exists)...&lt;br /&gt;ECHO.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;%STSADM% -o retractsolution&amp;nbsp;&amp;nbsp;&amp;nbsp; -name %PROJECTNAME%.wsp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -url &lt;/em&gt;&lt;/font&gt;&lt;a href="http://localhost:8081/"&gt;&lt;font size="1"&gt;&lt;em&gt;http://localhost:8081&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -local&lt;br /&gt;%STSADM% -o deletesolution&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -name %PROJECTNAME%.wsp&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;ECHO.&lt;br /&gt;ECHO Adding and deploying the solution...&lt;br /&gt;ECHO.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;%STSADM% -o addsolution&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -filename &amp;quot;Package\%PROJECTNAME%.wsp&amp;quot;&lt;br /&gt;%STSADM% -o deploysolution&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -name %PROJECTNAME%.wsp&amp;nbsp;&amp;nbsp;&amp;nbsp; -url &lt;/em&gt;&lt;/font&gt;&lt;a href="http://localhost:8081/"&gt;&lt;font size="1"&gt;&lt;em&gt;http://localhost:8081&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font size="1"&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -local&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -allowGacDeployment&amp;nbsp; -force&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;GOTO FINISH&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="1"&gt;&lt;/font&gt;&lt;/em&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;em&gt;:: -----------------------------------------------&lt;br /&gt;::&lt;br /&gt;:FINISH&lt;br /&gt;:: &lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;ECHO Doing an iisreset...&lt;br /&gt;ECHO.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;CALL iisreset&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: -----------------------------------------------&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;&lt;/em&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: -----------------------------------------------&lt;br /&gt;::&lt;br /&gt;:QUIT&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;ECHO.&lt;br /&gt;ECHO Done&lt;br /&gt;ECHO.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;:: &lt;br /&gt;:: -----------------------------------------------&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;&lt;em&gt;&lt;font size="1"&gt;&lt;/font&gt;&lt;/em&gt;
&lt;p&gt;&lt;br /&gt;Add the post-build event command (use NODEPLOY and the script doesn&amp;#39;t execute):&lt;br /&gt;&lt;em&gt;&lt;font size="1"&gt;&amp;nbsp;&lt;br /&gt;&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="1"&gt;call &amp;quot;$(ProjectDir)\DeploymentFiles\PostBuildActions.bat&amp;quot; &amp;quot;$(ConfigurationName)&amp;quot; &amp;quot;$(ProjectDir)&amp;quot; &amp;quot;$(ProjectName)&amp;quot; &amp;quot;$(TargetDir)&amp;quot; &amp;quot;$(TargetName)&amp;quot; DEPLOY&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Switching&amp;nbsp;now to &amp;quot;Release&amp;quot; build mode and press F6, the project is compiled, the WSP is generated and the solution is installed automatically. Handy, right!?&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=2716" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/michael/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Workflow/default.aspx">Workflow</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://www.sharepointblogs.com/michael/archive/tags/Development/default.aspx">Development</category></item><item><title>Building professional internet sites using MOSS 2007 - Metatags (Part 1)</title><link>http://www.sharepointblogs.com/michael/archive/2007/07/04/building-professional-internet-sites-using-moss-2007-metatags-part-1.aspx</link><pubDate>Wed, 04 Jul 2007 21:37:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:2678</guid><dc:creator>mhofer1976</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/michael/rsscomments.aspx?PostID=2678</wfw:commentRss><comments>http://www.sharepointblogs.com/michael/archive/2007/07/04/building-professional-internet-sites-using-moss-2007-metatags-part-1.aspx#comments</comments><description>&lt;p&gt;When building professional internet sites using MOSS 2007 and its WCM features, you should also think about two major things that will make your site better found when using search engines:&lt;/p&gt;&lt;p&gt;1. Self-speaking, keyword-dense page titles &lt;br /&gt;2. A full set and keyword-dense set of metatags&lt;/p&gt;&lt;p&gt;While the later is often declared as obsolete today, it still helps to describe your site and adds, if cleverly used, keyword density to your sites - which in turn again makes your site better found.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;I will start with metatags. Unfortunately, MOSS doesn&amp;#39;t really ship with a lot of webcontrols that help you to build up a good metatag system. In fact, except the RobotsMetaTag-Control, there is absolutely no Control that will facilitate automatic Metatag generation.&lt;/p&gt;&lt;p&gt;OK; what can we do about it? Let&amp;#39;s first look at the requirements. We have to types of Metatags we should consider:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&amp;quot;Static&amp;quot; Metatags: They are pretty much the same for all of your site or at least some major areas&lt;/li&gt;&lt;li&gt;&amp;quot;Dynamic&amp;quot; Metatags: They are content-specific, for example &amp;quot;keywords&amp;quot; or &amp;quot;abstract&amp;quot; etc.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;If we want to create a MetaTag Control, it should be flexible enough to handle both cases: Static Text but also dynamic text rendered using the standard SharePoint publishing web controls. Like that, we can create custom fields to store the keywords, abstracts etc.&lt;/p&gt;&lt;p&gt;Let&amp;#39;s look at it without putting the SharePoint glasses on: We need a control that renders static text or the dynamic output of a contained webcontrol as a metatag. That&amp;#39;s actually pretty easy to achieve:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Create a Class Library&lt;/li&gt;&lt;li&gt;Create a new class that inherits from WebControl&lt;br /&gt;&lt;br /&gt;&lt;i&gt;[ParseChildren(false), ToolboxData(&amp;quot;&amp;lt;{0}:MetaTag runat=\&amp;quot;server\&amp;quot;
name=\&amp;quot;\&amp;quot;&amp;gt; &amp;lt;/{0}:MetaTag&amp;gt;&amp;quot;), PersistChildren(true), &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DefaultProperty(&amp;quot;Name&amp;quot;)]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public class MetaTag : WebControl&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;/i&gt;
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;In the constructor make sure that the rendered Tag is a &amp;quot;Meta&amp;quot; Tag&lt;br /&gt;&lt;br /&gt;&lt;i&gt;public MetaTag() : base(HtmlTextWriterTag.Meta) {}&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Add a public property to store the &amp;quot;name&amp;quot;-Attribute of the metatag&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected string m_Name = &amp;quot;&amp;quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Bindable(true), Category(&amp;quot;Appearance&amp;quot;), DefaultValue(&amp;quot;&amp;quot;), Description(&amp;quot;Sets the MetaTag&amp;#39;s name attribute.&amp;quot;)]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Name&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return m_Name; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { m_Name = value; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/i&gt;
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Override the needed Rendering method. Important: Our control has no inner content. The contained controls are rendered in the &amp;quot;value&amp;quot;-Attribute&lt;br /&gt;&lt;br /&gt;&lt;i&gt;protected override void Render(HtmlTextWriter writer)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Render control only if there is a tagname specified&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!m_Name.Equals(string.Empty))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.Render(writer);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected override void AddAttributesToRender(HtmlTextWriter writer)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Write the name attribute&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writer.AddAttribute(&amp;quot;name&amp;quot;, m_Name);&lt;br /&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Write the value attribute&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StringWriter sw = new StringWriter();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.RenderContents(new HtmlTextWriter(sw));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; writer.AddAttribute(&amp;quot;value&amp;quot;, sw.ToString());&lt;br /&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // the metata does not have any other attributes that could be rendered: don&amp;#39;t call base...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected override void RenderContents(HtmlTextWriter writer)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // this control does not render any contents&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/i&gt;



&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Strong name the assembly and build it.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;To test your new control, create an ASP.NET webapplication and add the control into your head section. You may add static text or add (for example) a Literal Web Control render the content of your metatag dynamically. Here is an example:&lt;/p&gt;&lt;p&gt;&lt;i&gt;&amp;nbsp;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeBehind=&amp;quot;Default.aspx.cs&amp;quot; Inherits=&amp;quot;PublishingEnhancementsTest._Default&amp;quot; %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Assembly=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements&amp;quot; Namespace=&amp;quot;MichaelHofer.SharePoint.PublishingEnhancements&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TagPrefix=&amp;quot;cc1&amp;quot; %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; &amp;gt;&lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Untitled Page&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;cc1:MetaTag ID=&amp;quot;MetaTag1&amp;quot; runat=&amp;quot;server&amp;quot; Name=&amp;quot;author&amp;quot;&amp;gt;Michael Hofer&amp;lt;/cc1:MetaTag&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;cc1:MetaTag ID=&amp;quot;MetaTag2&amp;quot; runat=&amp;quot;server&amp;quot; Name=&amp;quot;Classification&amp;quot;&amp;gt;Business to Business, B2B, Manufacturing, Industrial Supplies, Machinery and Tools, Machine Tools, Cutting Tools, Wire Strippers&amp;lt;/cc1:MetaTag&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;cc1:MetaTag ID=&amp;quot;MetaTag3&amp;quot; runat=&amp;quot;server&amp;quot; Name=&amp;quot;keywords&amp;quot;&amp;gt;&amp;lt;asp:Literal ID=&amp;quot;keywordsLiteral&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:Literal&amp;gt;&amp;lt;/cc1:MetaTag&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;Check out the markup of this page to see the generated metatags.&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/i&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Bye the way: the Literal Controls is filled in the Page_Load event:&lt;/p&gt;&lt;p&gt;&lt;i&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keywordsLiteral.Text = &amp;quot;Our innovative automatic and semi-automatic wire processing machines are designed to cut, strip, crimp, and mark wire and cable of all types including single conductor wire, coaxial, multi-conductor, POF, flat flexible and glass fiber optic (GOF) cables&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/i&gt;&lt;br /&gt;