<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Michael&amp;#39;s SharePoint Den</title><subtitle type="html">Applied SharePoint with ASP.NET and AJAX</subtitle><id>http://msmvps.com/blogs/laflour/atom.aspx</id><link rel="alternate" type="text/html" href="http://msmvps.com/blogs/laflour/default.aspx" /><link rel="self" type="application/atom+xml" href="http://msmvps.com/blogs/laflour/atom.aspx" /><generator uri="http://communityserver.org" version="4.0.30619.63">Community Server</generator><updated>2008-05-22T23:19:56Z</updated><entry><title>Practical SharePoint White Papers</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/11/08/practical-sharepoint-white-papers.aspx" /><id>/blogs/laflour/archive/2008/11/08/practical-sharepoint-white-papers.aspx</id><published>2008-11-08T12:17:26Z</published><updated>2008-11-08T12:17:26Z</updated><content type="html">&lt;p&gt;Guys from Combined-Knowledge &lt;a href="http://www.combined-knowledge.com/Downloads%202007.htm"&gt;published&lt;/a&gt; white papers which are really practical and illustrated with step-by-step instructions. &lt;/p&gt;  &lt;p&gt;Good stuff.&lt;/p&gt;  &lt;p&gt;Btw, these guys run SharePoint Training around the Australia &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns%217575E2FFC19135B4%211319.entry"&gt;Practical SharePoint White Papers&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1653501" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>SQL Encryption Overview</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/10/27/sql-encryption-overview.aspx" /><id>/blogs/laflour/archive/2008/10/27/sql-encryption-overview.aspx</id><published>2008-10-27T07:58:49Z</published><updated>2008-10-27T07:58:49Z</updated><content type="html">&lt;p&gt;In these days I’m working on SQL encryption, and would like to post best guidelines for this&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;1. Choose from &lt;strong&gt;Symmetric&lt;/strong&gt; vs &lt;strong&gt;Asymmetric &lt;/strong&gt;encryption, based on the security of key distribution. &lt;/p&gt;  &lt;p&gt;Symmetric encryption algorithms are historically computationally fast, which makes them a good choice when encrypting large amounts of data or when key distribution is not a concern&lt;/p&gt;  &lt;p&gt;2. Protect “Data-in-motion” – transferred data by selecting the right protocol and “Data-at-rest” – stored data.&lt;/p&gt;  &lt;p&gt;3. Choose from encryption in &lt;strong&gt;Database Level &lt;/strong&gt;vs&lt;strong&gt; Row/Collumn Level&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;Database level encrypt the whole data file and each db manipulations request data decryption, which hinders performance for big db.&lt;/p&gt;  &lt;p&gt;4. Prefer to create Certificates rather then use pass-phrases or keys&lt;/p&gt;  &lt;p&gt;It simplifies key management and you don’t need to use your pass or pass-phrase in each stored proc&lt;/p&gt;  &lt;p&gt;5. Generate you keys with the most advanced algorithms (AES for Symmetric for example, but it request Win2k3 and above)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Resources:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a title="http://aspnet.4guysfromrolla.com/articles/021407-1.aspx" href="http://aspnet.4guysfromrolla.com/articles/021407-1.aspx"&gt;http://aspnet.4guysfromrolla.com/articles/021407-1.aspx&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="http://aspnet.4guysfromrolla.com/articles/022107-1.aspx" href="http://aspnet.4guysfromrolla.com/articles/022107-1.aspx"&gt;http://aspnet.4guysfromrolla.com/articles/022107-1.aspx&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="http://www.sqlservercentral.com/articles/SQL+Server+2005+-+Security/sql2005symmetricencryption/2291/" href="http://www.sqlservercentral.com/articles/SQL+Server+2005+-+Security/sql2005symmetricencryption/2291/"&gt;http://www.sqlservercentral.com/articles/SQL+Server+2005+-+Security/sql2005symmetricencryption/2291/&lt;/a&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns%217575E2FFC19135B4%211293.entry"&gt;SQL Encryption Overview&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1652092" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="General" scheme="http://msmvps.com/blogs/laflour/archive/tags/General/default.aspx" /></entry><entry><title>Best Practices to plan and configure your SharePoint Farm across corporate infrastructure</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/10/17/best-practices-to-plan-and-configure-your-sharepoint-farm-across-corporate-infrastructure.aspx" /><id>/blogs/laflour/archive/2008/10/17/best-practices-to-plan-and-configure-your-sharepoint-farm-across-corporate-infrastructure.aspx</id><published>2008-10-17T03:08:00Z</published><updated>2008-10-17T03:08:00Z</updated><content type="html">&lt;p&gt;I my previous post I described &lt;a href="http://msmvps.com/blogs/laflour/archive/2008/09/28/starting-sharepoint-solution-and-planning-your-documentation.aspx" target="_blank"&gt;list of documents you need to manage for your SharePoint engagement&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;In this post I’d like to publish my “best practices” for planning and configuring your SharePoint Farm across organizations. There are number of documents, describing such requirements for SharePoint Farm, but those documents are usually writing without taking into account your infrastructure scope. You never install SharePoint in isolated environment, and what you setup is usually interfere with the whole organization strategy and infrastructure design. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Infrastructure&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Inspect your organization network topology to know where all application servers are installed (AD, File Server, Mail Servers and etc) and location of networ services&amp;#160; - firewalls, proxies and etc; &lt;/li&gt;    &lt;li&gt;Find out all hardware devices - accelerators (WAN, XML), routers and etc. across your network. This information affects your selected SharePoint Farm topology. &lt;/li&gt;    &lt;li&gt;Find out the person who administrate corporate firewalls. Firewalls affect the SharePoint farm design from the very beginning and you need to open number of ports during configuring farm. &lt;/li&gt;    &lt;li&gt;Plan your farm topology - intranet and extranet, based on the info gathered earlier. I usually prefer to achieve “6+ server farm with Back-to-back perimeter topology with content publishing”, with some variations, depending on the client’s requirements. I like this topology, because it provides good availability, reliability and security. &lt;/li&gt;    &lt;li&gt;Measure the latency to different SharePoint Server Role boxes (Query, Index, and etc servers) according your design to reorganize your boxes and Server Roles to have the fastest response time and design your SharePoint farm properly. &lt;/li&gt;    &lt;li&gt;Install Microsoft Office 2007. &lt;/li&gt;    &lt;li&gt;Install all Windows Updates and Service Packs. &lt;/li&gt;    &lt;li&gt;Start SharePoint installation with WSS/MOSS + SP1 integrated. Don’t go with WSS/MOSS installation and then applying SP1, because this way has some issues&amp;#160; - small bugs with installing future updates &lt;/li&gt;    &lt;li&gt;Check if SSL works (open SharePoint Office Web Service via https://), if not – don’t go further till you fix it. This is &lt;strong&gt;very critical stuff&lt;/strong&gt;, because otherwise your can’t set SharePoint roles on other boxes in your farm. I had some negative experience in this area, when you can&amp;#39;t use other boxes in your farm and only Application boxes are available for Index and Query roles, because SSL was broken. &lt;/li&gt;    &lt;li&gt;Install the latest Infrastructure Upgrade after you setup your farm (August at the current moment, not July), But be careful and refer to documentation how to do it correctly (start with WSS Upgrade and only after install MOSS upgrade). Follow the right sequence of installing all updates Service Pack-&amp;gt;The latest Infrastructure Update –&amp;gt; All the latest Cumulative&amp;#160; Updates. Refer to this &lt;a href="http://technet.microsoft.com/en-us/library/cc288269.aspx" target="_blank"&gt;detailed instruction&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Don’t install different SharePoint hotfixes, if they are not published in Infrastructure Updates.&amp;#160; Do it only if you have very specific problems which really cause you troubles. Those hotfixes are temporary solution before the next Infrastructure Update, and they are not properly tested. &lt;/li&gt;    &lt;li&gt;Check if SSL for SharePoint Office Web Service works again. &lt;/li&gt;    &lt;li&gt;Plan how much site collections and sub sites you need. I prefer to have one site collections with number of sub sites rather than create several site collections. The reason for this is that each new site collection server like a new web application with isolated scope to features, templates and search. You hardly need this. So, start with only one site collections, and try to avoid number of new site collection if you don’t have solid reasons for this. &lt;/li&gt;    &lt;li&gt;Plan your site collection and sites location among content databases. Don’t end up with one big content database, because you can’t optimize your data usage in this case. Refer to my recent post, where I described why you need to plan your content databases: &lt;a href="http://msmvps.com/blogs/laflour/archive/2008/10/14/tips-to-create-a-site-collection-in-new-content-database.aspx"&gt;http://msmvps.com/blogs/laflour/archive/2008/10/14/tips-to-create-a-site-collection-in-new-content-database.aspx&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Setup SQL mirroring when you have empty content databases. Your DR box usually locates outside your organization with limited connections, and setting mirroring for big content database is very slow process. &lt;/li&gt;    &lt;li&gt;Save all your command and prefer to script everything you do during installing and configuring SharePoint Farm, because it saves your time when something going wrong and you need to reinstall your box. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;   &lt;br /&gt;&lt;strong&gt;Development&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Use separate SharePoint installation (different from Production) for development, because production boxes should be clean, without all those development tools you are going to use. I&amp;#160; usually use virtualized environment &lt;/li&gt;    &lt;li&gt;I prefer to have .NET 3.5 and VS 2008&amp;#160; with SQL 2008 + TFS 2008 servers for development environment &lt;/li&gt;    &lt;li&gt;“Visual Studio WSS Extensions” simplifies your work, but only if you are working on “proof-of-concept”. I prefer not to use it in real development, because there are some bugs, and you can use several alternative tools&amp;#160; &lt;a href="http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1047.entry"&gt;http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1047.entry&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Setup Visual Studio SharePoint solution via the following template, &lt;a href="http://blogs.msdn.com/gderun/archive/2008/01/11/sharepoint-visual-studio-project-and-deployment-templates.aspx"&gt;http://blogs.msdn.com/gderun/archive/2008/01/11/sharepoint-visual-studio-project-and-deployment-templates.aspx&lt;/a&gt; . It simplify moving you package builds to TFS &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Post-Installation Tasks&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Maintain your database to improve performance. Follow &lt;a href="http://blogs.msdn.com/sharepoint/archive/2008/02/28/database-maintenance-for-sharepoint-whitepaper.aspx" target="_blank"&gt;this guideline&lt;/a&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;That&amp;#39;s all. I welcome to hear some of yours &amp;quot;best practices&amp;quot;, if you have any&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1271.entry"&gt;&lt;span style="color:#4563b9;"&gt;Best Practices to plan and configure your SharePoint Farm across corporate infrastructure&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1651162" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>Tips to create a Site Collection in new Content Database</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/10/14/tips-to-create-a-site-collection-in-new-content-database.aspx" /><id>/blogs/laflour/archive/2008/10/14/tips-to-create-a-site-collection-in-new-content-database.aspx</id><published>2008-10-13T20:26:00Z</published><updated>2008-10-13T20:26:00Z</updated><content type="html">&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Intro&lt;/h3&gt;
&lt;p&gt;Ken Zheng posted a good overview of how to create a Site Collection in new Content Database &lt;a href="http://littletalk.wordpress.com/2008/10/10/creating-a-site-collection-in-a-new-content-database/"&gt;http://littletalk.wordpress.com/2008/10/10/creating-a-site-collection-in-a-new-content-database/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;d like to add some notes to Ken&amp;rsquo;s post, regarding planning site collections and sub-sites among different content databases.&lt;/p&gt;
&lt;p&gt;There are some reasons, why you could have several content databases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MS recommends to have content database not more the 100Gb, otherwise it could hinder performance.&lt;/li&gt;
&lt;li&gt;Data usage optimization&lt;/li&gt;
&lt;li&gt;It simplifies farm backup and restoration.&lt;/li&gt;
&lt;li&gt;It provides flexibility for Disaster Recovery (DR) strategy.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Scenario - Data Usage&lt;/h3&gt;
&lt;p&gt;The major advance of several content databases is splitting your site collection and sub-sited among several content databases based on the content type and content usage. For example, you can have media sites and media data stored in separate content database and separate SQL server, which is tuned, indexed and partitioned to work with BLOB data; or sites which are used for document management, in separate SQL server with content database optimized for textual information. &lt;/p&gt;
&lt;p&gt;If you will store different type of content information inside one big single content database in won&amp;rsquo;t help you to use all advantages of SQL Server to optimize your data usage.&lt;/p&gt;
&lt;h3&gt;Scenario &amp;ndash; Backup/Restore&lt;/h3&gt;
&lt;p&gt;Having several content database makes you data restoration faster, because you need to restore only that content database, where origin site/data located.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;/h3&gt;
&lt;h3&gt;Scenario &amp;ndash; DR&lt;/h3&gt;
&lt;p&gt;Usually when you implement DR strategy your DR box locates outside current network and outside the current organization, and you could have slow network connection there (reasonably slower then inside your network). So, setting SQL mirroring takes a lot of time if you have very big database. Moreover, with the different content databases you can leverage the importance of your data and mirroring to different locations, for example mirroring your vital financial data in one content database to the box outside your enterprise, and other content databases inside your network.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;/h3&gt;
&lt;h3&gt;Tips and Tools&lt;/h3&gt;
&lt;p&gt;Ken describes how to create new sites in new content databases, but what if you already have 200Gb content database and what to split and reorganize your data across several new content databases?! SharePoint doesn&amp;rsquo;t provide OOTB UI features for this. The standard way to reorganized you data for the sub-sites is to use STSADM tool (I will discuss moving site collections separately).&lt;/p&gt;
&lt;p&gt;The way to move your sub-sites to new content database is to follow the next steps&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to Central Administration &amp;gt; Application Management &amp;gt; Content Databases and set the existed content database to &amp;ldquo;Offline&amp;rdquo; mode&lt;/li&gt;
&lt;li&gt;Add new content database in Central Administration &amp;gt; Application Management &amp;gt; Content Databases. (you can use different SQL server). Now all new sites will be created in this content database&lt;/li&gt;
&lt;li&gt;Use the following command to export your site to the disk &amp;ldquo;stsadm -o export -url &lt;a href="http://&amp;lt;path_to_site"&gt;http://&amp;lt;path_to_site&lt;/a&gt;&amp;gt; -filename c:\&amp;lt;exportedSite&amp;gt;.exp -overwrite -nofilecompression -includeusersecurity -cabsize 1024&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;Delete your exported site collection in Central Administration &amp;gt; Application Management &amp;gt; Delete Site Collection&lt;/li&gt;
&lt;li&gt;Create new empty site with the same path, via stsadm &amp;ndash;o createweb/createsite;&lt;/li&gt;
&lt;li&gt;Import you site to the same url, and site will be created in the new content database. Use the following command for this &amp;ldquo;stsadm -o import &amp;ndash;url &lt;a href="http://&amp;lt;path_to_site"&gt;http://&amp;lt;path_to_site&lt;/a&gt;&amp;gt; -filename c:\&amp;lt;location_of_your_exorted_package&amp;gt;.exp -nofilecompression -haltonfatalerror &amp;ndash;includeusersecurity&amp;rdquo;&lt;br /&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now you will have you sub-site in new content database. It&amp;rsquo;s not very user friendly approach, and is an error proned a bit. &lt;/p&gt;
&lt;p&gt;But there is one small tool - &lt;a target="_self" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=263CD480-F6EB-4FA3-9F2E-2D47618505F2&amp;amp;displaylang=en"&gt;SharePoint Administration Tookit&lt;/a&gt;, which helps you to to reorganise the whole site collections. This feature will install a new section inside &amp;ldquo;Applications&amp;rdquo;and you can move your site collection via Central Administration interface.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Resume&lt;/h3&gt;
&lt;p&gt;Plan you site collections / sub-sites content with you database administration guys&lt;/p&gt;
&lt;p&gt;Take into account that you can&amp;rsquo;t split site and site content between content databases, for example you can&amp;rsquo;t specify storing all site&amp;rsquo;s *.avi files in separate content db. I hope it will be changed in the next version of SharePoint, but now site and site content are stored together. &lt;/p&gt;
&lt;h3&gt;&lt;/h3&gt;
&lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1267.entry"&gt;&lt;span style="color:#4563b9;"&gt;Tips to create a Site Collection in new Content Database&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650939" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>SharePoint Mirroring</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/09/28/sharepoint-mirroring.aspx" /><id>/blogs/laflour/archive/2008/09/28/sharepoint-mirroring.aspx</id><published>2008-09-28T12:03:16Z</published><updated>2008-09-28T12:03:16Z</updated><content type="html">&lt;p&gt;There are number of posts and documents about how to setup mirroring of SharePoint content DB, but when I started my mirroring I stumbled over number issues, which I probably missed in documentation and which took some of my time to find out what was wrong. So in this post I’d like summarize all important parts of setting SharePoint mirroring. &lt;/p&gt;  &lt;p&gt;Refer to detailed description in the end of this post to get the initial understanding.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Prepare all you SharePoint Content databases for recovery. Use “&lt;font face="Courier"&gt;&lt;strong&gt;ALTER Database &amp;lt;databasename&amp;gt; SET RECOVERY FULL;&lt;/strong&gt;&lt;/font&gt;“ SQL command against all databases which will participate in backup and mirroring. &lt;/li&gt;    &lt;li&gt;(Optionally) Prepare content databases to be detached from web application, because in future you could rename it. To do this run “&lt;strong&gt;&lt;font face="Courier New"&gt;stsadm -o preparetomove -contentdb SQLSERVER:DBNAME –site &amp;lt;url&amp;gt;&lt;/font&gt;&lt;/strong&gt;”. &lt;/li&gt;    &lt;li&gt;Make the SharePoint farm backup, and restore it on your Disaster Recovery (DR) box. Use OOTB backup/restore – Central Admin –&amp;gt; Operations –&amp;gt; Backup. The reason to restore SharePoint on DR box instead of straight mirroring is to have everything set and configured absolutely the same as on production box, to have minimum restoration time. &lt;/li&gt;    &lt;li&gt;After you restore your instance on DR box close SharePoint Central Admin. You don’t need it anymore :) &lt;/li&gt;    &lt;li&gt;Make &lt;em&gt;&lt;strong&gt;SQL backup &lt;/strong&gt;&lt;/em&gt;of your SharePoint DBs and their LOGs from production box, which will be mirrored. Usually only content databases are mirrored - search and other stuff can be missed, because it’s not so vital as content DB. I had number issues with making SQL backups and restore DBs on DR box, after you restored your new instance, so, I found more convenient to provide new copy of all DBs specially for mirroring. Make this backup with SQL commands “&lt;strong&gt;&lt;font face="Courier New"&gt;BACKUP DATABASE/LOG&lt;/font&gt;&lt;/strong&gt;” and copy those files to DR box. &lt;/li&gt;    &lt;li&gt;Go to SQL Management Studio and delete all SharePoint DB which you want to mirror. &lt;/li&gt;    &lt;li&gt;Restore your databases with “NORECOVERY” attribute. UI doesn’t help you, so we are using SQL command “&lt;strong&gt;&lt;font face="Courier New"&gt;RESTORE DATABASE … NORECOVERY …&lt;/font&gt;&lt;/strong&gt;” for this. &lt;/li&gt;    &lt;li&gt;After restoration completed you will see your DB with new icon and having “(recovering…)” status. Now time to apply the logs with the same “NORECOVERY” attribute and the similar command “&lt;strong&gt;&lt;font face="Courier New"&gt;RESTORE LOG … NORECOVERY…&lt;/font&gt;&lt;/strong&gt;” &lt;/li&gt;    &lt;li&gt;Wait a couple of minutes, allowing SQL server to restore some stuff. &lt;/li&gt;    &lt;li&gt;Now connect to Production SQL instance from DR box, select the database you just restored in DR, and right-mouse clicking, selecting tools-&amp;gt;mirroring. Mirroring Wizards will start. Go through all steps. Ignore mirroring endpoints name difference. But pay attention on “encryption” settings on principal and on mirror boxes – they must be the same. Use next command to change these settings “&lt;strong&gt;&lt;font face="Courier New"&gt;ALTER ENDPOINT Mirroring FOR DATA_MIRRORING (ROLE = PARTNER, ENCRYPTION = SUPPORTED)&lt;/font&gt;&lt;/strong&gt;” to be the same among principal and mirror boxes. &lt;/li&gt;    &lt;li&gt;Activate mirroring in the end of Mirroring Wizard, and you DB status will changed to “principal”/”mirroring”. &lt;/li&gt;    &lt;li&gt;You might have security error, saying that your DR box can’t connect to partner (production box). Go to SQL again and run the following “&lt;strong&gt;&lt;font face="Courier New"&gt;alter database myDatabase set partner = &amp;#39;TCP://abc.domain.net:7024&amp;#39;;&lt;/font&gt;&lt;/strong&gt;” &lt;/li&gt;    &lt;li&gt;Repeat everything from step 6 to 11 for all SharePoint databases. &lt;/li&gt;    &lt;li&gt;To switch to DR box and start using mirrored databases, you need to go to mirroring window again and press “FAILOVER” button. This will switch your databases and DR boxes will be active. Without failover you site on DR box won’t be accessible. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Troubleshooting:&lt;/p&gt;  &lt;p&gt;1) User SQL Management Studio, right mouse click on DB, Tasks-&amp;gt;Launch Database Mirroring Monitor to check the status of your mirroring databases.&lt;/p&gt;  &lt;p&gt;2) You can have the following error “Cannot open database &amp;quot;&amp;lt;…&amp;gt;&amp;quot; requested by the login. The login failed. Login failed for user &amp;#39;….&amp;#39;.” when you try to use “stsadm –o addcontentdb …”. This happens when you DB not in failover status. You need to make your DR failovered (active) and only then add content DB &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;That’s all. I hope this post will save some of your time when you start your SharePoint mirroring.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;More reading:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a title="http://alan328.com/SQL2005_Database_Mirroring_Tutorial.aspx" href="http://alan328.com/SQL2005_Database_Mirroring_Tutorial.aspx"&gt;SQL 2005 Database Mirroring Tutorial&lt;/a&gt;&amp;#160; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-us/library/ms189127.aspx"&gt;Troubleshooting Database Mirroring Deployment&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc262910.aspx"&gt;Whitepaper - Using database mirroring&lt;/a&gt;&amp;#160; &lt;/li&gt;    &lt;li&gt;&lt;a title="http://blogs.technet.com/wbaer/archive/2007/04/23/sql-server-2005-database-mirroring-and-windows-sharepoint-services-3-0-microsoft-office-sharepoint-server-2007-part-1-introduction-overview-and-basics.aspx" href="http://blogs.technet.com/wbaer/archive/2007/04/23/sql-server-2005-database-mirroring-and-windows-sharepoint-services-3-0-microsoft-office-sharepoint-server-2007-part-1-introduction-overview-and-basics.aspx"&gt;http://blogs.technet.com/wbaer/archive/2007/04/23/sql-server-2005-database-mirroring-and-windows-sharepoint-services-3-0-microsoft-office-sharepoint-server-2007-part-1-introduction-overview-and-basics.aspx&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="http://blogs.technet.com/wbaer/archive/2007/05/25/sql-server-2005-database-mirroring-and-windows-sharepoint-services-3-0-microsoft-office-sharepoint-server-2007-part-2-configuration.aspx" href="http://blogs.technet.com/wbaer/archive/2007/05/25/sql-server-2005-database-mirroring-and-windows-sharepoint-services-3-0-microsoft-office-sharepoint-server-2007-part-2-configuration.aspx"&gt;http://blogs.technet.com/wbaer/archive/2007/05/25/sql-server-2005-database-mirroring-and-windows-sharepoint-services-3-0-microsoft-office-sharepoint-server-2007-part-2-configuration.aspx&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="http://blogs.technet.com/wbaer/archive/2007/08/01/sql-server-2005-database-mirroring-and-windows-sharepoint-services-3-0-microsoft-office-sharepoint-server-2007-part-3-failover.aspx" href="http://blogs.technet.com/wbaer/archive/2007/08/01/sql-server-2005-database-mirroring-and-windows-sharepoint-services-3-0-microsoft-office-sharepoint-server-2007-part-3-failover.aspx"&gt;http://blogs.technet.com/wbaer/archive/2007/08/01/sql-server-2005-database-mirroring-and-windows-sharepoint-services-3-0-microsoft-office-sharepoint-server-2007-part-3-failover.aspx&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns%217575E2FFC19135B4%211245.entry"&gt;SharePoint Mirroring&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1649088" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author></entry><entry><title>Starting SharePoint solution and planning your documentation</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/09/28/starting-sharepoint-solution-and-planning-your-documentation.aspx" /><id>/blogs/laflour/archive/2008/09/28/starting-sharepoint-solution-and-planning-your-documentation.aspx</id><published>2008-09-27T18:57:00Z</published><updated>2008-09-27T18:57:00Z</updated><content type="html">&lt;p&gt;When a new SharePoint project is about to start I use the following steps to design and plan solution&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Creating Vision/Scope &lt;/li&gt;
&lt;li&gt;Site structure and Navigation &lt;/li&gt;
&lt;li&gt;Use Case Scenarios &lt;/li&gt;
&lt;li&gt;Data Flow scenario &lt;/li&gt;
&lt;li&gt;Content location &lt;/li&gt;
&lt;li&gt;Site Collection Boundaries &lt;/li&gt;
&lt;li&gt;List of required features and site definitions &lt;/li&gt;
&lt;li&gt;Security: Roles and Permissions &lt;/li&gt;
&lt;li&gt;Page Wireframes: layouts and content types &lt;/li&gt;
&lt;li&gt;Targeting &lt;/li&gt;
&lt;li&gt;Search strategy (scopes, authoritative, best bets)  &lt;/li&gt;
&lt;li&gt;Infrastructure Plan&amp;nbsp; &lt;/li&gt;
&lt;li&gt;Disaster Recovery &lt;/li&gt;
&lt;li&gt;Deployment plan &lt;/li&gt;
&lt;/ol&gt;  &lt;ol&gt;&lt;/ol&gt;
&lt;p&gt;Take into account that SharePoint SDLC differs from standard development, and not all projects require those steps. &lt;/p&gt;
&lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns%217575E2FFC19135B4%211244.entry"&gt;Starting SharePoint solution and planning your documentation&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1649084" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>MS officially supports SharePoint virtualized environment</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/09/27/ms-officially-supports-sharepoint-virtualized-environment.aspx" /><id>/blogs/laflour/archive/2008/09/27/ms-officially-supports-sharepoint-virtualized-environment.aspx</id><published>2008-09-27T09:50:02Z</published><updated>2008-09-27T09:50:02Z</updated><content type="html">&lt;p&gt;Today &lt;a href="http://twitter.com/jthake" target="_blank"&gt;@jthake&lt;/a&gt; posted info about the recent announcement from Microsoft that they finally started to &lt;a href="http://www.sharepointblogs.com/holliday/archive/2008/09/25/vmware-and-sharepoint.aspx" target="_blank"&gt;support “Virtualized SharePoint environment”&lt;/a&gt; for &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Virtual PC &lt;/li&gt;    &lt;li&gt;vmWare &lt;/li&gt;    &lt;li&gt;Win2k8 hyper-v &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;What does it mean for end-users, developers or IT guys?! Nothing. &lt;/p&gt;  &lt;p&gt;It mostly the question of taking the official decision for managers, what and where will be deployed. Because in case of any problems Microsoft will help you in troubleshooting, but not for SharePoint under one of virtualized environment. You must had a installation on physical boxes.&lt;/p&gt;  &lt;p&gt;Now it’s now an issue. They announced support of virtualized SharePoint environments&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns%217575E2FFC19135B4%211242.entry"&gt;MS officially supports SharePoint virtualized environment&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1649047" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>Missed “Edit in Datasheet” in SharePoint 2007</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/09/23/missed-edit-in-datasheet-in-sharepoint-2007.aspx" /><id>/blogs/laflour/archive/2008/09/23/missed-edit-in-datasheet-in-sharepoint-2007.aspx</id><published>2008-09-23T02:26:38Z</published><updated>2008-09-23T02:26:38Z</updated><content type="html">&lt;p&gt;Today they asked about where is my “Edit in Datasheet” item in SharePoint 2007 library ?! Well.. the point why you can’t see this item in library toolbar is that you don’t have Office 2007 installed on your SharePoint server boxes.&lt;/p&gt;  &lt;p&gt;But what if you don’t want to install ALL Office package, because you have really bad environment and want to minimize installation on server?! Do you really have to install all Office applications or not?!&lt;/p&gt;  &lt;p&gt;Unfortunately, Office don’t have a “server” installation, what I actually wanted to see in next version, because if you want to create Word Documents, have Slides library support then you need to install all application from Office Professional 2007 on *&lt;strong&gt;EACH&lt;/strong&gt;* SharePoint application Server in your farm. I don’t find this correct approach. Because you never use office client applications on SharePoint farms and need “Server” functionality only. &lt;/p&gt;  &lt;p&gt;Let’s return back to “Edit in Datasheet”. To have this item in libraries menu you only need to install Access from Office 2007, because it responsible for rendering datasheet in SharePoint 2007. Interesting fact, that SharePoint 2003 used Excel for this.&lt;/p&gt;  &lt;p&gt;Mirror: &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648607" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>SharePoint 2007 migration tips</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/09/18/sharepoint-2007-migration-tips.aspx" /><id>/blogs/laflour/archive/2008/09/18/sharepoint-2007-migration-tips.aspx</id><published>2008-09-17T22:11:00Z</published><updated>2008-09-17T22:11:00Z</updated><content type="html">&lt;p&gt;Working of migration of SPS to MOSS 2007 in these days and would like to share my experience about number of small tricks, which really annoys you if you don’t know them, and which could save hours during your next migration&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Check that SharePoint 2003 doesn’t have Orphans. Use &lt;a href="http://blogs.technet.com/corybu/archive/2007/05/31/sharepoint-orphans-explained.aspx" target="_blank"&gt;this&lt;/a&gt; script for this&lt;/li&gt;    &lt;li&gt;Remove EXE, MSI, DLL extension from blocked types, because these files could exist in your collection and your can’t export such sites. (I usually remove everything from there) &lt;/li&gt;    &lt;li&gt;Check source web.config to migrate all 3&lt;sup&gt;rd&lt;/sup&gt; party Web Parts into new environment (use –haltonwarning in stsadm –o export to find the pages with missed Web Parts and then navigate to source pages to export DWP from there) &lt;/li&gt;    &lt;li&gt;Export with –incluseuseonwers attribute &lt;/li&gt;    &lt;li&gt;Change the maximum upload file size: Central admin -&amp;gt;Application management -&amp;gt;Web Application General Settings. Set 250mb for example, or the size of the biggest file &lt;/li&gt;    &lt;li&gt;Set yourself as secondary admin(stsadm –o siteowner –url &amp;lt;site&amp;gt; –secondarylogin &amp;lt;user_name&amp;gt;), because export wont work against content if you are not admin on target site collections &lt;/li&gt;    &lt;li&gt;Before making export make sure that you are site owner for the sites you are going to export (stsadm –o siteowner –url &amp;lt;site&amp;gt; –secondarylogin &amp;lt;current_account&amp;gt;). Otherwise you can’t create any sub-sites during importing and will get strange errors. &lt;/li&gt;    &lt;li&gt;Use STSADM –o export with cabsize 1024, otherwise you silently miss some files in your export package if your site size more that 25Mb (default value) &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Update: be very careful with renaming database, because if you will do it wrong way you DB is completely screwed, and there is no way to return it back. Refer to this document &lt;a href="http://blogs.technet.com/corybu/archive/2007/06/01/detaching-databases-in-moss-2007-environments.aspx"&gt;http://blogs.technet.com/corybu/archive/2007/06/01/detaching-databases-in-moss-2007-environments.aspx&lt;/a&gt; about the right process how to rename database&lt;/p&gt;  &lt;p&gt;Update 2: Make sure that you have latest SP installed for your SharePoint 2003&lt;/p&gt;  &lt;p&gt;Update 3: Check your publishing pages (if you have any) by trying to edit them. Sometimes they can be broken after migration. You need to use these approaches – &lt;a href="http://stsadm.blogspot.com/2007/08/fix-publishing-pages-page-layout-url.html" target="_blank"&gt;one&lt;/a&gt; and &lt;a href="http://blog.thekid.me.uk/archive/2007/08/20/fixing-page-layout-urls-after-importing-a-publishing-site-in-sharepoint.aspx" target="_blank"&gt;two&lt;/a&gt; to fix it.&lt;/p&gt;  &lt;p&gt;You are welcome to share your migration tricks which saved your time&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns%217575E2FFC19135B4%211227.entry"&gt;SharePoint 2007 migration tips&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648276" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>Farewell to TechEd 2008, Sydney</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/09/07/farewell-to-teched-2008-sydney.aspx" /><id>/blogs/laflour/archive/2008/09/07/farewell-to-teched-2008-sydney.aspx</id><published>2008-09-07T11:02:01Z</published><updated>2008-09-07T11:02:01Z</updated><content type="html">&lt;p&gt;Teched 2008 in Sydney finished. It were amazing 4 days of intensive sessions and parties afterwards.&amp;#160; I attended mostly all SharePoint session about infrastructure, governance and architecture, BizTalk sessions and ASP.NET MVC and LINQ session. The overall impression is high. Not all session were as good as I expected, but SharePoint once where just awesome - Joel Oleson and Michael Noel are just great. Really impressed.&lt;/p&gt;  &lt;p&gt;Got a lot of new info, which trying to sort now.&lt;/p&gt;  &lt;p&gt;The locknote was run by MS “futuronist” architect, describing how nowadays communication changes our life. The resume is that - expose everything to “services” and “context based devices” are&amp;#160; our future.&lt;/p&gt;  &lt;p&gt;Can’t wait the Tech-Ed 2009 in Goldcoast and expecting to deliver my SharePoint presentations at TechEd 2009&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1210.entry"&gt;Farewell to TechEd 2008, Sydney&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1647058" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="General" scheme="http://msmvps.com/blogs/laflour/archive/tags/General/default.aspx" /></entry><entry><title>Attending TechEd, Australia</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/09/02/attending-teched-australia.aspx" /><id>/blogs/laflour/archive/2008/09/02/attending-teched-australia.aspx</id><published>2008-09-02T10:37:20Z</published><updated>2008-09-02T10:37:20Z</updated><content type="html">&lt;p&gt;Going to attend the following TechEd sessions&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/laflour.AttendingTechEdAustralia_5F00_12209/TechEdsessions_5F00_2.jpg"&gt;&lt;img title="TechEdsessions" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="584" alt="TechEdsessions" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/laflour.AttendingTechEdAustralia_5F00_12209/TechEdsessions_5F00_thumb.jpg" width="704" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Mirror: &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1646456" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="General" scheme="http://msmvps.com/blogs/laflour/archive/tags/General/default.aspx" /></entry><entry><title>SharePoint Infrastructure Update (WSS/MOSS) and exception with “Blocked file types” page</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/09/02/sharepoint-infrastructure-update-wss-moss-and-exception-with-blocked-file-types-page.aspx" /><id>/blogs/laflour/archive/2008/09/02/sharepoint-infrastructure-update-wss-moss-and-exception-with-blocked-file-types-page.aspx</id><published>2008-09-01T14:17:29Z</published><updated>2008-09-01T14:17:29Z</updated><content type="html">&lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;After installing SharePoint 2008 (WSS/MOSS) Infrastructure Update from July 2008 you may find that “Blocked file types” page is broken (Central Administration –&amp;gt; Operations –&amp;gt; Blocked file types). Albeit it worked before, 10 mins ago, but now you end up with the following exception &lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;font color="#000080"&gt;Object reference not set to an instance of an object.&amp;#160;&amp;#160; at Microsoft.SharePoint.ApplicationPages.BlockedFileTypePage.InitializeValues()        &lt;br /&gt;&amp;#160;&amp;#160; at Microsoft.SharePoint.ApplicationPages.BlockedFileTypePage.OnLoadComplete(EventArgs e)         &lt;br /&gt;&amp;#160;&amp;#160; at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;What it means, that SharePoint can’t resolve your WebApplicationID (GUID of your site) from Content DB. &lt;/p&gt;  &lt;p&gt;The fully qualified URL for “Blocked file types” looks like “hxxp://&amp;lt;CentralAdmin&amp;gt;:&amp;lt;port&amp;gt;/_admin/BlockedFileType.aspx?WebApplicationId=&lt;strong&gt;&lt;em&gt;fa221a6a-42a2-4a09-8aac-76a31f160880&lt;/em&gt;&lt;/strong&gt;”. &lt;/p&gt;  &lt;p&gt;I have no idea why SharePoint can’t resolve web application after Infrastructure Update, something wrong happened and your site just can’t be found. I didn’t test with SQL Profiler, but expect that nothing returning from Content DB&lt;/p&gt;  &lt;p&gt;To fix this you need just to create new Web Application :) That’s all. At this time the Content DB tables will be updated with new web app and GUID, and “Blocked file types” will start work again.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns%217575E2FFC19135B4%211199.entry"&gt;SharePoint Infrastructure Update (WSS/MOSS) and exception with “Blocked file types” page&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1646390" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>Deploying SharePoint Web Parts as a part of PageLayouts in MOSS 2007</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/08/09/deploying-sharepoint-web-parts-as-a-part-of-pagelayouts-in-moss-2007.aspx" /><id>/blogs/laflour/archive/2008/08/09/deploying-sharepoint-web-parts-as-a-part-of-pagelayouts-in-moss-2007.aspx</id><published>2008-08-08T17:45:00Z</published><updated>2008-08-08T17:45:00Z</updated><content type="html">&lt;p&gt;Web Parts are an important and everywhere used part of SharePoint. Web Parts are documented pretty good and there are several sources describing as just ASP.NET WebParts (&lt;a href="http://www.amazon.com/ASP-NET-2-0-Web-Parts-Action/dp/193239477X/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1213500426&amp;amp;sr=8-1" target="_blank"&gt;Darren Neimke book&lt;/a&gt;) and some &lt;a href="http://msdn.microsoft.com/en-us/library/ms452873.aspx" target="_blank"&gt;resources about Web Parts in SharePoint&lt;/a&gt; as well. But in reality SharePoint WebPart specific stuff is not properly documented, and in this post I&amp;rsquo;d like to publish some tips regarding Web Parts in SharePoint&lt;/p&gt;
&lt;p&gt;&lt;b&gt;General Info &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Not all Web Parts are inherited from &lt;span style="font-family:Courier New;"&gt;System.Web.UI.WebControls.WebParts.&lt;b&gt;WebPart&lt;/b&gt; &lt;/span&gt;class. Some of them comes from &lt;span style="font-family:Courier New;"&gt;Microsoft.SharePoint.WebPartPages.&lt;/span&gt;&lt;b&gt;&lt;span style="font-family:Courier New;"&gt;WebPart&lt;/span&gt;, &lt;/b&gt;which is inherited from the &lt;span style="font-family:Courier New;"&gt;System.Web.UI.WebControls.WebParts.&lt;b&gt;WebPart &lt;/b&gt;&lt;/span&gt;now. When you develop your own Web Parts, in mostly cases you need to inherit from &lt;span style="font-family:Courier New;"&gt;System.Web&lt;/span&gt; WebPart class&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Finding the connections&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;For some tasks you might handle the Web Part connection/disconnection programmatically. For example, connect your Web Part via code or via Page Layouts. To do this you need to know the Consumer and Provider names. It&amp;rsquo;s not the problem for your Web Parts, but how to find the Provider name for the out-of-the-box Web Parts?! For this you need to use Reflector. &lt;/p&gt;
&lt;p&gt;First, to know the class name of SharePoint Web Part you need just put any Web Part to the page and export it to XML. In that XML you will find the assembly and class name.&amp;nbsp; After that open that assembly in Reflector and navigates to the class you need to get Provider name. Scrutinize that Web Part class to find the connections and name of Provider connection. Connection may be not exactly in that class, but in one of the base classes.&lt;/p&gt;
&lt;p&gt;For example for Page Filter Web Parts the Provider name is &amp;ldquo;&lt;span style="font-family:Courier New;"&gt;ITransformableFilterValues&lt;/span&gt;&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Deploying Web Parts with connections&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;If you deploy you pages and want to have Web Parts being already connected for each new page user creates, then you need to connect Web Part via XML description inside Page Layout.&lt;/p&gt;
&lt;p&gt;Connection consists from 3 parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Consumer ID and Name &amp;ndash;which you know, because usually it&amp;rsquo;s you own custom Web Parts &lt;/li&gt;
&lt;li&gt;Provider ID and Name &amp;ndash; I described above how to extract that name &lt;/li&gt;
&lt;li&gt;Name of the parameter you select from dialog box when connect Web Parts manually. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, let&amp;rsquo;s start:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Put any Web Parts to your Page Layout (I use SharePoint Designer for this, because it simplify my work), save page and navigate to the code. &lt;/li&gt;
&lt;li&gt;In code find the &amp;lt;WebPartPages:WebPartZone&amp;gt; section, and there you will find you Web Parts markup tagged with &amp;lt;Components: prefix. &lt;/li&gt;
&lt;li&gt;Find the ProviderID attribute of the Web Parts you want to connect and remember values . These values will be used when we create the connection between Web Parts. &lt;/li&gt;
&lt;li&gt;Open your page in browser to verify it works. &lt;/li&gt;
&lt;li&gt;Connect Web Parts manually, and save the name of the parameter which is shown in the popup dialog box when you connect Web Parts &lt;/li&gt;
&lt;li&gt;Remove connections between Web Parts, and return back to SharePoint designer &lt;/li&gt;
&lt;li&gt;Open the Page Layout code and navigate to the very beginning of document. Try to find the following section &amp;ldquo;&amp;lt;WebPartPages:SPProxyWebPartManager&amp;rdquo;. If you don&amp;rsquo;t have this section you can miss the following step &lt;/li&gt;
&lt;li&gt;Add the &amp;lt;WebPartPages:SPProxyWebPartManager runat=&amp;quot;server&amp;quot; ID=&amp;quot;ProxyWebPartManager&amp;quot;&amp;gt;&amp;nbsp; section inside &amp;ldquo;PlaceHolderMain&amp;rdquo; content holder &lt;/li&gt;
&lt;li&gt;Now, we are ready to create connections. Add the following codesnippet inside SPProxyWebPartManager &lt;/li&gt;
&lt;/ol&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;SPWebPartConnections&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt;            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;WebPartPages:SPWebPartConnection&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ID&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;g_myConnectionName&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;                &lt;span style="color:#ff0000;"&gt;ConsumerConnectionPointID&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;IFilterValues&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ConsumerID&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;WebPartA&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;                &lt;span style="color:#ff0000;"&gt;ProviderConnectionPointID&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ITransformableFilterValues&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ProviderID&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;WebPartB&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;                &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;WebPartPages:TransformableFilterValuesToFilterValuesTransformer&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;MappedConsumerParameterName&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Parameter&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;                &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;WebPartPages:TransformableFilterValuesToFilterValuesTransformer&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;            &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;WebPartPages:SPWebPartConnection&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;SPWebPartConnections&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let&amp;rsquo;s review the &amp;ldquo;blue&amp;rdquo; selections, because it&amp;rsquo;s where connection magic happens&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;
&lt;ul&gt;
&lt;li&gt;g_myConnectionName is the name of current connection, can be any name &lt;/li&gt;
&lt;li&gt;IFilterValues &amp;ndash; Consumer interface name of Web Part which accept connection &lt;/li&gt;
&lt;li&gt;WebPartA &amp;ndash; consumer Web Part ID from the WebPartZone section we found and remembered previously &lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;ITransformableFilterValues&lt;/span&gt; &amp;ndash; Provider interface name of Web Part which provides connection (in this sample I used Page Filter web parts and they have such provider name. Refer to the &amp;ldquo;&lt;b&gt;Finding the connections&lt;/b&gt;&amp;rdquo; section where I described how to extract the names &lt;/li&gt;
&lt;li&gt;WebPartB &amp;ndash; provider Web Part ID from the WebPartZone section we found and remembered previously &lt;/li&gt;
&lt;li&gt;Parameter &amp;ndash; the name from the connection dialog box where you select the parameter &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;10.&amp;nbsp; Save the page layout. Go to SharePoint and create the new page based on that page layout. After page will be created you can find that your Web Parts are already connected. Job done!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Take into account, that you can&amp;rsquo;t change Web Parts connection for pages created for the Page Layouts with predefined Web Part connections.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns%217575E2FFC19135B4%211158.entry"&gt;Deploying SharePoint Web Parts as a part of PageLayouts in MOSS 2007&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1644110" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>ASP.NET Theme across all pages with XMLHttpRequest calls</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/07/28/asp-net-theme-across-all-pages-with-xmlhttprequest-calls.aspx" /><id>/blogs/laflour/archive/2008/07/28/asp-net-theme-across-all-pages-with-xmlhttprequest-calls.aspx</id><published>2008-07-27T14:43:20Z</published><updated>2008-07-27T14:43:20Z</updated><content type="html">&lt;p&gt;ASP.NET Themes is very powerful feature, but some limitations exist when you are trying to apply Themes dynamically.&lt;/p&gt;  &lt;p&gt;For the single page the way to apply theme is to use &lt;/p&gt;  &lt;p&gt;Page.Theme = “&amp;lt;themeName&amp;gt;”; &lt;/p&gt;  &lt;p&gt;inside&amp;#160; the OnPreInit event, but if you try to apply theme for all pages across your site you have two solutions:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;add this code to each of the pages &lt;/li&gt;    &lt;li&gt;apply theme for master.page – and it’s where problem starts &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;ASP.NET master pages don’t support applying themes dynamically – only static support for the all site pages by setting attribute inside web.config.&lt;/p&gt;  &lt;p&gt;But what to do if you need control which theme to apply and you don’t want to add code to every page of your site?! &lt;/p&gt;  &lt;p&gt;The solution for this to create custom HttpModule, where apply theme for Page class inside PreRequestHandlerExecute event.&lt;/p&gt;  &lt;p&gt;See the following code-snippet of the ThemeHttpModule&lt;/p&gt;  &lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;   &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;     &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; public void Init(HttpApplication context)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;     context.PreRequestHandlerExecute += context_PreRequestHandlerExecute;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt; void context_PreRequestHandlerExecute(object sender, EventArgs e)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;     HttpContext context = HttpContext.Current;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;     if (!(context.Handler is Page))&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;         return;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt;     Page page = (Page)context.Handler;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt;     &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  16:&lt;/span&gt;     if ((page != null))&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  17:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  18:&lt;/span&gt;         string themeName = &amp;quot;Default&amp;quot;;  // get theme name from somewhere&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  19:&lt;/span&gt;         page.Theme = themeName;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  20:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  21:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Done. Now you have flexible control which theme to apply in realtime, extracting you theme names from config or from database.&lt;/p&gt;

&lt;p&gt;But there is one case, I’d like point you attention – XMLHttpRequest calls.&lt;/p&gt;

&lt;p&gt;If you have AJAX XMLHttpRequest direct calls - this code won’t work, because server returns you only portion of page, not the full page with header and body. And you can’t apply theme on partial pages.&lt;/p&gt;

&lt;p&gt;To solve this you need to check if it’s partial request or not, inside your HttpModule. In case of ASP.NET AJAX you could use ScriptManager.IsInAsyncPostBack, but for the direct XMLHttpRequest&amp;#160; calls you need to check the header for the Content-Type you are used when create the MSXML object.&lt;/p&gt;

&lt;p&gt;Something like this&lt;/p&gt;

&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
  &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;
    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; // Don&amp;#39;t apply theme for XMLHttpRequest calls, because you are getting part of the page, not the full page&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; if (! string.IsNullOrEmpty(context.Request.ContentType))&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     return;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Now your themes will be applied only on pages, not the partial AJAX calls.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns%217575E2FFC19135B4%211138.entry"&gt;ASP.NET Theme across all pages with XMLHttpRequest calls&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642336" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Web" scheme="http://msmvps.com/blogs/laflour/archive/tags/Web/default.aspx" /><category term=".NET" scheme="http://msmvps.com/blogs/laflour/archive/tags/.NET/default.aspx" /></entry><entry><title>Moving ASP.NET master.page to SharePoint</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/07/10/moving-asp-net-master-page-to-sharepoint.aspx" /><id>/blogs/laflour/archive/2008/07/10/moving-asp-net-master-page-to-sharepoint.aspx</id><published>2008-07-09T13:32:51Z</published><updated>2008-07-09T13:32:51Z</updated><content type="html">&lt;p&gt;In these days SharePoint become more and more popular. There are number of web project which starts directly in SharePoint, but however a lot of project remains out the SharePoint scope, and exists as pure ASP.NET application. &lt;/p&gt;  &lt;p&gt;The one of the common task of migrating ASP.NET application to SharePoint is changing the site landing page to become SharePoint page. But it’s where the problem starts. ASP.NET applications tend to consume different modern tools and technologies like ASP.NET MVC, SilverLight, URL Rewriting and others which seems to be very common in pure ASP.NET development, but could be the potential problems in SharePoint world.&lt;/p&gt;  &lt;p&gt;There are three thing you need to concentrate on&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;1) master.page&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Remove AutoEventWireup=&amp;quot;true&amp;quot; attribute. SharePoint doesn’t support it on all pages; &lt;/li&gt;    &lt;li&gt;User controls are not supported on master.page, so move them to CONTROLTEMPLATES folder and change references &lt;/li&gt;    &lt;li&gt;Check that all classes you inherit from has the namespaces &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;2) CSS&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;SharePoint doesn’t support CSS validation on 100%, so I can hardly recommend something specific here. But what did helped me a lot id debuging and CSS customization is just to have the “clean” CSS file, which resets all customization &lt;a title="http://meyerweb.com/eric/tools/css/reset/" href="http://meyerweb.com/eric/tools/css/reset/"&gt;http://meyerweb.com/eric/tools/css/reset/&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;3) Web.config&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;You need to make sure that you are using the right siteMap defaultProvider (&amp;lt;siteMap section&amp;gt;) from your ASP.NET web.config, otherwise all your SiteMap elements will be considered as Sharepoint Publishing classes elements (if u have MOSS), which are differs from asp.net SiteMap classes &lt;/li&gt;    &lt;li&gt;If you are using URL rewriting or other specific modules you need to create the &amp;lt;system.webServer&amp;gt; section in SharePoint config file and add them there. &lt;/li&gt;    &lt;li&gt;You need to add all your DLLS to the list of SafeControls &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;4) Code&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;You need to have [assembly: AllowPartiallyTrustedCallers()] in your dlls. &lt;/li&gt;    &lt;li&gt;DLLs must be signed &lt;/li&gt;    &lt;li&gt;All classes must have namespaces &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns%217575E2FFC19135B4%211124.entry"&gt;Moving ASP.NET master.page to SharePoint&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1639974" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>2008 MVP Award</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/07/02/2008-mvp-award.aspx" /><id>/blogs/laflour/archive/2008/07/02/2008-mvp-award.aspx</id><published>2008-07-01T23:05:10Z</published><updated>2008-07-01T23:05:10Z</updated><content type="html">&lt;p&gt;Hurray, got the &lt;strong&gt;2008 MVP Award&lt;/strong&gt; today! They re-awarded me again, since year 2005 in [.NET/C#] area for my achievements in “online consulting” ;) &lt;/p&gt;  &lt;p&gt;But this year I’m Australian MVP!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Thinking about changing the area and become SharePoint MVP in the next year :) &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a title="2008 MVP Award" href="http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1117.entry"&gt;2008 MVP Award&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1639051" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term=".NET" scheme="http://msmvps.com/blogs/laflour/archive/tags/.NET/default.aspx" /><category term="Consulting" scheme="http://msmvps.com/blogs/laflour/archive/tags/Consulting/default.aspx" /></entry><entry><title>SharePoint Designer removes tags when saves page layout - “file system” feature workaround</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/06/13/sharepoint-designer-removes-tags-when-saves-page-layout-file-system-feature-workaround.aspx" /><id>/blogs/laflour/archive/2008/06/13/sharepoint-designer-removes-tags-when-saves-page-layout-file-system-feature-workaround.aspx</id><published>2008-06-13T04:05:44Z</published><updated>2008-06-13T04:05:44Z</updated><content type="html">&lt;p&gt;In the current project we are using SharePoint Designer 2007 intensively to create number of PageLayouts, especially to put WebParts there and pre-configure WebParts connections. SPD is not such a bad tool, because there is no alternative for this. But time to time it really buggy and awful that you start thinking if it passed QA team before being released. (event SP1 doesn’t solve a lot of common crucial bugs, which stops you using SPD at all)&lt;/p&gt;  &lt;p&gt;The most disgusting stuff of SharePoint Designer is that it formats your pages markup without asking you. And what’s worse it REMOVES some tags. I really can’t understand that behaviour – WHY it removes what you typed when you save document?!&lt;/p&gt;  &lt;p&gt;Recently, we stumble over the very nasty thing of SPD – accidental formatting. We have a PageLayout with several web parts on the page and we created &amp;lt;SPWebPartConnections&amp;gt; section to predefine WebParts connections. But whenever you save your document, SPD for some reasons removes some of your &amp;lt;SPWebPartConnections&amp;gt;. We spent about 2 hours to understand any dependencies or logic, but without success. It seems that they have some kind of RAND which selects which of the SPWebPartConnections tags to remove. We tried to install several hotfixes for SPD – but nothing works.&lt;/p&gt;  &lt;p&gt;So, the only way is to use other tools, like Visual Studio. But there is a problem. If you are edit your pageLayout in Visual Studio and want to test it, you need to re-deploy your pagelayouts each time, because VS doesn’t support check-in/check-out to SharePoint Content DB. &lt;/p&gt;  &lt;p&gt;But there is alternative way to edit your pages and have check-in support from the Visual Studio. SharePoint has very cool “file system” feature. It means that you can navigate to your PageLayouts from explorer,&amp;#160; open them in any editor and save it back. All your changes will be stored in Content DB(!!)&lt;/p&gt;  &lt;p&gt;To do this your need to open Windows Explorer and navigate to My Network Places. On the left side you will see the “Add Network Places” item. Open it and type there “http://&amp;lt;yoursite&amp;gt;/_catalogs/masterpage/”, type the name of your network folder like “MySite PageLayouts” and press OK.&lt;/p&gt;  &lt;p&gt;Now, if you open the “MySite PageLayouts” item from Windows Explorer-&amp;gt;My Network Places you will see the content of your “_catalogs/masterpage/” SharePoint folder. And now your can open your masterPage or PageLayouts in any editor, edit them and save them. All changes will be stored into ContentDB. But don’t forget to checkout your file before editing (via Sharepoint or SPD)&lt;/p&gt;  &lt;p&gt;So, this trick allows you to edit any SharePoint files and forget about SharePoint Designer issues&lt;/p&gt;  &lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1090.entry"&gt;SharePoint Designer removes tags when saves page layout - “file system” feature workaround&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1634629" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>Page events stop working after using output stream for binary download</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/06/06/page-events-stop-working-after-using-output-stream-for-binary-download.aspx" /><id>/blogs/laflour/archive/2008/06/06/page-events-stop-working-after-using-output-stream-for-binary-download.aspx</id><published>2008-06-05T13:20:36Z</published><updated>2008-06-05T13:20:36Z</updated><content type="html">&lt;p&gt;In my previous SharePoint projects I&amp;#39;ve met the situations when you need to outstreem some binary files, like PDF file or something else, but when you do this by the standard way (how you used to do in normal ASP.NET site) you found that page is &amp;quot;dead&amp;quot; after you streamed you file to the client. By &amp;quot;dead&amp;quot; I mean that it doesn&amp;#39;t respond to any events, and you can&amp;#39;t use this page.&lt;/p&gt; &lt;p&gt;The problem lies in the SharePoint JavaScript files, which are integrated into the each web page, and seems that they protect you from unnecessary double-posts. But unfortunately such behaviour breaks your stream output.&lt;/p&gt; &lt;p&gt;I didn&amp;#39;t have a change to investigate this problem in details, to find out what exactly affects on this, and always solved this by putting stream out in the new popup window. &lt;/p&gt; &lt;p&gt;In these days on SharePoint NGs this question was risen and &amp;quot;&lt;b&gt;andyspears&lt;/b&gt;&amp;quot; &lt;a href="https://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.sharepoint.development_and_programming&amp;amp;tid=cc356848-b0d8-4a60-8176-6df1bd44eb55&amp;amp;cat=&amp;amp;lang=&amp;amp;cr=&amp;amp;sloc=&amp;amp;p=1" target="_blank"&gt;posted&lt;/a&gt; a work-around, how to change the SharePoint JS and return the normal behaviour back.&lt;/p&gt; &lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt; &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#008000;"&gt;//1) Set your button&amp;#39;s client-side click event to: &lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; &lt;span style="color:#006080;"&gt;&amp;quot;exportRequested=true;&amp;quot;&lt;/span&gt; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt; &lt;span style="color:#008000;"&gt;//2) register the following JS: &lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; beforeSubmitJS = &lt;span style="color:#006080;"&gt;&amp;quot;\nvar exportRequested = false; \n&amp;quot;&lt;/span&gt;; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt; beforeSubmitJS += &lt;span style="color:#006080;"&gt;&amp;quot;var beforeFormSubmitFunction = theForm.onsubmit; \n&amp;quot;&lt;/span&gt;; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt; beforeSubmitJS += &lt;span style="color:#006080;"&gt;&amp;quot;theForm.onsubmit = function(){ \n&amp;quot;&lt;/span&gt;; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt; beforeSubmitJS += &lt;span style="color:#006080;"&gt;&amp;quot;var returnVal = beforeFormSubmitFunction(); \n&amp;quot;&lt;/span&gt;; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt; beforeSubmitJS += &lt;span style="color:#006080;"&gt;&amp;quot;if(exportRequested &amp;amp;&amp;amp; returnVal) &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;     {_spFormOnSubmitCalled=false; exportRequested=false;} \n&amp;quot;&lt;/span&gt;; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt; &lt;span style="color:#008000;"&gt;//beforeSubmitJS += &amp;quot;alert(returnVal + &amp;#39;\\n&amp;#39; + _spFormOnSubmitCalled);&amp;quot;; &lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt; beforeSubmitJS += &lt;span style="color:#006080;"&gt;&amp;quot;return returnVal; \n&amp;quot;&lt;/span&gt;; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt; beforeSubmitJS += &lt;span style="color:#006080;"&gt;&amp;quot;}; \n&amp;quot;&lt;/span&gt;; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  16:&lt;/span&gt; &lt;span style="color:#008000;"&gt;//beforeSubmitJS += &amp;quot;alert(theForm.onsubmit);&amp;quot;; &lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  17:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.Page.ClientScript.RegisterStartupScript(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.GetType(), &lt;span style="color:#006080;"&gt;&amp;quot;alterFormSubmitEvent&amp;quot;&lt;/span&gt;, beforeSubmitJS, &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;); &lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Thanks AdnySpears, good work!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1082.entry"&gt;Page events stop working after using output stream for binary download&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1631659" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author><category term="Sharepoint" scheme="http://msmvps.com/blogs/laflour/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>Subclassing Content Query Web Part to override CAML query</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/05/29/subclassing-content-query-web-part-to-override-caml-query.aspx" /><id>/blogs/laflour/archive/2008/05/29/subclassing-content-query-web-part-to-override-caml-query.aspx</id><published>2008-05-28T13:37:27Z</published><updated>2008-05-28T13:37:27Z</updated><content type="html">&lt;p&gt;The Content Query Web Part (CQWP) in MOSS is one of the popular out-of-the-box Publishing components which is used in content management sites, allowing you to get results from different sources.&lt;/p&gt; &lt;p&gt;But sometimes out of the box functionality is not enough to meet your requirements, and you need to customize CQWP. There are several resources describing how to do this - &lt;a href="http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx" target="_blank"&gt;1&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/aa981241.aspx" target="_blank"&gt;2&lt;/a&gt;, &lt;a href="http://www.codeplex.com/ECQWP" target="_blank"&gt;3&lt;/a&gt;, &lt;a href="http://www.codeplex.com/sptoolbox/Release/ProjectReleases.aspx?ReleaseId=11150" target="_blank"&gt;4&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The most important features which are missed in CQWP are:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;overriding query to use custom CAML  &lt;li&gt;enabling web-part connections&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;To implement these functionality you need to subclass ContentByQueryWebPart class and override several methods.&lt;/p&gt; &lt;p&gt;Below I will describe what exactly need to be done to achieve desired behaviour.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Query Override&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;To have custom CAML query in your Web part you need to override CreateChildControls base method. You can find samples how to do this in the references above, but it&amp;#39;s done so implicitly, that you can easily spend hours to find out why you code doesn&amp;#39;t work and gives you different errors&lt;/p&gt; &lt;p&gt;The crucial part is in the way sending the query to the base class within overrided CreateChildControls &lt;/p&gt; &lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt; &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; CreateChildControls()&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.QueryOverride = customQueryString;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.CreateChildControls();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;     QueryOverride = &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Empty;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;     CommonViewFields = &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Empty;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;First, you need to set your custom query to the &amp;quot;this.QueryOverride&amp;quot; to inform base class about query - line 3&lt;/p&gt;
&lt;p&gt;Second, call base CreateChildControls() allowing your query being executed - line 5&lt;/p&gt;
&lt;p&gt;Third and last - &lt;strong&gt;CLEAN&lt;/strong&gt; query and view fields properties - line 7,9. Without this step you will get errors when open your Web Part in edit mode&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Enabling Connection&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The Content Query WP doesn&amp;#39;t accept any connections by default. You need to implement this too. Everything you need to to is just add ConnectionConsumer attribute. But trick in setting the right attribute which is used in Parameter dialog box, when you connect two web-parts.&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; [ConnectionConsumer(&lt;span style="color:#006080;"&gt;&amp;quot;Another WebPart&amp;quot;&lt;/span&gt;, &lt;span style="color:#006080;"&gt;&amp;quot;IFilterValues&amp;quot;&lt;/span&gt;, AllowsMultipleConnections = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;)]&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; SetConnectionInterface(IFilterValues filterProvider)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (filterProvider != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;         &lt;span style="color:#008000;"&gt;// save provider with values&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;         providerValues = filterProvider.ParameterValues;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;         _filterProviders.Add(filterProvider);&amp;nbsp; &lt;span style="color:#008000;"&gt;// variable declaration is List&amp;lt;IFilterValues&amp;gt; _filterProviders = new List&amp;lt;IFilterValues&amp;gt;();&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;         List&amp;lt;ConsumerParameter&amp;gt; parameters = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; List&amp;lt;ConsumerParameter&amp;gt;();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;         &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;         &lt;span style="color:#008000;"&gt;// add params&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt;         parameters.Add(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ConsumerParameter(&lt;span style="color:#006080;"&gt;&amp;quot;param1&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt;                 ConsumerParameterCapabilities.SupportsSingleValue |&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt;                 ConsumerParameterCapabilities.SupportsEmptyValue));&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt;         parameters.Add(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ConsumerParameter(&lt;span style="color:#006080;"&gt;&amp;quot;param2&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  16:&lt;/span&gt;                 ConsumerParameterCapabilities.SupportsMultipleValues |&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  17:&lt;/span&gt;                 ConsumerParameterCapabilities.SupportsAllValue |&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  18:&lt;/span&gt;                 ConsumerParameterCapabilities.SupportsEmptyValue));&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  19:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  20:&lt;/span&gt;         filterProvider.SetConsumerParameters(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ReadOnlyCollection&amp;lt;ConsumerParameter&amp;gt;(parameters));&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  21:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  22:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  23:&lt;/span&gt; }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Method name can be any, but pay attention which provider you are using . WebPart providers send data via different provider interfaces, for example when you are working with Filtering web parts (like &amp;quot;Current User Filter&amp;quot; web part) then you need to &amp;quot;listen&amp;quot; your incoming connections via IFilterValues (thx Mutaz for this findings), for other WB it could be IWebPartField or IWebPartRow. &lt;/p&gt;
&lt;p&gt;If you are expecting to get data from WP via unsupported provider you connection link will be dimmed&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Practical Sample&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;@d2design kindly asked to provide practical sample, for example how to use current user as a keyword :)&lt;/p&gt;
&lt;p&gt;Actually, it&amp;#39;s good example which shows how use both features I described. &lt;/p&gt;
&lt;p&gt;To do this you need to have:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;ShareServices (SSP) with UserProfile, where current userName is stored 
&lt;li&gt;&amp;quot;Current User Filter&amp;quot; WebPart, to get the userName from SSP. It returns you logged user name by default (not necessary actually, as well as SSP, because you could resolve you user name via standard asp.net User class when construct custom query) 
&lt;li&gt;Enable WebPart connections as I described above. You need to use IFilterValue interface for &amp;quot;Current User Filter&amp;quot; and store your incoming user name in variable. 
&lt;li&gt;Override query to include your userName in resulted custom query.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;TIPS:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When you are quering content which is not published and approved (like pages) you wont be able to see that content on the page in final view. You data will be available in page edit mode only, because they are treated as &amp;quot;draft&amp;quot; data.&lt;/li&gt;
&lt;li&gt;&amp;lt;OrderBy&amp;gt;CAML tag is not parsed by CQWP, you need to remove it from your query and set the related order field of CQWP class&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Mirror: &lt;a href="http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1069.entry"&gt;Subclassing Content Query Web Part to override CAML query&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1628334" width="1" height="1"&gt;</content><author><name>laflour</name><uri>http://msmvps.com/members/laflour/default.aspx</uri></author></entry><entry><title>MOSS Content Deployment Jobs - Lookup Fields and requirements</title><link rel="alternate" type="text/html" href="/blogs/laflour/archive/2008/05/22/moss-content-deployment-jobs-lookup-fields-and-requirements.aspx" /><id>/blogs/laflour/archive/2008/05/22/moss-content-deployment-jobs-lookup-fields-and-requirements.aspx</id><published>2008-05-22T12:19:56Z</published><updated>2008-05-22T12:19:56Z</updated><content type="html">&lt;p align="justify"&gt;Content Deployment Job is a nice feature of MOSS 2007 to secure your main site from unauthorized and accidental changes and have approved content being deployed via standard MOSS functionality.&lt;/p&gt; &lt;p align="justify"&gt;But Content Deployment Jobs are a bit tricky :(&lt;/p&gt; &lt;p align="justify"&gt;There are some areas which I&amp;#39;d like to highlight in the current post, which helps you to save hours in configuring Content Deployments Path and Jobs&lt;/p&gt; &lt;p align="justify"&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt; &lt;p align="justify"&gt;&lt;strong&gt;&lt;u&gt;Requirements&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p align="justify"&gt;To have successful contend deployment you need to prepare your sites correctly. There is a great &lt;a href="http://blogs.technet.com/stefan_gossner/archive/2008/04/11/deep-dive-into-the-sharepoint-content-deployment-and-migration-api-part-6.aspx"&gt;post from Stefan Gossner&lt;/a&gt; who provided detailed explanations to all pre-requirement.&lt;/p&gt; &lt;p align="justify"&gt;Just to summarize, you need:&lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;div align="justify"&gt;Destination Site without any template pages (don&amp;#39;t use &amp;quot;Blank&amp;quot; template even)&lt;/div&gt; &lt;li&gt; &lt;div align="justify"&gt;Deploy features to Source and Destination sites&lt;/div&gt; &lt;li&gt; &lt;div align="justify"&gt;Activate features ONLY on Destination site&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p align="justify"&gt;&amp;nbsp;&lt;/p&gt; &lt;p align="justify"&gt;&lt;strong&gt;&lt;u&gt;Incremental Deployment&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p align="justify"&gt;When you set deployment path and created your first job you need to do full deployment (&amp;quot;Deploy all content&amp;quot; option) first, and after it&amp;#39;s done set the incremental deployment.&lt;/p&gt; &lt;p align="justify"&gt;Your incremental job could fail with the next exception&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;quot;&lt;font size="1"&gt;Violation of PRIMARY KEY constraint &amp;#39;PK__#ExportObjects____50430BFC&amp;#39;. Cannot insert duplicate key in object &amp;#39;dbo.#ExportObjects&amp;#39;&lt;/font&gt;.&amp;quot;&lt;/p&gt;&lt;/blockquote&gt; &lt;p align="justify"&gt;The reason is that SP1 for MOSS changed the document versioning system, but no changes where done to Content Deployment Job functionality. To solve this issue&amp;nbsp; you may need to install the following hotfix &lt;a title="http://support.microsoft.com/kb/950279" href="http://support.microsoft.com/kb/950279"&gt;http://support.microsoft.com/kb/950279&lt;/a&gt; or disable minor versioning for specific lists (google to find details about this)&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Lookup fields&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p align="justify"&gt;The biggest trick in Content Deployment Jobs relates to Lookup fields deployed via Feature. I think that the following exception will be familiar for those who tried run Content Deployment Jobs for Site with Lookup Fields feature&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font size="1"&gt;The element &amp;#39;FieldTemplate&amp;#39; in namespace &amp;#39;urn:deployment-manifest-schema&amp;#39; has invalid child element &amp;#39;Field&amp;#39; in namespace &amp;#39;http://schemas.microsoft.com/sharepoint/&amp;#39;. List of possible elements expected: &amp;#39;Field&amp;#39; in namespace &amp;#39;urn:deployment-manifest-schema&amp;#39;. at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(ValidationEventHandler eventHandler, Object sender, XmlSchemaValidationException e, XmlSeverityType severity) at System.Xml.Schema.XmlSchemaValidator.ElementValidationError(XmlQualifiedName name, ValidationState context, ValidationEventHandler eventHandler, Object sender, String sourceUri, Int32 lineNo, Int32 linePos, Boolean getParticles) at System.Xml.Schema.XmlSchemaValidator.ValidateElementContext(XmlQualifiedName elementName, Boolean&amp;amp; invalidElementInContext) at System.Xml.Schema.XmlSchemaValidator.ValidateElement(String localName, String namespaceUri, XmlSchemaInfo schemaInfo, String xsiType, String xsiNil, String xsiSchemaLocation, String xsiNoNamespaceSchemaLocation) at System.Xml.XsdValidatingReader.ProcessElementEvent() at System.Xml.XsdValidatingReader.ProcessReaderEvent() at System.Xml.XsdValidatingReader.Read() at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObject) at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope) at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream) at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream) at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader) at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects() at Microsoft.SharePoint.Deployment.SPImport.Run()&amp;nbsp; &lt;/font&gt; &lt;p&gt;&lt;font size="1"&gt;5/22/2008 11:14 AM Content deployment job &amp;#39;Remote import job for job with sourceID = 0ffd575d-df2f-474f-83b6-f3454f2e7d0d&amp;#39; failed.The exception thrown was &amp;#39;System.Xml.Schema.XmlSchemaValidationException&amp;#39; : &amp;#39;The element &amp;#39;FieldTemplate&amp;#39; in namespace &amp;#39;urn:deployment-manifest-schema&amp;#39; has invalid child element &amp;#39;Field&amp;#39; in namespace &amp;#39;http://schemas.microsoft.com/sharepoint/&amp;#39;. List of possible elements expected: &amp;#39;Field&amp;#39; in namespace &amp;#39;urn:deployment-manifest-schema&amp;#39;.&amp;#39;&lt;/font&gt; &lt;/p&gt;&lt;/blockquote&gt; &lt;p align="justify"&gt;The problems is exactly in deployment scripts of Lookup fields. There are several samples how to deploy lookup fields via feature (&lt;a title="http://www.sharepointnutsandbolts.com/2007/04/feature-to-create-lookup-fields-on.html" href="http://www.sharepointnutsandbolts.com/2007/04/feature-to-create-lookup-fields-on.html"&gt;http://www.sharepointnutsandbolts.com/2007/04/feature-to-create-lookup-fields-on.html&lt;/a&gt;) but all of them are not suitable for the Content Deployment Jobs. Because you will get the exception which I posted above.&lt;/p&gt; &lt;p align="justify"&gt;The only way to find out why this happens is to use 3rd party tools (SharepointSpy or FieldsExplorer) to compare the SchemaXML of Lookup Fields after deployment via FeatureReceiver. So, after scrutinizing this issue I found out that deploying Lookup Fields via FeatureReceiver differs from Lookup fields create via Central Admin Web site. FeatureReceiver deployment adds additional attribute &lt;strong&gt;&amp;quot;xmlns=&amp;quot;http://schemas.microsoft.com/sharepoint/&amp;quot;&lt;/strong&gt; to the Lookup SchemaXML which breaks the Content Deployment Job.&lt;/p&gt; &lt;p align="justify"&gt;So, the solution is simple - verify the published schema in FeatureReceiver before calling Update() method for Lookup Field and remove this attribute.&lt;/p&gt; &lt;p align="