<?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>SPSherm.MyBlog</title><link>http://www.sharepointblogs.com/spsherm/default.aspx</link><description>Sharing points about SharePoint...</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>Search Community Toolkit</title><link>http://www.sharepointblogs.com/spsherm/archive/2008/08/14/search-community-toolkit.aspx</link><pubDate>Thu, 14 Aug 2008 16:30:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:19856</guid><dc:creator>Sherman</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=19856</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2008/08/14/search-community-toolkit.aspx#comments</comments><description>&lt;p&gt;I just &lt;a class="" href="http://sharepoint.microsoft.com/blogs/mikeg/Lists/Posts/Post.aspx?List=1b3bbb8f-4b5a-4f72-94c4-94cb80bc3866&amp;amp;ID=1182" target="_blank"&gt;read this off Michael Ganotti&amp;#39;s blog&lt;/a&gt;; wanted to post here for my own reference. Search is something that I&amp;#39;m not that close to. Good to see that there are so many useful tools/aids/samples available.&lt;/p&gt;
&lt;p&gt;From the &lt;a class="" href="http://www.codeplex.com/sct" target="_blank"&gt;project page on CodePlex&lt;/a&gt;: &lt;span id="ctl00_ctl00_Content_TabContentPanel_Content_wikiSourceLabel"&gt;&lt;em&gt;The &lt;a class="" href="http://www.codeplex.com/sct" target="_blank"&gt;Search Community Toolkit&lt;/a&gt; is comprised of a number of tools and code samples that have been contributed to enhance the Microsoft search experience (Microsoft Office SharePoint Server 2007 (MOSS) Search, Search Server 2008 and Search Server 2008 Express).&lt;/em&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;Sherman Woo
			&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=19856" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Search+CodePlex+toolkit+samples/default.aspx">Search CodePlex toolkit samples</category></item><item><title>Server Controls Case-Sensitivity in Page Layouts?</title><link>http://www.sharepointblogs.com/spsherm/archive/2008/07/27/server-controls-case-sensitivity-in-page-layouts.aspx</link><pubDate>Sun, 27 Jul 2008 18:15:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:19244</guid><dc:creator>Sherman</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=19244</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2008/07/27/server-controls-case-sensitivity-in-page-layouts.aspx#comments</comments><description>&lt;font face="Trebuchet MS" size="2"&gt;
&lt;p&gt;I came across this in late 2007, and forgot to blog about it. Just catching up, and wanting to post it for reference.&lt;/p&gt;
&lt;p&gt;While working with page layouts in MOSS, a few of use sometimes encountered a strange message when we requested the page:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font color="#ff0000"&gt;Only Content controls are allowed directly in a content page that contains Content controls.&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;d verify that there wasn&amp;#39;t anything in our page layout(s) or master page what was not consistent with ASP.NET syntax. Sure enough, everything in the page layout was sitting (properly) inside an ASP Content server control. &lt;/p&gt;
&lt;p&gt;Rather than repeating all the things we looked at to try to resolve the issue, I point you to &lt;a href="http://blog.richfinn.net/2007/08/06/StrangeResolutionPageLayoutErrorOnlyContentControlsAreAllowedDirectlyInAContentPageThatContainsContentControlsAlongWithMasterPageGalleryErrorQuotThisItemCannotBeDeletedBecauseItIsStillReferencedByOtherPagesquot.aspx" target="_blank"&gt;Rich Finn&amp;#39;s article&lt;/a&gt;, which ultimately helped me figure out what was going on (see his update at the end of the post).&lt;/p&gt;
&lt;p&gt;In a nutshell, ensure your page layout markup uses this casing for all Content web server controls:&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;&amp;lt;asp:Content … &amp;gt;&amp;lt;/asp:Content&amp;gt;&lt;/font&gt; &lt;/p&gt;
&lt;p&gt;and NOT this: &lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;&amp;lt;asp:content … &amp;gt;&amp;lt;/asp:content&amp;gt;&lt;/font&gt; &lt;/p&gt;
&lt;p&gt;Note the capital &amp;quot;Content&amp;quot; &lt;em&gt;v.&lt;/em&gt; the lower case &amp;quot;content&amp;quot; in the second instance. That one issue caused SharePoint to freak out. &lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t fully confirmed whether or not the last set of asp:Content controls was the issue, or if it was an inconsistency with the opening/closing tags. Nor have I found out what it was that made the controls lower case (could be Visual Studio copy/paste settings), but to be safe, just make sure it&amp;#39;s all capitalized and you won&amp;#39;t encounter the grief that I did.&lt;/p&gt;
&lt;p&gt;There is &lt;a href="http://www.sharepointblogs.com/tmt/archive/2007/11/19/placeholderpagetitle-is-the-root-of-all-evil.aspx" target="_blank"&gt;one other post out there by Waldek Mastykarz&lt;/a&gt; which mentions an issue with the PlaceHolderPageTitle placeholder. I haven’t confirmed that the PlaceHolderPageTitle is in fact the root of all evil, but he seems to indicate a similar symptom if you don’t include it in your page layout. In my tests, I did NOT have the PlaceHolderPageTitle, and my page layout still worked correctly &lt;em&gt;after&lt;/em&gt; I fixed the case issue for the Content web server control.&lt;/p&gt;
&lt;p&gt;Hope this helps you.&lt;/p&gt;
&lt;p&gt;Final Note: I encountered this problem in November 2007; I do not remember whether or not I had SP1 installed at the time. If I have a chance to test this again, I will update this post.&lt;/p&gt;&lt;/font&gt;Sherman Woo
			&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=19244" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Page+Layouts/default.aspx">Page Layouts</category></item><item><title>Visual Studio Extensions for WSS 1.2 - Too Bad I Can't Use Them</title><link>http://www.sharepointblogs.com/spsherm/archive/2008/06/17/visual-studio-extensions-for-wss-1-2-too-bad-i-can-t-use-them.aspx</link><pubDate>Tue, 17 Jun 2008 21:55:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:17713</guid><dc:creator>Sherman</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=17713</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2008/06/17/visual-studio-extensions-for-wss-1-2-too-bad-i-can-t-use-them.aspx#comments</comments><description>&lt;font face="Trebuchet MS" size="2"&gt;
