<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8299485070499156242</id><updated>2012-02-16T11:55:30.666-06:00</updated><category term='Branding'/><category term='Feature Activation'/><category term='ContentByQueryWebPart'/><category term='Training'/><category term='Custom ContentByQueryWebPart'/><title type='text'>SharePointNista</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sharepointnista.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sharepointnista.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>SharePointNista</name><uri>http://www.blogger.com/profile/13914021243627835393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_yFn7iyFnMBE/S6DrACTIWEI/AAAAAAAABw4/VlQAM8rt7x8/S220/davidn_profile.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8299485070499156242.post-9137132996538622556</id><published>2010-03-27T16:31:00.001-05:00</published><updated>2010-03-27T16:33:30.869-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Branding'/><title type='text'>Do not enable builtin theme if you custom brand your site</title><content type='html'>Our first iteration package was deployed last Friday, which mostly includes the branded piece for the public site. We scrambled until late evening to sort out some entangled loose ends. The goal is to provide a custom MasterPage, some custom ASP.NET webpartpages, a couple of content query web parts, and with some branded CSS files.&lt;br /&gt;&lt;br /&gt;During our first pass, what threw me off was, the look and feel of masterpage. Even though it properly registered with all of css files, seems to get altered with some HEX values in it&lt;br /&gt;I expected my CSS to render as follow:&lt;br /&gt;&lt;br /&gt;&amp;lt;link href=&amp;quot;/_layouts/1033/styles/Themable/MyStyle.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;lt;/link&amp;gt;&lt;br /&gt;&lt;br /&gt;Instead, I got&lt;br /&gt;&lt;br /&gt;&amp;lt;link href=&amp;quot;%E2%80%9D/_themes/%3Ci&amp;quot; rel=&amp;quot;”stylesheet”&amp;quot; type=&amp;quot;”text/css”&amp;quot;&amp;gt;&amp;lt;/link&amp;gt;[UniqueCounter#]/mystyle-&amp;lt;i&amp;gt;[u=UniqueHex#]&amp;lt;/i&amp;gt;.css?ctag=&amp;lt;i&amp;gt;[UniqueCounter#]&amp;lt;/i&amp;gt;”/&amp;gt;&lt;br /&gt;&lt;br /&gt;I thought my package misses some of intended css file, but it wasn't the case.&amp;nbsp; The culprit is actually the OOB enabled theme.&amp;nbsp; SharePoint will place the enabled theme with some higher precedence then the custom stylesheets.&amp;nbsp; After revert the site theme to the default setting (or None), everything render correctly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8299485070499156242-9137132996538622556?l=sharepointnista.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointnista.blogspot.com/feeds/9137132996538622556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/do-not-enable-builtin-theme-if-you.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/9137132996538622556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/9137132996538622556'/><link rel='alternate' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/do-not-enable-builtin-theme-if-you.html' title='Do not enable builtin theme if you custom brand your site'/><author><name>SharePointNista</name><uri>http://www.blogger.com/profile/13914021243627835393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_yFn7iyFnMBE/S6DrACTIWEI/AAAAAAAABw4/VlQAM8rt7x8/S220/davidn_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299485070499156242.post-5989949888781715968</id><published>2010-03-23T10:52:00.003-05:00</published><updated>2010-03-24T08:49:42.227-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Feature Activation'/><title type='text'>Feature Activation – Scope – Dependency Management</title><content type='html'>I recently run into a problem with deploy my solution.&amp;nbsp; It complains about scope dependency:&lt;br /&gt;&lt;pre class="brush: csharp; ruler: true; collapse: true; auto-links: false;"&gt;Error occurred in deployment step 'Activate Features': Dependency feature 'Branding.CSSRegistration' (id: 8d91419f-7782-47ac-85fc-a23eeb3b44a1) for feature 'Portal.MasterPage' (id: 791a6ba1-1d18-43a6-ae2b-3c98dfaaa459) is not activated at this scope&lt;/pre&gt;My rabbit hole started with light reading to refresh my memory about &lt;a href="http://msdn.microsoft.com/en-us/library/aa543162%28office.14%29.aspx" target="_blank"&gt;Activation Dependencies and Scope&lt;/a&gt;, I also recommend &lt;a href="http://rasor.wordpress.com/2008/11/02/wss30-adm-webapps-sitecollections-sites/" target="_blank"&gt;this article&lt;/a&gt; by Rasor to get a solid foundation before trouble shooting this problem.&lt;br /&gt;Both of my features are deployed at the same level, but as you can see in the package explore, it the CSSRegistration was pushed out after the MasterPage&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_yFn7iyFnMBE/S6jylmJyJKI/AAAAAAAAByU/EhKNX8l6hfc/s1600-h/image%5B8%5D.png"&gt;&lt;img alt="image" border="0" height="349" src="http://lh6.ggpht.com/_yFn7iyFnMBE/S6jymoG_OWI/AAAAAAAAByY/8SbxZYZvgoc/image_thumb%5B6%5D.png?imgmax=800" style="border: 0px none; display: block; float: none; margin: 0px auto;" title="image" width="430" /&gt;&lt;/a&gt; &lt;br /&gt;Using the UP/Down buttons to move around the features order, I was able to resolve this issue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8299485070499156242-5989949888781715968?l=sharepointnista.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointnista.blogspot.com/feeds/5989949888781715968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/feature-activation-scope-dependency.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/5989949888781715968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/5989949888781715968'/><link rel='alternate' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/feature-activation-scope-dependency.html' title='Feature Activation – Scope – Dependency Management'/><author><name>SharePointNista</name><uri>http://www.blogger.com/profile/13914021243627835393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_yFn7iyFnMBE/S6DrACTIWEI/AAAAAAAABw4/VlQAM8rt7x8/S220/davidn_profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_yFn7iyFnMBE/S6jymoG_OWI/AAAAAAAAByY/8SbxZYZvgoc/s72-c/image_thumb%5B6%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299485070499156242.post-3434966091168198436</id><published>2010-03-21T04:16:00.002-05:00</published><updated>2010-03-24T08:50:05.932-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Training'/><title type='text'>Irony About Free SharePoint Event</title><content type='html'>You know it’s a free event (doesn’t mean it has no value), when their SharePoint site throws an exception like this one&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_yFn7iyFnMBE/S6Xj9LLjeiI/AAAAAAAAByM/8n_wz9HYKKk/s1600-h/image%5B6%5D.png"&gt;&lt;img alt="image" border="0" height="152" src="http://lh3.ggpht.com/_yFn7iyFnMBE/S6Xj9uPn6DI/AAAAAAAAByQ/hDki25WpUVU/image_thumb%5B4%5D.png?imgmax=800" style="border: 0px none; display: inline;" title="image" width="578" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8299485070499156242-3434966091168198436?l=sharepointnista.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointnista.blogspot.com/feeds/3434966091168198436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/irony-about-free-sharepoint-event.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/3434966091168198436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/3434966091168198436'/><link rel='alternate' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/irony-about-free-sharepoint-event.html' title='Irony About Free SharePoint Event'/><author><name>SharePointNista</name><uri>http://www.blogger.com/profile/13914021243627835393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_yFn7iyFnMBE/S6DrACTIWEI/AAAAAAAABw4/VlQAM8rt7x8/S220/davidn_profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_yFn7iyFnMBE/S6Xj9uPn6DI/AAAAAAAAByQ/hDki25WpUVU/s72-c/image_thumb%5B4%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299485070499156242.post-8984277730199913283</id><published>2010-03-21T03:56:00.001-05:00</published><updated>2010-03-24T08:50:21.479-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Training'/><title type='text'>TwinCities SharePoint Saturday After Thoughts</title><content type='html'>It's good to see a good turn-out this year at the &lt;a href="http://www.sharepointsaturday.org/default.aspx"&gt;TwinCities SharePoint Satuday&lt;/a&gt;.&amp;nbsp; I hadn't been to prior years' event to get a good comparison. Overall, it's a good and hungry crowd for SharePoint knowledge.&amp;nbsp; And literally, these folks need some nourishment, they camped in the build since 8:00a in the morning.&lt;br /&gt;&lt;br /&gt;Audience of my session were more interactive, making it a joy to speak and share at the event.&amp;nbsp; The slide for my talk can be downloaded &lt;a href="http://www.slideshare.net/davidnguy/"&gt;here&lt;/a&gt;. I couldn't demo much during the presentation due to poor connection of the guest wireless network.&amp;nbsp; The U is cutting down its budget, everything else is effected by it, including the bandwidth.&lt;br /&gt;&lt;br /&gt;It'd be OK if the demo could be ran off the local box without having to rely on a internet connection. Mine was not the case.&amp;nbsp; How can one demo a hyper-v environment from a shady Dell Latitude D600 that bought for less than $500 without internet? This is certainly embarrassing and something that needs get improved.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;I am in the middle of the a major deployment, which make me a very tired Dad.&amp;nbsp; Not only that, my company party is on the same day.&amp;nbsp; Almost lost my voice by day end.&amp;nbsp; I will respond to everyone's request and comments shortly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8299485070499156242-8984277730199913283?l=sharepointnista.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointnista.blogspot.com/feeds/8984277730199913283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/twincities-sharepoint-saturday-after.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/8984277730199913283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/8984277730199913283'/><link rel='alternate' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/twincities-sharepoint-saturday-after.html' title='TwinCities SharePoint Saturday After Thoughts'/><author><name>SharePointNista</name><uri>http://www.blogger.com/profile/13914021243627835393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_yFn7iyFnMBE/S6DrACTIWEI/AAAAAAAABw4/VlQAM8rt7x8/S220/davidn_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299485070499156242.post-115966051659623874</id><published>2010-03-18T17:12:00.002-05:00</published><updated>2010-03-24T08:50:54.926-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ContentByQueryWebPart'/><title type='text'>Exception when adding a content query Web Part</title><content type='html'>In my previous post, the line where AddWebart was called throws an inexplicable exception “Exception has been thrown by the target of an invocation." The strange things is this exception only encounter the first time when the feature was deployed and activated.&amp;nbsp; &lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_yFn7iyFnMBE/S6KlZ7hDhAI/AAAAAAAAByE/UTs3t9C8zJY/s1600-h/image%5B10%5D.png"&gt;&lt;img alt="image" border="0" height="210" src="http://lh4.ggpht.com/_yFn7iyFnMBE/S6KlajALfgI/AAAAAAAAByI/lidYVmrkHkI/image_thumb%5B8%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="525" /&gt;&lt;/a&gt;&lt;br /&gt;It seems to me it only occurs the first time since it didn’t have enough time to load the list content, but after that, everything went fine.&amp;nbsp; So just go ahead and wrap it with a try/catch block&lt;br /&gt;&lt;pre class="brush: csharp; ruler: true; collapse: true; auto-links: false;"&gt;try&lt;br /&gt;{                        &lt;br /&gt;LatestNewsCQWP webPart = (LatestNewsCQWP)manager.ImportWebPart(reader, out errorMessage);                        &lt;br /&gt;manager.AddWebPart(webPart, "RightColumn", 1);&lt;br /&gt;manager.SaveChanges(webPart);&lt;br /&gt;}&lt;br /&gt;catch {}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8299485070499156242-115966051659623874?l=sharepointnista.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointnista.blogspot.com/feeds/115966051659623874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/exception-when-adding-content-query-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/115966051659623874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/115966051659623874'/><link rel='alternate' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/exception-when-adding-content-query-web.html' title='Exception when adding a content query Web Part'/><author><name>SharePointNista</name><uri>http://www.blogger.com/profile/13914021243627835393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_yFn7iyFnMBE/S6DrACTIWEI/AAAAAAAABw4/VlQAM8rt7x8/S220/davidn_profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_yFn7iyFnMBE/S6KlajALfgI/AAAAAAAAByI/lidYVmrkHkI/s72-c/image_thumb%5B8%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299485070499156242.post-7288355154295989779</id><published>2010-03-18T15:00:00.002-05:00</published><updated>2010-03-24T08:51:18.860-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Custom ContentByQueryWebPart'/><title type='text'>Add Custom Content Query Web Part Programmatically</title><content type='html'>&lt;pre&gt;I’ve struggling to figure out how to add a CQWP to my custom default webpartpage in the previous post. This webpart pulls content from a list of type blog post and group items by category. The initial effort led me to following block of code. Add off course, it failed&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: xx-small;"&gt;LatestNewsCQWP webPart = (LatestNewsCQWP)GetWebPart(web, WebPartFileName);&lt;br /&gt;using (webPart)&lt;br /&gt;{&lt;br /&gt;webPart.WebUrl = "/news";&lt;br /&gt;webPart.ListUrl = "/news/Categories";&lt;br /&gt;webPart.Title = WebPartTitle;&lt;br /&gt;webPart.ServerTemplate =&lt;br /&gt;webPart.GroupBy = "PostCategory";&lt;br /&gt;webPart.ItemStyle = "CustomStyle";&lt;br /&gt;webPart.ListName = "Post";&lt;br /&gt;webPart.ItemXslLink = "/Style Library/XSL Style Sheets/CustomItemStyle.xsl";&lt;br /&gt;webPart.CommonViewFields = "Title,Text;Body,RichHTML;Author,User;PostCategory,Lookup;NumComments,Lookup;PublishedDate,Date;LinkUrl,Text";&lt;br /&gt;&lt;br /&gt;using (SPLimitedWebPartManager manager = web.GetLimitedWebPartManager(DefaultFileName, PersonalizationScope.Shared))&lt;br /&gt;{&lt;br /&gt;//if web part already exists then return&lt;br /&gt;foreach (System.Web.UI.WebControls.WebParts.WebPart oldWebPart in manager.WebParts)&lt;br /&gt;{&lt;br /&gt;if (oldWebPart is LatestNewsCQWP)&lt;br /&gt;{&lt;br /&gt;manager.DeleteWebPart(oldWebPart);&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;manager.AddWebPart(webPart, "RightColumn", 1);&lt;br /&gt;manager.SaveChanges(webPart);&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;The next attempt based off a &lt;a href="http://vspug.com/michael/2009/05/27/splimitedwebpartmanager-importwebpart-how-microsoft-does-it/" target="_blank"&gt;suggestion&lt;/a&gt; by Michael Hoffer, and it got me to the right track.  The key here is to use the ImportWebPart method against an existing webpart from the site catalog&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: xx-small;"&gt;public override void FeatureActivated(SPFeatureReceiverProperties properties)&lt;br /&gt;{&lt;br /&gt;using (SPSite site = properties.Feature.Parent as SPSite)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;// back up the original home page            &lt;br /&gt;SPWeb web = site.RootWeb;&lt;br /&gt;&lt;br /&gt;var defaultPage = web.Files[DefaultFileName];&lt;br /&gt;var originalStream = defaultPage.OpenBinaryStream();&lt;br /&gt;web.Files.Add(BackupFileName, originalStream, true);&lt;br /&gt;&lt;br /&gt;// move the new default page to default.aspx&lt;br /&gt;var newDefaultPage = web.Files["CustomDefault.aspx"];&lt;br /&gt;var newFileStream = newDefaultPage.OpenBinaryStream();&lt;br /&gt;defaultPage.SaveBinary(newFileStream);&lt;br /&gt;&lt;br /&gt;//Add LatestNewsWebPart&lt;br /&gt;&lt;br /&gt;using (SPLimitedWebPartManager manager = web.GetLimitedWebPartManager(DefaultFileName, PersonalizationScope.Shared))&lt;br /&gt;{&lt;br /&gt;//if web part already exists then return&lt;br /&gt;foreach (System.Web.UI.WebControls.WebParts.WebPart oldWebPart in manager.WebParts)&lt;br /&gt;{&lt;br /&gt;if (oldWebPart is LatestNewsCQWP)&lt;br /&gt;{&lt;br /&gt;manager.DeleteWebPart(oldWebPart);&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;string errorMessage;&lt;br /&gt;string url = web.Url + "/_catalogs/wp/" + WebPartFileName;&lt;br /&gt;XmlTextReader reader = new XmlTextReader(new StringReader(web.GetFileAsString(url)));&lt;br /&gt;LatestNewsCQWP webPart = (LatestNewsCQWP)manager.ImportWebPart(reader, out errorMessage);&lt;br /&gt;manager.AddWebPart(webPart, "RightColumn", 1);&lt;br /&gt;manager.SaveChanges(webPart);&lt;br /&gt;}&lt;br /&gt;web.Update();&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8299485070499156242-7288355154295989779?l=sharepointnista.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointnista.blogspot.com/feeds/7288355154295989779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/add-custom-content-query-web-part.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/7288355154295989779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/7288355154295989779'/><link rel='alternate' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/add-custom-content-query-web-part.html' title='Add Custom Content Query Web Part Programmatically'/><author><name>SharePointNista</name><uri>http://www.blogger.com/profile/13914021243627835393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_yFn7iyFnMBE/S6DrACTIWEI/AAAAAAAABw4/VlQAM8rt7x8/S220/davidn_profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299485070499156242.post-3717933456272806332</id><published>2010-03-17T15:42:00.005-05:00</published><updated>2010-03-24T08:52:13.830-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Branding'/><title type='text'>Create Custom Default Page for SharePoint 2010 Team Site</title><content type='html'>&lt;style&gt;&lt;!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-520092929 1073786111 9 0 415 0;}@font-face {font-family:Consolas; panose-1:2 11 6 9 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:-520092929 1073806591 9 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-priority:1; mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin-top:0in; margin-right:0in; margin-bottom:10.0pt; margin-left:0in; mso-pagination:widow-orphan; font-size:11.0pt; mso-bidi-font-size:10.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}.MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-bidi-font-size:10.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}.MsoPapDefault {mso-style-type:export-only; margin-bottom:10.0pt;}@page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;}div.WordSection1 {page:WordSection1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;I was able to custom my default page after some hair pulling. The steps are illustrated below:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;Step 1 -Make sure your IDE is attached to the right process, i.e, OWSTIMERV4.EXE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_yFn7iyFnMBE/S6FAMMJ2f-I/AAAAAAAABxg/F3fVIawsO7o/s1600-h/OWSTIMER.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_yFn7iyFnMBE/S6FAMMJ2f-I/AAAAAAAABxg/F3fVIawsO7o/s320/OWSTIMER.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; Step 2 - Update the elements manifest to tell where to find the custom file, and where it needs to deploy to.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;style&gt;&lt;!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-520092929 1073786111 9 0 415 0;}@font-face {font-family:Consolas; panose-1:2 11 6 9 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:-520092929 1073806591 9 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-priority:1; mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin-top:0in; margin-right:0in; margin-bottom:10.0pt; margin-left:0in; mso-pagination:widow-orphan; font-size:11.0pt; mso-bidi-font-size:10.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}.MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-bidi-font-size:10.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}.MsoPapDefault {mso-style-type:export-only; margin-bottom:10.0pt;}@page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;}div.WordSection1 {page:WordSection1;}--&gt;&lt;/style&gt;  &lt;br /&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;"&gt;xml&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt; &lt;/span&gt;&lt;span style="color: red; font-family: Consolas; font-size: 9.5pt;"&gt;version&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;"&lt;span style="color: blue;"&gt;1.0&lt;/span&gt;"&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;encoding&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;utf-8&lt;/span&gt;"&lt;span style="color: blue;"&gt;?&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;"&gt;Elements&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt; &lt;/span&gt;&lt;span style="color: red; font-family: Consolas; font-size: 9.5pt;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;"&lt;span style="color: blue;"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;"&gt;Module&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt; &lt;/span&gt;&lt;span style="color: red; font-family: Consolas; font-size: 9.5pt;"&gt;Name&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;"&lt;span style="color: blue;"&gt;CustomDefaultPage&lt;/span&gt;"&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;Url&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;""&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;RootWebOnly&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;true&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;"&gt;File&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt; &lt;/span&gt;&lt;span style="color: red; font-family: Consolas; font-size: 9.5pt;"&gt;Path&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;"&lt;span style="color: blue;"&gt;CustomDefaultPage\CustomDefault.aspx&lt;/span&gt;"&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;Url&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;CustomDefault.aspx&lt;/span&gt;"&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;IgnoreIfAlreadyExists&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;TRUE&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;nbsp; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;"&gt;Module&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;"&gt;Elements&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_yFn7iyFnMBE/S6FCJduXBMI/AAAAAAAABxo/slyyYmz5AOM/s1600-h/Feature+Manifest.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_yFn7iyFnMBE/S6FCJduXBMI/AAAAAAAABxo/slyyYmz5AOM/s320/Feature+Manifest.png" style="cursor: move;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;Step 3 - Set up post build commands &lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_yFn7iyFnMBE/S6FCjTDk7KI/AAAAAAAABxw/NIXoJBgeGkk/s1600-h/netstopsptimerv4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_yFn7iyFnMBE/S6FCjTDk7KI/AAAAAAAABxw/NIXoJBgeGkk/s320/netstopsptimerv4.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;Step 4 - Create Event Receiver&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_yFn7iyFnMBE/S6FDPXDagaI/AAAAAAAABx4/LAIG9KSKteM/s1600-h/Add+Event+Receiver.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_yFn7iyFnMBE/S6FDPXDagaI/AAAAAAAABx4/LAIG9KSKteM/s320/Add+Event+Receiver.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; FeatureActivated(&lt;span style="color: #2b91af;"&gt;SPFeatureReceiverProperties&lt;/span&gt; properties)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// back up the original home page&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SPSite&lt;/span&gt; site = properties.Feature.Parent &lt;span style="color: blue;"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SPSite&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SPWeb&lt;/span&gt; web = site.RootWeb;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;var&lt;/span&gt; defaultPage = web.Files[DefaultFileName];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;var&lt;/span&gt; originalStream = defaultPage.OpenBinaryStream();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; web.Files.Add(BackupFileName, originalStream, &lt;span style="color: blue;"&gt;true&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// move the new default page to default.aspx&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;var&lt;/span&gt; newDefaultPage = web.Files[&lt;span style="color: #a31515;"&gt;"CustomDefault.aspx"&lt;/span&gt;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;var&lt;/span&gt; newFileStream = newDefaultPage.OpenBinaryStream();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; defaultPage.SaveBinary(newFileStream);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; FeatureDeactivating(&lt;span style="color: #2b91af;"&gt;SPFeatureReceiverProperties&lt;/span&gt; properties)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// restore the back up&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SPSite&lt;/span&gt; site = properties.Feature.Parent &lt;span style="color: blue;"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SPSite&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SPWeb&lt;/span&gt; web = site.RootWeb;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;var&lt;/span&gt; originalDefaultPage = web.Files[BackupFileName];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;var&lt;/span&gt; originalStream = originalDefaultPage.OpenBinaryStream();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SPFile&lt;/span&gt; defaultPage = web.Files[&lt;span style="color: #a31515;"&gt;"default.aspx"&lt;/span&gt;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; defaultPage.SaveBinary(originalStream);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; originalDefaultPage.DeleteAllPersonalizationsAllUsers();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; originalDefaultPage.Delete();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8299485070499156242-3717933456272806332?l=sharepointnista.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointnista.blogspot.com/feeds/3717933456272806332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/custom-default-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/3717933456272806332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/3717933456272806332'/><link rel='alternate' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/custom-default-page.html' title='Create Custom Default Page for SharePoint 2010 Team Site'/><author><name>SharePointNista</name><uri>http://www.blogger.com/profile/13914021243627835393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_yFn7iyFnMBE/S6DrACTIWEI/AAAAAAAABw4/VlQAM8rt7x8/S220/davidn_profile.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_yFn7iyFnMBE/S6FAMMJ2f-I/AAAAAAAABxg/F3fVIawsO7o/s72-c/OWSTIMER.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299485070499156242.post-7155182194371489615</id><published>2010-03-17T10:41:00.001-05:00</published><updated>2010-03-17T10:41:38.581-05:00</updated><title type='text'>Hello World</title><content type='html'>&lt;span xmlns=''&gt;&lt;p&gt;Welcome to my very first blog.  This site is dedicated to my SharePoint development experiences – all the pain and heartache.  Come on board and explore with me all the rabbit holes of this journey.  Once in a while, I will make a detour to talk about how I "feel" about this whole process.  So unless you are "emotionally healthy", this site might not be very helpful &lt;span style='font-family:Wingdings'&gt;J&lt;/span&gt;&lt;br /&gt;			&lt;/p&gt;&lt;p&gt;There are many hurdles since the product is still in Beta, and I believe Microsoft won't be able to fix all the bugs way after it goes live.  Please share your comments and discoveries with me as you come along.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;At this time, we are developing an ECM site on top of MOSS 2010 Beta using VS 2010 RC1 in a Hyper-V environment.  Our codes and automated builds are "managed" by Team Foundation Server 2010.    I will present a talk about a similar scenario to a group of developers at my alumni - University of Minnesota this coming Saturday March 20&lt;sup&gt;th&lt;/sup&gt;, 2010.  &lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8299485070499156242-7155182194371489615?l=sharepointnista.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointnista.blogspot.com/feeds/7155182194371489615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/hello-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/7155182194371489615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299485070499156242/posts/default/7155182194371489615'/><link rel='alternate' type='text/html' href='http://sharepointnista.blogspot.com/2010/03/hello-world.html' title='Hello World'/><author><name>SharePointNista</name><uri>http://www.blogger.com/profile/13914021243627835393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_yFn7iyFnMBE/S6DrACTIWEI/AAAAAAAABw4/VlQAM8rt7x8/S220/davidn_profile.jpg'/></author><thr:total>0</thr:total></entry></feed>