&lt;p&gt;(Not in my native Windows environment anyway.)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have a few spare moments at work right now.&amp;nbsp;I&amp;#39;ve got&amp;nbsp;Windows Server 2003 x64 with a local installation of SharePoint as my development environment. (You can debate the merits of this &lt;em&gt;v.&lt;/em&gt; using a VM, but I prefer to have direct access to my hardware.) I wanted to check out the VS extensions, so I can quickly do &amp;quot;one-offs&amp;quot; instead of creating full solutions everytime. &lt;/p&gt;
&lt;p&gt;I downloaded &lt;a class="" title="http://www.microsoft.com/downloads/details.aspx?FamilyID=7bf65b28-06e2-4e87-9bad-086e32185e68&amp;amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7bf65b28-06e2-4e87-9bad-086e32185e68&amp;amp;displaylang=en"&gt;the extension which can be found here&lt;/a&gt;. Tried to install, and boom! &lt;/p&gt;
&lt;p&gt;&lt;font face="arial,helvetica,sans-serif"&gt;&amp;quot;This product cannot be installed on 64-bit versions of Windows.&amp;quot; [OK]&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;What! No! Not OK. Some digging, and reading the comments on the SharePoint Team Blog, I came across this post: &lt;a href="http://blogs.msdn.com/mattbremer/archive/2008/06/17/why-do-visual-studio-extensions-for-wss-3-0-not-support-64-bit-platforms.aspx"&gt;http://blogs.msdn.com/mattbremer/archive/2008/06/17/why-do-visual-studio-extensions-for-wss-3-0-not-support-64-bit-platforms.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Heavy sigh... time to take a closer look at &lt;a class="" title="http://www.codeplex.com/stsdev" href="http://www.codeplex.com/stsdev"&gt;Ted Pattison Group&amp;#39;s STSDEV&lt;/a&gt;...&lt;/p&gt;&lt;/font&gt;Sherman Woo
			&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=17713" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Development+Process/default.aspx">Development Process</category></item><item><title>Registering a CSS File in SharePoint</title><link>http://www.sharepointblogs.com/spsherm/archive/2008/06/16/registering-a-css-file.aspx</link><pubDate>Mon, 16 Jun 2008 21:26:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:17652</guid><dc:creator>Sherman</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=17652</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2008/06/16/registering-a-css-file.aspx#comments</comments><description>&lt;font face="Trebuchet MS" size="2"&gt;
&lt;p&gt;I have a custom publishing site definition. It was, of course, based off the default publishing site definition. I re-organized some features around, and added custom versions of required features just so I could control everything a little more to my liking. Anytime we do this, however, we run the risk of &amp;quot;what did I break?&amp;quot; syndrome. &lt;/p&gt;
&lt;p&gt;One of my clients was using the Content Editor Web Part on one of her page layouts (instead of using a RichHtmlField - long story). She noted that she could not select the &amp;quot;Use Predefined Table Format&amp;quot; in the Table Editor web dialog. Hmmm... I didn&amp;#39;t do anything specific to &lt;i&gt;disable&lt;/i&gt; that capability, so I needed to do some digging. &lt;/p&gt;
&lt;p&gt;Since I was using a custom publishing site definition, I needed to determine if this behaviour was happening with the default Publishing Portal definition. Sure enough, adding a CEWP to the home page of the Publishing Portal yielded the same effect: I could not use the predefined table formats. I then check the Press Releases default page, which does have a RichHtmlField for me to play with. I &lt;i&gt;can&lt;/i&gt; use the predefined formats here. I proceeded to add a CEWP to the zone at the bottom of the page, and here I can also use the predefined formats. Interesting... &lt;/p&gt;
&lt;p&gt;I fired up my favourite search engine, and came across this posting from Microsoft: &lt;a title="http://support.microsoft.com/kb/948320" href="http://support.microsoft.com/kb/948320"&gt;How to enable the &amp;quot;Use Predefined Table Format&amp;quot; setting when you use a Windows SharePoint Services template in SharePoint Server 2007&lt;/a&gt;. Cool! But note the location of the CSS: &lt;span style="COLOR:#0000ff;FONT-FAMILY:Consolas;"&gt;/_LAYOUTS/1033/STYLES/HtmlEditorTableFormats.css&lt;/span&gt;. In my case, I have the French language pack installed, which means I have to account for the 1036 LCID also. &lt;/p&gt;
&lt;p&gt;I checked the master pages and page layouts that PublishingLayouts feature use, and note that there is &lt;i&gt;not&lt;/i&gt; a reference to that CSS. Nor is it in the page layouts found in the PublishingResources feature. What gives? What&amp;#39;s the correct syntax? &lt;/p&gt;
&lt;p&gt;No matter. I&amp;#39;ll just add a link to the CSS by building out the path to the right LCID folder, using something like &lt;span style="COLOR:#0000ff;FONT-FAMILY:Consolas;"&gt;System.Threading.Thread.CurrentThread.CurrentUICulture&lt;/span&gt; to get the LCID. After some frustrations (which I won&amp;#39;t get into here), I quickly realized that this would not work in my scenario (Canadian English is not 1033) either. &lt;/p&gt;
&lt;p&gt;I looked at the source code for my out-of-the-box publishing portal (the Press Releases page). I noticed that &lt;span style="COLOR:#0000ff;FONT-FAMILY:Consolas;"&gt;core.css&lt;/span&gt; also comes from the &lt;span style="COLOR:#0000ff;FONT-FAMILY:Consolas;"&gt;LAYOUTS/1033/Styles&lt;/span&gt; folder. Some more digging, and I realized that I did not need to speficy the full path, like this example taken from BlueBand.master: 
&lt;ul&gt;
&lt;li&gt;&lt;span style="COLOR:#0000ff;FONT-FAMILY:Consolas;"&gt;&amp;lt;SharePoint:CssRegistration&amp;nbsp;name=&amp;quot;&amp;lt;%&amp;nbsp;$SPUrl:~sitecollection/Style&amp;nbsp;Library/~language/Core&amp;nbsp;Styles/controls.css&amp;nbsp;%&amp;gt;&amp;quot;&amp;nbsp;runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;but instead I needed simply this: 
&lt;ul&gt;
&lt;li&gt;&lt;span style="COLOR:#0000ff;FONT-FAMILY:Consolas;"&gt;&amp;lt;SharePoint:CssRegistration&amp;nbsp;name=&amp;quot;HtmlEditorTableFormats.css&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;and SharePoint takes care of the rest, building out the path to the appropriate &lt;span style="COLOR:#0000ff;FONT-FAMILY:Consolas;"&gt;Styles&lt;/span&gt; as required, like this: 
&lt;ul&gt;
&lt;li&gt;&lt;span style="COLOR:#0000ff;FONT-FAMILY:Consolas;"&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&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;a title="http://blog.mastykarz.nl/tag/rich-text-editor/" href="http://blog.mastykarz.nl/tag/rich-text-editor/"&gt;Here is a great post which talks about what&amp;#39;s going on&lt;/a&gt;, and what rendres HtmlEditorTableFormats links. It explains why I could not find it in any of the master pages or page layouts: the RichHtmlField web control inserts&amp;nbsp;CSS links&amp;nbsp;to &lt;span style="COLOR:#0000ff;FONT-FAMILY:Consolas;"&gt;HtmlEditorTableFormats.css&lt;/span&gt; and &lt;span style="COLOR:#0000ff;FONT-FAMILY:Consolas;"&gt;HtmlEditorCustomStyles.css&lt;/span&gt; OnLoad()&amp;nbsp;. &amp;lt;groan! /&amp;gt; &lt;/p&gt;&lt;/font&gt;Sherman Woo
			&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=17652" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Web+Parts/default.aspx">Web Parts</category></item><item><title>ContentTypeID Syntax/Structure</title><link>http://www.sharepointblogs.com/spsherm/archive/2008/02/06/contenttypeid-syntax-structure.aspx</link><pubDate>Wed, 06 Feb 2008 20:24:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:12388</guid><dc:creator>Sherman</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=12388</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2008/02/06/contenttypeid-syntax-structure.aspx#comments</comments><description>&lt;font face="trebuchet ms,geneva"&gt;
&lt;p&gt;There is a more efficient way to do content type IDS than we have done in the past: &lt;a class="" title="http://msdn2.microsoft.com/en-us/library/aa543822.aspx" href="http://msdn2.microsoft.com/en-us/library/aa543822.aspx" target="_blank"&gt;http://msdn2.microsoft.com/en-us/library/aa543822.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Say we wanted to inherit from &amp;quot;Page&amp;quot;, our content type used to look something this (I&amp;#39;ve split up the lines so it will display properly):&lt;br /&gt;&lt;font face="Consolas" color="#ff0000"&gt;0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas"&gt;00&lt;br /&gt;&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#0000ff" size="2"&gt;188024C0FF7F45CFB85EBB43980DACF5&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Meaning, inherit from &amp;quot;Page&amp;quot; (the red part), include a delimiter (&lt;strong&gt;&lt;font face="Consolas"&gt;00&lt;/font&gt;&lt;/strong&gt;), and then append a GUID.&lt;/p&gt;
&lt;p&gt;If we then wanted to extend this content type, we would do this:&lt;br /&gt;&lt;font face="Consolas" color="#ff0000"&gt;0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas"&gt;00&lt;br /&gt;&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#0000ff"&gt;188024C0FF7F45CFB85EBB43980DACF5&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas"&gt;00&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#0000ff"&gt;DFA39D91C06D48BDBC415E7CE80A95CD&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;And so on... You can imagine how hairy-scary the ContentTypeIDs can get if you wanted your inheritance to go a few levels deep.&lt;/p&gt;
&lt;p&gt;As per the article, there is a more efficient way; the second ContentTypeID above could become:&lt;br /&gt;&lt;font face="Consolas" color="#ff0000"&gt;0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas"&gt;00&lt;br /&gt;&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#0000ff"&gt;188024C0FF7F45CFB85EBB43980DACF5&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas" color="#c0504d"&gt;01&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Where the tail &lt;b&gt;&lt;font face="Consolas" color="#c0504d"&gt;01 &lt;/font&gt;&lt;/b&gt;is the extended content type. Thus, we could have:&lt;br /&gt;&lt;font face="Consolas" color="#ff0000"&gt;0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas"&gt;00&lt;br /&gt;&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#0000ff"&gt;188024C0FF7F45CFB85EBB43980DACF5&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas" color="#c0504d"&gt;01&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;&lt;font face="Consolas" color="#ff0000"&gt;0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas"&gt;00&lt;br /&gt;&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#0000ff"&gt;188024C0FF7F45CFB85EBB43980DACF5&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas" color="#c0504d"&gt;02&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;etc.&lt;/p&gt;
&lt;p&gt;And then to extend from either of these:&lt;br /&gt;&lt;font face="Consolas" color="#ff0000"&gt;0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas"&gt;00&lt;br /&gt;&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#0000ff"&gt;188024C0FF7F45CFB85EBB43980DACF5&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas" color="#c0504d"&gt;01&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#33cc33"&gt;01&lt;/font&gt;&lt;br /&gt;&lt;font face="Consolas" color="#ff0000"&gt;0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas"&gt;00&lt;br /&gt;&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#0000ff"&gt;188024C0FF7F45CFB85EBB43980DACF5&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas" color="#c0504d"&gt;01&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#33cc33"&gt;02&lt;/font&gt;&lt;br /&gt;&lt;font face="Consolas" color="#ff0000"&gt;0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas"&gt;00&lt;br /&gt;&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#0000ff"&gt;188024C0FF7F45CFB85EBB43980DACF5&lt;/font&gt;&lt;b&gt;&lt;font face="Consolas" color="#c0504d"&gt;02&lt;/font&gt;&lt;/b&gt;&lt;font face="Consolas" color="#33cc33"&gt;01&lt;/font&gt;&lt;br /&gt;etc.&lt;/p&gt;
&lt;p&gt;IMO, this makes the ContentTypeIDs much easier to work with (and read), and we run less risk of running into URL length issues within SharePoint.&lt;/p&gt;
&lt;p&gt;PS. The GUIDs used in the above examples have been changed to protect the coder. Any resemblance to any existing ContentTypeIDs are purely coincidental.&lt;/p&gt;&lt;/font&gt;Sherman Woo
			&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=12388" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Coding+Best+Practices/default.aspx">Coding Best Practices</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/XML+Schema+Files/default.aspx">XML Schema Files</category></item><item><title>Custom Web Parts can "break" Variations process.</title><link>http://www.sharepointblogs.com/spsherm/archive/2007/10/24/custom-web-parts-can-break-variations.aspx</link><pubDate>Wed, 24 Oct 2007 16:39:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:7733</guid><dc:creator>Sherman</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=7733</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2007/10/24/custom-web-parts-can-break-variations.aspx#comments</comments><description>&lt;font face="trebuchet ms,geneva"&gt;
&lt;p&gt;Ok, the title is vague, but there&amp;#39;s only so much I can&amp;nbsp;put in a title, right? &lt;img src="http://www.sharepointblogs.com/emoticons/emotion-4.gif" alt="Stick out tongue" /&gt;&lt;/p&gt;
&lt;p&gt;As per MSDN&amp;#39;s documentation for the &lt;a class="" href="http://msdn2.microsoft.com/en-us/library/ms461685.aspx" target="_blank"&gt;Microsoft.SharePoint.WebPartPages&lt;/a&gt; class and &lt;a class="" href="http://andrewconnell.com/blog/archive/2006/05/20/3131.aspx" target="_blank"&gt;Andrew&amp;#39;s post on v3 web parts&lt;/a&gt;, we should now inherit from &lt;a class="" href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpart(VS.80).aspx" target="_blank"&gt;System.Web.UI.WebControls.WebParts.WebPart&lt;/a&gt; when we are building custom web parts, &lt;em&gt;except &lt;/em&gt;in the four scenarios he mentions (repeating here for my own records):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Cross page connections 
&lt;li&gt;Connections between Web Parts that are outside of a Web Part zone 
&lt;li&gt;Client-side connections (Web Part Page Services Component) 
&lt;li&gt;A data caching infrastructure that allows caching to the content database &lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;However, I came across a situation recently whereby a very simple custom web part (all it did was render a &amp;quot;Get Adobe Acrobat&amp;quot; link, essentially) threw a SharePoint error to the screen when used in conjunction with Variations. Here&amp;#39;s the steps to replicate:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Create your custom web part, inheriting from &lt;code style="COLOR:#990000;"&gt;System.Web.UI.WebControls.WebParts.WebPart&lt;/code&gt;. Keep it simple; &amp;quot;Hello World&amp;quot; is fine.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Build/deploy, etc. Use it in one of your page layouts. Of course, Variations has to be set up/enabled, &lt;strong&gt;but turn off automatic creation of target pages&lt;/strong&gt;.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Once the new page has been created, select either &amp;quot;Update Variations&amp;quot; from the Tools menu.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;SharePoint will start a long running operation, and then eventually throw an error to the screen.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;The target variation page is actually created, but this error message&amp;nbsp;is annoying, and probably discomforting to the authors.&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;It took me a while to figure out what was causing the problem. I&amp;nbsp;finally had a thorough look in the SharePoint logs, and found the message that told me the cause. If you are using &lt;a class="" href="http://www.spsdev.com/ulsreader.aspx" target="_blank"&gt;SpsDev&amp;#39;s ULS Log Reader&lt;/a&gt;, filter by Area:CMS, Category:Publishing,&amp;nbsp;or just&amp;nbsp;look for the message &amp;quot;Unable to cast&amp;quot;. The relevant part of the message is:&lt;/p&gt;
&lt;p&gt;&lt;code style="COLOR:#990000;"&gt;Unable to cast object of type &amp;#39;******.Website.SharePoint.WebParts.AdobeLinkWebPart&amp;#39; to type &amp;#39;Microsoft.SharePoint.WebPartPages.WebPart&amp;#39;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code style="COLOR:#990000;"&gt;&lt;/code&gt;Um, what? Why does it want to do that? So...&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Re-write the web part to inherit from &lt;code style="COLOR:#990000;"&gt;Microsoft.SharePoint.WebPartPages.WebPart&lt;/code&gt;.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Create a new DWP file to match.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Deploy, etc; re-test.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Of course, it works without the error.&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Microsoft&amp;#39;s own web parts that inherit from &lt;code style="COLOR:#990000;"&gt;System.Web.UI.WebControls.WebParts.WebPart&lt;/code&gt; don&amp;#39;t seem to have the same behaviour.&amp;nbsp;Nevertheless, I believe this to be a bug, but one that you should know about when using custom web parts in conjunction with Variations.&lt;/p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/code&gt;Sherman Woo
			&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=7733" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Web+Parts/default.aspx">Web Parts</category></item><item><title>PortalSiteMapProvider Properties: IncludePages, DynamicChildLimit</title><link>http://www.sharepointblogs.com/spsherm/archive/2007/10/22/portalsitemapprovider-properties-includepages-dynamicchildlimit.aspx</link><pubDate>Mon, 22 Oct 2007 23:51:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:7663</guid><dc:creator>Sherman</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=7663</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2007/10/22/portalsitemapprovider-properties-includepages-dynamicchildlimit.aspx#comments</comments><description>&lt;font face="trebuchet ms,geneva"&gt;
&lt;p&gt;The &lt;a class="" href="http://msdn2.microsoft.com/en-us/library/ms582344.aspx" target="_blank"&gt;PortalSiteMapProvider&lt;/a&gt; class is the base provider used by the four default &amp;quot;CMS&amp;quot; SiteMapProviders:&lt;/p&gt;&lt;code style="COLOR:#990000;"&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;GlobalNavSiteMapProvider&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;CombinedNavSiteMapProvider&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;CurrentNavSiteMapProvider&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;CurrentNavSiteMapProviderNoEncode&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/code&gt;
&lt;p&gt;That is, all of these SiteMapProviders use the same base code to generate a data source, but their &amp;quot;output&amp;quot; differs slightly due to the different attributes that are applied.&lt;/p&gt;
&lt;p&gt;Recently, we wanted to filter out the pages from showing up in our left-navigation. You can do this at the rendering stage, but since the PortalSiteMapProvder gives us an &lt;a class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.publishing.navigation.portalsitemapprovider.includepages.aspx" target="_blank"&gt;IncludePages&lt;/a&gt; property, we can simply create a new entry in &lt;code style="COLOR:#990000;"&gt;web.config&lt;/code&gt; for our &amp;quot;custom&amp;quot; provider, like this:&lt;/p&gt;&lt;code style="COLOR:#990000;"&gt;&amp;lt;add name=&amp;quot;&lt;font color="#0000ff"&gt;CurrentNavNoPagesSiteMapProvider&lt;/font&gt;&amp;quot; description=&amp;quot;CMS provider for Current navigation&amp;quot; type=&amp;quot;Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;quot; NavigationType=&amp;quot;Current&amp;quot; EncodeOutput=&amp;quot;true&amp;quot; IncludePages=&amp;quot;Never&amp;quot;&amp;nbsp;/&amp;gt;&lt;/code&gt; 
&lt;p&gt;By default, there is also a 50 returned-items limit; we can set the &lt;a class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.publishing.navigation.portalsitemapprovider.dynamicchildlimit.aspx" target="_blank"&gt;DynamicChildLimit&lt;/a&gt; to &amp;quot;0&amp;quot; to override this.&lt;/p&gt;&lt;code style="COLOR:#990000;"&gt;&amp;lt;add name=&amp;quot;&lt;font color="#0000ff"&gt;CurrentNavNoLimitSiteMapProvider&lt;/font&gt;&amp;quot; description=&amp;quot;CMS provider for Current navigation&amp;quot; type=&amp;quot;Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;quot; NavigationType=&amp;quot;Current&amp;quot; EncodeOutput=&amp;quot;true&amp;quot; DynamicChildLimit=&amp;quot;0&amp;quot; /&amp;gt;&amp;nbsp;&lt;/code&gt; 
&lt;p&gt;Of course, you can combine the different properties to come up with a combination you need. The next thing we would need to do is reference these new providers, and voila! &lt;/p&gt;
&lt;p&gt;And if you haven&amp;#39;t read Chris Richard&amp;#39;s series of articles about &lt;a class="" href="http://blogs.msdn.com/ecm/archive/2007/02/10/moss-navigation-deep-dive-part-1.aspx" target="_blank"&gt;MOSS Navigation&lt;/a&gt;&amp;nbsp;and &lt;a class="" href="http://blogs.msdn.com/ecm/archive/2007/05/23/increased-performance-for-moss-apps-using-the-portalsitemapprovider.aspx" target="_blank"&gt;how to get better performance using the PortalSiteMapProvider&lt;/a&gt;, you really should... &lt;/p&gt;&lt;/font&gt;Sherman Woo
			&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=7663" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Navigation/default.aspx">Navigation</category></item><item><title>My First Computer</title><link>http://www.sharepointblogs.com/spsherm/archive/2007/08/31/old-computer.aspx</link><pubDate>Fri, 31 Aug 2007 20:58:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:5036</guid><dc:creator>Sherman</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=5036</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2007/08/31/old-computer.aspx#comments</comments><description>&lt;font face="Trebuchet MS"&gt;
&lt;p&gt;Came across this while cruising around:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://content.techrepublic.com.com/2346-10877_11-895-9.html"&gt;http://content.techrepublic.com.com/2346-10877_11-895-9.html&lt;/a&gt; &lt;br /&gt;&lt;a href="http://www.oldcomputers.net/vic20.html"&gt;http://www.oldcomputers.net/vic20.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;5K (3.5K usable)… wow. We also had the tape drive. Wicked. Ask me how we searched for programs on a tape... &lt;img src="http://www.sharepointblogs.com/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/p&gt;And for the record, our *second* computer was an (original, not a clone) &lt;a class="" href="http://en.wikipedia.org/wiki/Apple_IIe" target="_blank"&gt;Apple IIe&lt;/a&gt; with dual disk(ette) drives. My buddy had an Apple IIc, and my future neighbour had an Apple Lisa. 
&lt;p&gt;(Ironic how I am posting about one of my old computers, the Apple IIe, which was codenamed &amp;quot;Diana&amp;quot;, on this, the 10th year of Diana&amp;#39;s death.)&lt;/p&gt;&lt;/font&gt;Sherman Woo
			&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=5036" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Personal/default.aspx">Personal</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Technology/default.aspx">Technology</category></item><item><title>SPFormContext</title><link>http://www.sharepointblogs.com/spsherm/archive/2007/08/29/spformcontext.aspx</link><pubDate>Wed, 29 Aug 2007 20:30:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:4939</guid><dc:creator>Sherman</dc:creator><slash:comments>16</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=4939</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2007/08/29/spformcontext.aspx#comments</comments><description>&lt;font face="trebuchet ms,geneva"&gt;
&lt;p&gt;Argh, &lt;a class="" title="Sezai&amp;#39;s Blog" href="http://www.sharepointblogs.com/sezai/" target="Sezai"&gt;Sezai&lt;/a&gt; beat me to&amp;nbsp;this post about &lt;a class="" title="Sezai: FormContext" href="http://www.sharepointblogs.com/sezai/archive/2007/08/29/spcontext-current-formcontext.aspx" target="Sezai"&gt;SPFormContext and SPControlMode&lt;/a&gt;&amp;nbsp;by a few hours! I have to admit my sentiment is the same as his -&amp;nbsp;I&amp;#39;m super stoked to have found this &lt;a class="" title="MSDN" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spformcontext.aspx" target="MSDN"&gt;class&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Oftentimes, we need some code to execute, but only in the &amp;quot;published&amp;quot; state (old MCMS terminology). We might want a component to run certain logic, but it&amp;#39;s really only relevant if the page is in a live/published state. In other words, the logic does not matter when we are viewing the page as authors, editors, or administrators - we either don&amp;#39;t care, or we just don&amp;#39;t want the logic to execute. (Could be vice-versa; execute some code only if we&amp;#39;re NOT in published state.)&lt;/p&gt;
&lt;p&gt;For example, my UE developer asked me to hide all mark-up surrounding a publishing site field. After all, if there isn&amp;#39;t any content to display, then why bother rendering the DIV tags, or possibly some heading (H) tags? By performing a check for content, we can avoid a situation where a &amp;quot;News&amp;quot; header appears, but there&amp;#39;s nothing it. So, I created a control that wraps around all the mark-up that comprises a UI element/section. If there is no content, the control, and its children, will not render. However, we &lt;em&gt;always&lt;/em&gt; want it to render in editing mode; otherwise, we can&amp;#39;t add content back in! &lt;/p&gt;
&lt;p&gt;This&amp;nbsp;scenario was fairly simple to solve: write a control that inherits from &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.basefieldcontrol.aspx"&gt;Microsoft.SharePoint.WebControls.BaseFieldControl&lt;/a&gt;, and only run&amp;nbsp;the code to check&amp;nbsp;for content if we are in published mode:&lt;/p&gt;&lt;code style="COLOR:#990000;"&gt;if (this.ControlMode == SPControlMode.Display)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // do something.&lt;br /&gt;}&lt;/code&gt; 
&lt;p&gt;This is all fine and well, since BaseFieldControl can be traced back to &lt;a class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.formcomponent.aspx" target="_blank"&gt;Microsoft.SharePoint.WebControls.FormComponent&lt;/a&gt;, which is the last point in the hierarchy that has the ControlMode property. If you go further up the tree,&amp;nbsp;&lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.spcontrol.aspx"&gt;Microsoft.SharePoint.WebControls.SPControl&lt;/a&gt;&amp;nbsp;&lt;em&gt;does not&lt;/em&gt; have the ControlMode property... I have no idea why not.&lt;/p&gt;
&lt;p&gt;Why is this a problem? Well, my UE developer wanted to check &lt;em&gt;multiple&lt;/em&gt; fields. I could not inherit from BaseFieldControl any longer, since it is meant to represent a single field, not multiple fields. So I decided to inherit from SPControl instead. (In the end, I probably could have inherited from &lt;u&gt;System.Web.UI.WebControls.WebControl&lt;/u&gt;, but it seemed to make sense to stick within the SharePoint namespace.) &lt;/p&gt;
&lt;p&gt;After much searching, including spending a lot of time in Reflector, specifically searching for &lt;u&gt;Microsoft.SharePoint.Publishing.WebControls.PageDisplayMode&lt;/u&gt; and &lt;u&gt;Microsoft.SharePoint.Publishing.WebControls.SPControlMode&lt;/u&gt; (both enums), I &lt;em&gt;finally&lt;/em&gt;&amp;nbsp;came across this *internal* and *sealed* class in the &lt;u&gt;Microsoft.Office.Server.Utilities&lt;/u&gt; namespace: &lt;strong&gt;PageUtility&lt;/strong&gt;. But we can&amp;#39;t use it! However, inside PageUtility is a method called &lt;strong&gt;IsPageCurrentlyInSomeEditMode()&lt;/strong&gt; (nice, huh?) and more importantly, a property called &lt;strong&gt;FormContextMode&lt;/strong&gt;, which returns an SPControlMode object... interesting. &lt;/p&gt;
&lt;p&gt;Looking closer, I saw a line (similar to) SPContext.Current.FormContext.FormMode (!!). As Sezai pointed out, FormContext is an &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spformcontext.aspx"&gt;SPFormContext&lt;/a&gt;&amp;nbsp;object, which contains two (potentially) very useful properties: &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spformcontext.formmode.aspx"&gt;FormMode&lt;/a&gt; and &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spformcontext.fieldcontrolcollection.aspx"&gt;FieldControlCollection&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;&lt;strong&gt;FormMode&lt;/strong&gt; gives us a way to check against the enum SPControlMode to determine what &amp;quot;state&amp;quot; we&amp;#39;re in.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;strong&gt;FieldControlCollection&lt;/strong&gt; returns an ArrayList of field controls (skipping all the other server controls on the page).&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Now, I can do a check like this:&lt;/p&gt;&lt;code style="COLOR:#990000;"&gt;if (SPContext.Current.FormContext.FormMode == SPControlMode.Display)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // do something.&lt;br /&gt;}&lt;/code&gt; 
&lt;p&gt;Also, with &lt;strong&gt;FieldControlCollection&lt;/strong&gt;, I can&amp;nbsp;iterate over the list of defined fields for the current page, looking for some specified fields. Nice! &lt;/p&gt;
&lt;p&gt;SPFormContext is definitely useful, and I&amp;#39;m surprised there hasn&amp;#39;t been any postings about it until Sezai came along &lt;img src="http://www.sharepointblogs.com/emoticons/emotion-5.gif" alt="Wink" /&gt; (try&amp;nbsp;searching for SPFormContext...).&lt;/p&gt;&lt;/font&gt;Sherman Woo
			&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=4939" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Object+Model/default.aspx">Object Model</category></item><item><title>Improving Performance: BlobCache</title><link>http://www.sharepointblogs.com/spsherm/archive/2007/08/21/improving-performance-blobcache.aspx</link><pubDate>Tue, 21 Aug 2007 22:25:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:4613</guid><dc:creator>Sherman</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=4613</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2007/08/21/improving-performance-blobcache.aspx#comments</comments><description>&lt;font face="trebuchet ms,geneva"&gt;
&lt;p&gt;When a SharePoint is application is created, a web.config file is created in the application folder you specified. One of the entries inside the SharePoint element is BlobCache. By default, it looks like this:&lt;/p&gt;
&lt;p&gt;&lt;code style="COLOR:#990000;"&gt;&amp;lt;BlobCache location=&amp;quot;C:\blobCache&amp;quot; path=&amp;quot;\.(gif|jpg|png|css|js)$&amp;quot; maxSize=&amp;quot;10&amp;quot; enabled=&amp;quot;&lt;font color="#0000ff"&gt;false&lt;/font&gt;&amp;quot; /&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In order to improve the performance of your site, the BlobCache should be enabled.&lt;/p&gt;
&lt;p&gt;&lt;code style="COLOR:#990000;"&gt;&amp;lt;BlobCache location=&amp;quot;C:\blobCache&amp;quot; path=&amp;quot;\.(gif|jpg|png|css|js)$&amp;quot; maxSize=&amp;quot;10&amp;quot; enabled=&amp;quot;&lt;font color="#0000ff"&gt;true&lt;/font&gt;&amp;quot; /&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The maxSize attribute is in GigaBytes, so make sure you have enough room at the location.&lt;/p&gt;
&lt;p&gt;Pop quiz: why is it off by default?!&lt;/p&gt;
&lt;p&gt;See this article for more information about other caching techniques: &lt;a href="http://blogs.msdn.com/ecm/archive/2006/11/08/how-to-make-your-moss-2007-web-site-faster-with-caching.aspx"&gt;http://blogs.msdn.com/ecm/archive/2006/11/08/how-to-make-your-moss-2007-web-site-faster-with-caching.aspx&lt;/a&gt;&lt;/p&gt;&lt;/font&gt;Sherman Woo
			&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=4613" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Performance/default.aspx">Performance</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Caching/default.aspx">Caching</category></item><item><title>Planning for Performance</title><link>http://www.sharepointblogs.com/spsherm/archive/2007/08/17/planning-for-performance.aspx</link><pubDate>Fri, 17 Aug 2007 09:37:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:4416</guid><dc:creator>Sherman</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=4416</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2007/08/17/planning-for-performance.aspx#comments</comments><description>&lt;font face="trebuchet ms,geneva"&gt;
&lt;p&gt;This isn&amp;#39;t in my area of expertise, but a co-worker of mine (thanks Carmen!) alerted me to this, so I figured I should put it here for safe keeping. It&amp;#39;s an article that describes the capacity limits for MOSS 2007.&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="Plan for software boundaries (Office SharePoint Server)" href="http://technet2.microsoft.com/Office/en-us/library/6a13cd9f-4b44-40d6-85aa-c70a8e5c34fe1033.mspx?mfr=true" target="_blank"&gt;Plan for software boundaries (Office SharePoint Server)&lt;/a&gt;&lt;/p&gt;&lt;/font&gt;Sherman Woo
			&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=4416" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Infrastructure/default.aspx">Infrastructure</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Planning/default.aspx">Planning</category></item><item><title>SPSite vs. SPWeb</title><link>http://www.sharepointblogs.com/spsherm/archive/2007/08/17/spsite-vs-spweb.aspx</link><pubDate>Fri, 17 Aug 2007 08:06:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:4411</guid><dc:creator>Sherman</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=4411</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2007/08/17/spsite-vs-spweb.aspx#comments</comments><description>&lt;font face="trebuchet ms,geneva"&gt;
&lt;p&gt;We had a discussion amongst the developers in our group recently: what is an SPSite, what is an SPWeb, and what is the difference? Which once should I work with in my code? Looking at MSDN for the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms462369.aspx"&gt;SPSite class&lt;/a&gt;, we see this description:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;[SPSite] Represents a collection of sites on a virtual server, including a top-level site and all its subsites. Each &lt;b&gt;SPSite&lt;/b&gt; object, or site collection, is represented within an SPSiteCollection object that consists of the collection of all site collections on the virtual server.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Mmmmm... ooo-kay... what does that mean?&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spweb.aspx"&gt;SPWeb class&lt;/a&gt; simply says:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Represents a SharePoint Web site. &lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Wow. Enlightening. Looking back to my first experiences working with the SharePoint object model in WSS2/SPS2003, I must say this was one of the more confusing points for me. And it&amp;#39;s easy to see why it can be such a confusing/frustrating experience for developers working with the API for the first time. Now that I&amp;#39;ve worked with WSS3/MOSS code more closely, specifically with Publishing Sites where there are many child &amp;quot;sites&amp;quot;, I&amp;#39;ve come to understand the world of SPSite and SPWeb objects.&lt;/p&gt;
&lt;p&gt;The problem&amp;nbsp;lies with the difference in terms used between the SharePoint user-interface and the object model. When we are speaking to end-users, they are familiar with the term &amp;quot;creating SharePoint team sites&amp;quot;. However, everytime you create a &amp;quot;site&amp;quot; from the UI, an SPWeb object was created. &lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t help that the MSDN documentation uses the following type of naming conventions in their code samples:&lt;/p&gt;
&lt;blockquote&gt;&lt;code style="COLOR:#990000;"&gt;SPSite mySiteCollection = new SPSite(&amp;quot;http://servername/&amp;quot;); &lt;br /&gt;SPWeb mySite = mySiteCollection.AllWebs[&amp;quot;Site_Name&amp;quot;]; &lt;br /&gt;SPWeb myRootSite = mySiteCollection.RootWeb;&lt;/code&gt; &lt;/blockquote&gt;
&lt;p&gt;For me, it would have been much clearer if they&amp;nbsp;wrote something like this instead:&lt;/p&gt;
&lt;blockquote&gt;&lt;code style="COLOR:#990000;"&gt;SPSite mySite = new SPSite(&amp;quot;http://servername/&amp;quot;); &lt;br /&gt;SPWeb myWeb = mySite.AllWebs[&amp;quot;Site_Name&amp;quot;]; &lt;br /&gt;SPWeb myRootWeb = mySite.RootWeb;&lt;/code&gt; &lt;/blockquote&gt;
&lt;p&gt;While the description for SPSite may be valid, a typical SharePoint application web site only has one &lt;em&gt;top-level site collection&lt;/em&gt;. Therefore, in this url &lt;font color="#0000cc"&gt;http://servername/site1/site1a/&lt;/font&gt;, there are actually three SPWeb objects, and only one SPSite object.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code style="COLOR:#990000;"&gt;SPSite site1 = new SPSite(&amp;quot;http://servername/site1/&amp;quot;);&amp;nbsp; &lt;br /&gt;&lt;/code&gt;&lt;code style="COLOR:#990000;"&gt;SPSite site1a = new SPSite(&amp;quot;http://servername/site1/site1a/&amp;quot;);&lt;br /&gt;bool sitesAreEqual =&amp;nbsp;site1.Equals(site1a);&amp;nbsp; // sitesAreEqual should evaluate to true.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code style="COLOR:#990000;"&gt;SPWeb web1 = site1.OpenWeb();&lt;br /&gt;SPWeb web1a = site1a.OpenWeb();&lt;br /&gt;SPWeb rootWeb = site1.RootWeb; // or site1a.RootWeb; would return same instance.&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;See the SPSite.OpenWeb() method for more&amp;nbsp;examples: &lt;a href="http://msdn2.microsoft.com/en-us/library/ms474633.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms474633.aspx&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;SPSite itself is not a &amp;quot;collection&amp;quot; in the sense that comes from CollectionBase, for example. In fact, both SPSite and SPWeb inherit directly from System.Object. Therefore, to use a name such as mySiteCollection is confusing/misleading. &lt;/p&gt;
&lt;p&gt;The key thing to keep in mind is that as developers, we need to use the technically accurate terms when speaking with each other (even if MSDN doesn&amp;#39;t), and reserve the marketing/UI terms when speaking with people who would never see the object model. (Note: there are examples of these kinds of terminology differences all over the place in SharePoint 2007.)&lt;/p&gt;
&lt;p&gt;I hope this clears things up a bit...if you find something that is not correct/accurate, please let me know!&lt;/p&gt;&lt;/font&gt;Sherman Woo
			&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=4411" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SPWeb/default.aspx">SPWeb</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SPSite/default.aspx">SPSite</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Object+Model/default.aspx">Object Model</category></item><item><title>MSDN Link: SharePoint Best Practices - Disposing WSS Objects</title><link>http://www.sharepointblogs.com/spsherm/archive/2007/08/02/msdn-link-sharepoint-best-practices-disposing-wss-objects.aspx</link><pubDate>Thu, 02 Aug 2007 20:28:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:3853</guid><dc:creator>Sherman</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/spsherm/rsscomments.aspx?PostID=3853</wfw:commentRss><comments>http://www.sharepointblogs.com/spsherm/archive/2007/08/02/msdn-link-sharepoint-best-practices-disposing-wss-objects.aspx#comments</comments><description>&lt;font face="trebuchet ms,geneva"&gt;
&lt;p&gt;&lt;em&gt;Might as well dive right in and make the inaugural posting useful...&lt;/em&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Anyone who&amp;#39;s done some development work with SharePoint probably already knows about this article, but I wanted to place it here for reference: &lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://msdn2.microsoft.com/en-us/library/aa973248.aspx" target="_blank"&gt;Best Practices: Using Disposable Windows SharePoint Services Objects&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Review the article very carefully... there are things we do often such as getting to an SPSite&amp;#39;s RootWeb, like this:&lt;/p&gt;
&lt;blockquote&gt;&lt;code style="COLOR:#990000;"&gt;SPSite site = SPControl.GetContextSite(HttpContext.Current);&lt;br /&gt;SPWeb rootWeb = site.RootWeb;&lt;/code&gt; &lt;/blockquote&gt;
&lt;p&gt;In this case, it&amp;#39;s pretty obvious (based on the article) that we need to call &lt;code style="COLOR:#990000;"&gt;rootWeb.Dispose();&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;However, if you were to access a property like this:&lt;/p&gt;
&lt;blockquote&gt;&lt;code style="COLOR:#990000;"&gt;string rootWebTitle = site.RootWeb.Title;&lt;/code&gt; &lt;/blockquote&gt;
&lt;p&gt;the article states that you should call &lt;code style="COLOR:#990000;"&gt;site.RootWeb.Dispose()&lt;/code&gt;, something that is not obvious, in my opinion. So to keep/ensure your SharePoint site/application runs as smoothly as possible,&amp;nbsp;clean up after yourself!&amp;nbsp;&lt;/p&gt;&lt;/font&gt;Sherman Woo
			&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=3853" width="1" height="1"&gt;</description><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Coding+Best+Practices/default.aspx">Coding Best Practices</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.sharepointblogs.com/spsherm/archive/tags/Object+Model/default.aspx">Object Model</category></item></channel></rss>