<?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-1200959818619186565</id><updated>2012-02-16T06:30:01.295-08:00</updated><title type='text'>Néstor Requesens Godó</title><subtitle type='html'>.NET, SharePoint, Umbraco and more...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Itequia</name><uri>http://www.blogger.com/profile/09490736897252135979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-963092233829711555</id><published>2010-03-25T02:36:00.000-07:00</published><updated>2010-03-25T02:54:28.475-07:00</updated><title type='text'>Enable/Disable Asp.net validatiors using JavaScript</title><content type='html'>&lt;div dir="ltr"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:Tahoma;font-size:100%;"  &gt;ASP.NET provides predefined validators for controls in ASP.NET pages:&lt;/span&gt;&lt;/div&gt; &lt;ul style="font-family: Tahoma; font-size: 10pt;" dir="ltr"&gt; &lt;li&gt; &lt;div&gt;&lt;span style="font-size:100%;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/div&gt; &lt;/li&gt;&lt;li&gt; &lt;div&gt;&lt;span style="font-size:100%;"&gt;RegularExpressionValidator&lt;/span&gt;&lt;/div&gt; &lt;/li&gt;&lt;li&gt; &lt;div&gt;&lt;span style="font-family:tahoma;font-size:100%;"&gt;...&lt;/span&gt;&lt;/div&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt;These validation controls offer the server-side property "Enabled" to be able to Enable/Disable them from server-side code. But what if we want to Enable/Disable them in client-side code (Javascript): Then there is a predefined  JS method: &lt;em&gt;ValidatorEnable(ValidatorId, Boolean); &lt;/em&gt;which allows us to do so.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt;To enable a control we would do like:&lt;br /&gt;&lt;strong&gt;ValidatorEnable(document.getElementById(&lt;span style="color: rgb(163, 21, 21);"&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;'&amp;lt;%= validatorUserName.ClientID %&amp;gt;'&lt;/span&gt;&lt;/span&gt;), &lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;&lt;/span&gt;);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt; &lt;/span&gt;&lt;p&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt;&lt;span style="font-family:tahoma;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span style="font-family:tahoma;"&gt;And to disabe it:&lt;br /&gt;&lt;/span&gt;&lt;strong&gt;ValidatorEnable(document.getElementById(&lt;span style="color: rgb(163, 21, 21);"&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;'&amp;lt;%= validatorUserName.ClientID %&amp;gt;'&lt;/span&gt;&lt;/span&gt;), &lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;&lt;/span&gt;);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt; &lt;/span&gt;&lt;p dir="ltr"&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt; &lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt; &lt;/span&gt;&lt;p dir="ltr"&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt;&lt;span style="font-family:tahoma;"&gt;Couldn't it be easier?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-963092233829711555?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/963092233829711555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/03/enabledisable-aspnet-validatiors-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/963092233829711555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/963092233829711555'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/03/enabledisable-aspnet-validatiors-using.html' title='Enable/Disable Asp.net validatiors using JavaScript'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-2085447575739274928</id><published>2010-03-17T02:50:00.001-07:00</published><updated>2010-03-21T10:05:12.688-07:00</updated><title type='text'>Code to change SPListItem permissions with a non-full-control user</title><content type='html'>&lt;div dir="ltr"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:Tahoma;font-size:100%;"  &gt;Recently I faced the need to change SharePoint's List Items permissions programmatically. The tricky part of it was the fact that the user performing the action had only contributor rights on the site.  The workaround to perform such action is to run the code as a user with elevated privileges. So here is my first approach:&lt;/span&gt;&lt;/div&gt; &lt;blockquote style="margin-right: 0px;" dir="ltr"&gt; &lt;div dir="ltr"&gt;&lt;span style=";font-family:Tahoma;font-size:100%;"  &gt;&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Guid&lt;/span&gt;&lt;/span&gt; SiteId = &lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPContext&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Tahoma;"&gt;.Current.Site.ID;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Tahoma;font-size:100%;"  &gt;&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;br /&gt;Guid&lt;/span&gt;&lt;/span&gt; WebId = &lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPContext&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Tahoma;"&gt;.Current.Web.ID;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt; &lt;p&gt;&lt;span style=";font-family:Tahoma;font-size:100%;"  &gt;&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPSecurity&lt;/span&gt;&lt;/span&gt;.RunWithElevatedPrivileges(&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;delegate&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Tahoma;font-size:100%;"  &gt;&lt;span style="color: rgb(0, 0, 255);"&gt;()&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;   using&lt;/span&gt;&lt;/span&gt; (&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPSite&lt;/span&gt;&lt;/span&gt; ElevatedSite = &lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPSite&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Tahoma;font-size:100%;"  &gt;&lt;span style="color: rgb(0, 0, 255);"&gt;(SiteId))&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;      using&lt;/span&gt;&lt;/span&gt; (&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPWeb&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);font-size:100%;" &gt;&lt;span style="color: rgb(0, 128, 0);font-family:Tahoma;" &gt; &lt;span style="color: rgb(0, 0, 0);"&gt; ElevatedWeb = ElevatedSite.OpenWeb(WebId))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;      {&lt;/span&gt;&lt;br /&gt;      //Code to change permissions&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Tahoma;"&gt;&lt;br /&gt;   }&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Tahoma;"&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;});&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Tahoma;"&gt;Using this code, at the moment you execute the sentences to change the permissions, you get an error like: "&lt;strong&gt;The security validation for this page is invalid"&lt;/strong&gt;. The way to solve this error is to set the &lt;strong&gt;AllowUnsafeUpdates&lt;/strong&gt; property to &lt;strong&gt;true&lt;/strong&gt; for the SPWeb object and validate the form digest control used in the current request. Hence the code snippet will look like this:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-family:tahoma;"&gt; &lt;blockquote style="margin-right: 0px;" dir="ltr"&gt; &lt;div dir="ltr"&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Guid&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; SiteId = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPContext&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Current.Site.ID;&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;br /&gt;Guid&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; WebId = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPContext&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Current.Web.ID;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPSecurity&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.RunWithElevatedPrivileges(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);font-size:100%;" &gt;&lt;span style="color: rgb(0, 0, 255);"&gt;delegate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);font-size:100%;" &gt;()&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;   using&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPSite&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ElevatedSite = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);font-size:100%;" &gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPSite&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);font-size:100%;" &gt;(SiteId))&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;      using&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPWeb&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ElevatedWeb = ElevatedSite.OpenWeb(WebId))&lt;br /&gt;   {&lt;br /&gt;       ElevatedWeb.AllowUnsafeUpdates = &lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;;&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 0);"&gt;ElevatedWeb.Update();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;          SPUtility&lt;/span&gt;&lt;/span&gt;.ValidateFormDigest();&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="color: rgb(0, 128, 0);font-size:100%;" &gt;&lt;span style="color: rgb(0, 128, 0);"&gt;          //Code to change permissions&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt; &lt;span style="font-size:100%;"&gt;         ElevatedWeb.AllowUnsafeUpdates = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);font-size:100%;" &gt;&lt;span style="color: rgb(0, 0, 255);"&gt;false;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;   }&lt;br /&gt;});&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size:100%;"&gt;And finally the code to change the permissions would look some thing like this:&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;blockquote style="margin-right: 0px;" dir="ltr"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:tahoma;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;listItem.BreakRoleInheritance(&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPRoleAssignment&lt;/span&gt;&lt;/span&gt; role = &lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPRoleAssignment&lt;/span&gt;&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPContext&lt;/span&gt;&lt;/span&gt;.Current.Web.EnsureUser("SOMEUSERorGROUP"));&lt;br /&gt;&lt;span style="font-family:tahoma;"&gt;role.RoleDefinitionBindings.Add(ElevatedWeb.RoleDefinitions.GetByType(&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;SPRoleType&lt;/span&gt;&lt;/span&gt;.Contributor)); /&lt;span style="color: rgb(0, 153, 0);"&gt;/Or any other SPRoleType&lt;/span&gt;&lt;br /&gt;listItem.RoleAssignments.Add(role);&lt;br /&gt;&lt;span style="font-family:tahoma;"&gt;listItem.Update();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:tahoma;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:tahoma;"&gt; &lt;/span&gt; &lt;/span&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:tahoma;"&gt;This worked for me. Hope it helps!&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-2085447575739274928?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/2085447575739274928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/03/code-to-change-splistitem-permissions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/2085447575739274928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/2085447575739274928'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/03/code-to-change-splistitem-permissions.html' title='Code to change SPListItem permissions with a non-full-control user'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-5940738992373512323</id><published>2010-03-15T08:26:00.000-07:00</published><updated>2010-03-22T03:42:50.434-07:00</updated><title type='text'>SharePoint Full Error Messages</title><content type='html'>&lt;div dir="ltr"&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt;While testing a SharePoint app, it is useful to see the "real" error messages instead of the nice &lt;em&gt;"&lt;span style="font-weight: bold;"&gt;An unknown error occured. Please contact your system administrator".&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;As I'm always forgetting how to set the web.config to show the "real" errors, here are the couple of steps which need to be done:&lt;/span&gt;&lt;/div&gt; &lt;ol   style=";font-family:Tahoma;font-size:10pt;" dir="ltr"&gt; &lt;li&gt; &lt;div&gt;&lt;span style="font-size:100%;"&gt;Switch custom errors off&lt;br /&gt;&lt;em&gt;&lt;blockquote&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;…&lt;br /&gt;&amp;lt;customErrors mode="Off" /&amp;gt;&lt;br /&gt;…&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;/blockquote&gt;&lt;/em&gt;&lt;/span&gt;&lt;/div&gt; &lt;/li&gt;&lt;li&gt; &lt;div&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt;Enable CallStack&lt;br /&gt;&lt;em&gt;&lt;blockquote&gt;&amp;lt;SharePoint&amp;gt;&lt;br /&gt;…&lt;br /&gt;&amp;lt;SafeMode CallStack="true" /&amp;gt;&lt;br /&gt;…&lt;br /&gt;&amp;lt;/SharePoint&amp;gt;&lt;/blockquote&gt;&lt;/em&gt;&lt;/span&gt;&lt;/div&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-5940738992373512323?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/5940738992373512323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/03/sharepoint-full-error-messages.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/5940738992373512323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/5940738992373512323'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/03/sharepoint-full-error-messages.html' title='SharePoint Full Error Messages'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-575071804959602159</id><published>2010-03-11T08:18:00.000-08:00</published><updated>2010-03-11T08:21:31.518-08:00</updated><title type='text'>Solution to: Cannot convert type 'Microsoft.SharePoint.WebControls.ScriptLink' to 'System.Web.UI.IAttributeAccessor'</title><content type='html'>&lt;div dir="ltr"&gt;&lt;span style=";font-family:tahoma;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;An error occurred during the processing of . &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://server/_catalogs/masterpage/YOURMASTER.master%2818"&gt;http://server/_catalogs/masterpage/YOURMASTER.master(18&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;): error CS0030: Cannot convert type 'Microsoft.SharePoint.WebControls.ScriptLink' to 'System.Web.UI.IAttributeAccessor' &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When deploying and setting a customized master page to a SharePoint site collection through a feature, after the deployment of the solution and feature activation success, you can end up having the above listed error.&lt;br /&gt;&lt;br /&gt;I guess this error might be caused for several reasons. But if you use SharePoint Designer to customize the master page and then Export option to export it into a file, SharePoint Designer adds a lot of non-sense  code to the file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;In order to solve the error&lt;/span&gt;, you just have to copy &amp;amp; paste the code into a new text file and save this file as your new master page to deploy.&lt;br /&gt;&lt;br /&gt;Hope it helps.&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/1200959818619186565-575071804959602159?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/575071804959602159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/03/solution-to-cannot-convert-type.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/575071804959602159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/575071804959602159'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/03/solution-to-cannot-convert-type.html' title='Solution to: Cannot convert type &apos;Microsoft.SharePoint.WebControls.ScriptLink&apos; to &apos;System.Web.UI.IAttributeAccessor&apos;'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-5885890416538084819</id><published>2010-01-22T05:20:00.000-08:00</published><updated>2010-01-22T05:37:53.822-08:00</updated><title type='text'>Upload multiple files attached to a SharePoint list item.</title><content type='html'>&lt;div dir="ltr"&gt;&lt;span style="font-family:Tahoma;color:#000000;"&gt;Recently I faced the need of programming a control for uploading multiple files attached to a SharePoint list item. &lt;/span&gt;&lt;span style="font-family:Tahoma;color:#000000;"&gt;Following &lt;a href="http://www.asp.net/(S(ywiyuluxr3qb2dfva1z5lgeg))/learn/videos/video-252.aspx"&gt;this video example&lt;/a&gt; I could easily create an ASP.NET control to upload multiple files to a web server. Then I just addapted the code to upload the files attached to the SharePoint list item and the final result is as follows:&lt;/span&gt;&lt;/div&gt;&lt;blockquote style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"&gt;&lt;div dir="ltr"&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="color:#2b91af;"&gt;SPWeb&lt;/span&gt; mySite = &lt;span style="color:#2b91af;"&gt;SPContext&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;.Current.Web;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="color:#2b91af;"&gt;SPList&lt;/span&gt; myList = mySite.Lists[&lt;span style="color:#a31515;"&gt;"myList"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="color:#2b91af;"&gt;SPListItem&lt;/span&gt; myListItem = myList.Items.Add();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;myListItem[&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="color:#a31515;"&gt;"Title"&lt;/span&gt;] = &lt;span style="color:#a31515;"&gt;"myTitle"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;...&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;HttpContext&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;.Current.Request.Files.Count &amp;gt; 0)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="color:#2b91af;"&gt;HttpFileCollection&lt;/span&gt; uploads = &lt;span style="color:#2b91af;"&gt;HttpContext&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;.Current.Request.Files;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#2b91af;"&gt;SPAttachmentCollection&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; attachments;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="color:#0000ff;"&gt;for&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; i = 0; i &amp;lt; uploads.Count; i++)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;color:#2b91af;"&gt;Stream&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; fs = uploads[i].InputStream;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;[] fileContents = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;[fs.Length];&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;fs.Read(fileContents, 0, (&lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;int&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;)fs.Length);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;fs.Close();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;attachments = myListItem.Attachments;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; fileName = &lt;span style="color:#2b91af;"&gt;Path&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;.GetFileName(uploads[i].FileName);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;attachments.Add(fileName, fileContents);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;myListItem.Update();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;p dir="ltr"&gt;&lt;span style="font-family:Tahoma;"&gt;I hope this helps!&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-5885890416538084819?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/5885890416538084819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/01/upload-multiple-files-attached-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/5885890416538084819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/5885890416538084819'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/01/upload-multiple-files-attached-to.html' title='Upload multiple files attached to a SharePoint list item.'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-6946843722912279421</id><published>2010-01-21T09:08:00.000-08:00</published><updated>2010-01-21T09:10:46.748-08:00</updated><title type='text'>Trying to use an SPWeb object that has been closed or disposed and is no longer valid.</title><content type='html'>&lt;div dir="ltr"&gt;&lt;span style="font-family:Tahoma;color:#000000;"&gt;&lt;span style="font-family:tahoma;"&gt;Developing in SharePoint you&lt;/span&gt; can come across this error (&lt;em&gt;Trying to use an SPWeb object that has been closed or disposed and is no longer valid&lt;/em&gt;) for so many reasons.&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span style="font-family:Tahoma;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span style="font-family:tahoma;"&gt;The one I faced today was because I was using a &lt;strong&gt;SPWeb&lt;/strong&gt; object initialized to the current context, so something like:&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span style="font-family:tahoma;"&gt;&lt;span style="color:#2b91af;"&gt;SPWeb&lt;/span&gt; site = &lt;span style="color:#2b91af;"&gt;SPContext&lt;/span&gt;.Current.Web&lt;/div&gt;&lt;p dir="ltr"&gt;&lt;span style="font-family:tahoma;"&gt;In order to skip the &lt;strong&gt;Dispose &lt;/strong&gt;statement I wrapped the my code into a &lt;strong&gt;using&lt;/strong&gt; block, so I had something like:&lt;/span&gt;&lt;/p&gt;&lt;span style="color:#0000ff;"&gt;&lt;p dir="ltr"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;SPWeb&lt;/span&gt; site = &lt;span style="color:#2b91af;"&gt;SPContext&lt;/span&gt;.Current.Web)&lt;br /&gt;{&lt;br /&gt;...&lt;br /&gt;}&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-family:tahoma;"&gt;The problem is that when we execute &lt;span style="color:#2b91af;"&gt;SPWeb&lt;/span&gt; site = &lt;span style="color:#2b91af;"&gt;SPContext&lt;/span&gt;.Current.Web, an object is not actually created and the site variable only gets a reference to the existing object, which in this particular case is the current context. Then at the end of the &lt;strong&gt;using&lt;/strong&gt; block, the code will actually dispose the current context, which is a non-desirable efect. &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-family:tahoma;"&gt;So in order to avoid this error, just don't try to dispose the current context!&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-family:tahoma;"&gt;You can read more info about all that in: Best Practices: Using Disposable Windows SharePoint Services Objects (&lt;a href="http://msdn.microsoft.com/en-us/library/aa973248.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa973248.aspx&lt;/a&gt;)&lt;/span&gt;&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/1200959818619186565-6946843722912279421?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/6946843722912279421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/01/trying-to-use-spweb-object-that-has.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/6946843722912279421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/6946843722912279421'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/01/trying-to-use-spweb-object-that-has.html' title='Trying to use an SPWeb object that has been closed or disposed and is no longer valid.'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-556656317726937958</id><published>2010-01-21T03:14:00.001-08:00</published><updated>2010-01-21T09:11:53.290-08:00</updated><title type='text'>SharePoint Web Part Maintenance Page</title><content type='html'>&lt;div dir="ltr"&gt;&lt;span style="font-family:Tahoma;color:#000000;"&gt;For some reason I never remember this: If you have a SharePoint web part which causes a problem on a page and it prevents it from loading, you can always browse to the web part maintenance page, which allows you to close, reset and delete web parts from a particular page.&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span style="font-family:tahoma;"&gt;The way to browse into the web part maintenance page is adding &lt;strong&gt;?contents=1 &lt;/strong&gt;to the end of the page's url. For example: &lt;strong&gt;http://mysharepointsite/default.aspx?contents=1&lt;/strong&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/1200959818619186565-556656317726937958?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/556656317726937958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/01/sharepoint-web-part-maintenance-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/556656317726937958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/556656317726937958'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/01/sharepoint-web-part-maintenance-page.html' title='SharePoint Web Part Maintenance Page'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-25949896588462292</id><published>2010-01-05T02:17:00.001-08:00</published><updated>2010-01-21T09:16:14.315-08:00</updated><title type='text'>How to set the parent content type when deploying a content type as a feature?</title><content type='html'>&lt;div class="Section1"&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;Out there you can find lots of articles explaining how to deploy a SharePoint content type as a feature, but one thing I found difficult to find out was how to set which has to be the parent content type of the content type we want to deploy. This post is not meant to explain how to deploy a CT as a SharePoint feature, it’s just to point out how to set the parent.&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;Normally if we deploy a content type as a feature we will have something like this in our XML:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN-LEFT: 36pt"&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:#a31515;"&gt;Elements&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt; &lt;/span&gt;&lt;span style="font-family:'Courier New';color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;=&lt;/span&gt;&lt;span style="font-family:'Courier New';"&gt;"&lt;span style="color:blue;"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;" &lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:#a31515;"&gt;ContentType&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt; &lt;/span&gt;&lt;span style="font-family:'Courier New';color:red;"&gt;ID&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;=&lt;/span&gt;&lt;span style="font-family:'Courier New';"&gt;"&lt;span style="color:blue;"&gt;&lt;strong&gt;0x0101&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;00&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;928100FAB05A4148BD6F4C8E6A716B40&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family:'Courier New';"&gt;" &lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;MyContentType&lt;/span&gt;" &lt;span style="color:red;"&gt;Description&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;MyDesc&lt;/span&gt;"&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Group&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;CTypes&lt;/span&gt;"&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:#a31515;"&gt;FieldRefs&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:#a31515;"&gt;FieldRef&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt; &lt;/span&gt;&lt;span style="font-family:'Courier New';color:red;"&gt;ID&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;=&lt;/span&gt;&lt;span style="font-family:'Courier New';"&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;Name&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:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;Required&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:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;ShowInNewForm&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:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;ShowInEditForm&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:blue;"&gt; /&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;…&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:'Courier New';color:#a31515;"&gt;FieldRefs&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:#a31515;"&gt;XmlDocuments&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;…&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:'Courier New';color:#a31515;"&gt;XmlDocuments&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:'Courier New';color:#a31515;"&gt;ContentType&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:'Courier New';color:#a31515;"&gt;Elements&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;Looking at the Content Type ID of this example we have: &lt;u&gt;0x0101&lt;/u&gt;&lt;b&gt;&lt;span style="color:red;"&gt;00&lt;/span&gt;&lt;/b&gt;&lt;u&gt;928100FAB05A4148BD6F4C8E6A716B40&lt;/u&gt;. This Id has two parts separated using a &lt;b&gt;&lt;span style="color:red;"&gt;00&lt;/span&gt;&lt;/b&gt;. The first part of the Id (&lt;u&gt;0x0101&lt;/u&gt;) is the Id of the parent content type (document in this case) and the second part of the Id is the Id we need to generate for the content type we want to deploy.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;There are several ways to find out the Id of a content type. An easy one is to copy from the URL bar when we are in the Site Content Type Information screen coming from the site content type gallery. (Site actions -&amp;gt; Site settings -&amp;gt; Site content types -&amp;gt; “click on the desired CT”).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-25949896588462292?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/25949896588462292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/01/how-to-set-parent-content-type-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/25949896588462292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/25949896588462292'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2010/01/how-to-set-parent-content-type-when.html' title='How to set the parent content type when deploying a content type as a feature?'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-1427323867787876832</id><published>2009-12-09T04:44:00.001-08:00</published><updated>2009-12-09T04:46:02.012-08:00</updated><title type='text'>STSADM -o export: FatalError: Failed to compare two elements in the array</title><content type='html'>&lt;div class="Section1"&gt;  &lt;p class="MsoNormal"&gt;In MOSS 2007, if you use STSADM to export a Site Collection you may face an error like that in the resulting log file:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;i&gt;... FatalError: Failed to compare two elements in the array. &lt;/i&gt;Which doesn't help so much in solving the problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;i&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/i&gt;Finally today, while Googleing for the solution I found this &lt;a href="http://www.moss2007.be/blogs/vandest/archive/2007/08/23/stsadm-o-export-fatalerror-failed-to-compare-two-elements-in-the-array.aspx"&gt;post&lt;/a&gt; in MVP Steven Van de Craen's Blog, which explains the cause and how to solve the problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;Briefly, the cause is an invalid Feature registration in the Site Collection or root Site which you are trying to export. And the solution is deactivate the “failing feature” with the help of &lt;a href="http://featureadmin.codeplex.com/"&gt;this nice tool&lt;/a&gt; which finds and enumerates invalid features.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-1427323867787876832?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/1427323867787876832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/12/stsadm-o-export-fatalerror-failed-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/1427323867787876832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/1427323867787876832'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/12/stsadm-o-export-fatalerror-failed-to.html' title='STSADM -o export: FatalError: Failed to compare two elements in the array'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-2286301945635074626</id><published>2009-08-20T09:45:00.001-07:00</published><updated>2009-08-20T09:46:56.441-07:00</updated><title type='text'>Paging in LINQ</title><content type='html'>&lt;div class="Section1"&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;LINQ makes really easy the paging of a result set. No more writing complex logic to page results of our queries. We can easily page using the methods Skip and Take.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;The Take method is used to indicate how many results are going to be fetched, like the TOP keyword in SQL. Here is an example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class="MsoNormal" style="margin-left: 35.4pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;List&amp;lt;Movie&amp;gt; movies = GetMovieList();&lt;br /&gt;var takenMovies = (from m in movies select new {m.Name, m.Director} ).Take(4);&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;As you can imagine, the Skip method is used to indicate how many results we want to skip from the top. So the combination of both methods gives us a pretty easy way to perform paging. Here is an example which takes &lt;i&gt;Movies&lt;/i&gt; from 8&lt;sup&gt;th&lt;/sup&gt; to 11&lt;sup&gt;th&lt;/sup&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-left: 35.4pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;List&amp;lt;Movie&amp;gt; movies = GetMovieList();&lt;br /&gt;var takenMovies = (from m in movies select new {m.Name, m.Director} ).Skip(7).Take(4);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;Hope you find it useful.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-2286301945635074626?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/2286301945635074626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/08/paging-in-linq.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/2286301945635074626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/2286301945635074626'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/08/paging-in-linq.html' title='Paging in LINQ'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-230244876060220980</id><published>2009-08-19T03:22:00.000-07:00</published><updated>2009-08-19T03:26:13.895-07:00</updated><title type='text'>LINQ's Intesect method using IEqualityComparer</title><content type='html'>&lt;div class="Section1"&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;The Intersect method produces the set intersection of two sequences by using the specified &lt;b&gt;&lt;i&gt;IEqualityComparer&lt;/i&gt;&lt;/b&gt;&lt;i&gt;&amp;lt;(Of &amp;lt;(T&amp;gt;)&amp;gt;)&lt;/i&gt;  to compare values. Here comes an example on how to use it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;The first thing we do in this example  is implement the class we want to compare. For this example is going to be “Project”:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class="MsoNormal" style="margin-left: 35.4pt;"&gt;&lt;span lang="EN-US"&gt;public class Project&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 70.8pt;"&gt;&lt;span lang="EN-US"&gt;public string ProjectName { get; set; }&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;public string ShortDescription { get; set; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 35.4pt;"&gt;&lt;span lang="EN-US"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Secondly we must implement the comparer class which it’s going to inherit from &lt;b&gt;&lt;i&gt;IEqualityComparer&lt;/i&gt;&lt;/b&gt;&lt;i&gt;&amp;lt;Project&amp;gt;.&lt;/i&gt; If we write the header of the class and right-click the interface name, Visual Studio is going to write the method headers we need to implement (Equals and GetHashCode). The implementation which comes is just an example on how to do it:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-left: 35.4pt;"&gt;&lt;span lang="EN-US"&gt;public class ProjectComparer : IEqualityComparer&amp;lt;Project&amp;gt;&lt;br /&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 70.8pt;"&gt;&lt;span lang="EN-US"&gt;public bool Equals(Project x, Project y)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-left: 106.2pt;"&gt;&lt;span lang="EN-US"&gt;// Check whether the compared objects reference the same data.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;if (Object.ReferenceEquals(x, y)) return true;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-left: 106.2pt;"&gt;&lt;span lang="EN-US"&gt;// Check whether any of the compared objects is null.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null)) return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-left: 106.2pt;"&gt;&lt;span lang="EN-US"&gt;// Check whether the products' properties are equal.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;return (x.ProjectName == y.ProjectName &amp;amp;&amp;amp;  x.ShortDescription == y.ShortDescription  );&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 70.8pt;"&gt;&lt;span lang="EN-US"&gt; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 70.8pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-left: 70.8pt;"&gt;&lt;span lang="EN-US"&gt;public int GetHashCode(Project obj)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-left: 106.2pt;"&gt;&lt;span lang="EN-US"&gt;// Check whether the object is null.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;if (Object.ReferenceEquals(obj, null)) return 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-left: 106.2pt;"&gt;&lt;span lang="EN-US"&gt;// Get the hash code for the ProjectName field if it is not null.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;int hashProjectName = obj.ProjectName == null ? 0 : obj.ProjectName.GetHashCode();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-left: 106.2pt;"&gt;&lt;span lang="EN-US"&gt;// Get the hash code for the ShortDescription field if it is not null.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;int hashShortDescription = obj. ShortDescription == null ? 0 : obj.ShortDescription.GetHashCode();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-left: 106.2pt;"&gt;&lt;span lang="EN-US"&gt;return hashProjectName ^ hashShortDescription;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 35.4pt; text-indent: 35.4pt;"&gt;&lt;span lang="EN-US"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 35.4pt;"&gt;&lt;span lang="EN-US"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Once we have the class to compare and the comparer, we are ready to use the Intersect method like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 35.4pt;"&gt;&lt;span lang="EN-US"&gt;listOfProjects = listOfProjectsA.Intersect(listOfProjectsB, new ProjectComparer()).ToList();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;In this example of execution listOfProjects is going to have the elements of the Project class which are in listOfProjectsA and listOfProjectsB.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Hope this helps!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-230244876060220980?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/230244876060220980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/08/linqs-intesect-method-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/230244876060220980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/230244876060220980'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/08/linqs-intesect-method-using.html' title='LINQ&apos;s Intesect method using IEqualityComparer'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-6089701951123577969</id><published>2009-08-17T07:41:00.000-07:00</published><updated>2009-08-17T07:42:15.853-07:00</updated><title type='text'>How to reset the identity of a table in SQL Server</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;Recently I faced the problem which drove me to remove all the values from a table which has an identity column. Once I inserted the new values I realized that these new values identities were starting at the last identity of the old rows I already deleted. The way to reset the identity counter&amp;#8221; of a table is reseeding it using the following: &lt;b&gt;DBCC CHECKIDENT('&lt;i&gt;TableName&lt;/i&gt;', RESEED, &lt;i&gt;Seed&lt;/i&gt;)&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-6089701951123577969?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/6089701951123577969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/08/how-to-reset-identity-of-table-in-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/6089701951123577969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/6089701951123577969'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/08/how-to-reset-identity-of-table-in-sql.html' title='How to reset the identity of a table in SQL Server'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-2317437588568955750</id><published>2009-08-13T06:32:00.001-07:00</published><updated>2009-08-13T06:34:25.979-07:00</updated><title type='text'>SQL "IN" clause in LINQ</title><content type='html'>&lt;div class="Section1"&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;I’ve been searching how to implement the SQL IN clause in LINQ and finally I got it.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;You have to use the Contains method on the collection which is actually holding all the values you want to be compared by the IN clause. Here comes an example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;LINQ code:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;                    &lt;p class="MsoNormal" style="margin-left: 35.4pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;i&gt;&lt;span lang="EN-US"&gt;int[] values = { 1, 2, 3 };&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;using (DataContext dc = new DataContext("…"))&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;                var std = &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;                        (from stds in dc.Standards&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;                         where values.&lt;b&gt;Contains&lt;/b&gt;(stds.StandardId)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;                         select stds&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;                        );&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;SQL Equivalent:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 35.4pt;"&gt;&lt;i&gt;&lt;span lang="EN-US"&gt;SELECT * FROM Standards WHERE StandardId &lt;b&gt;IN&lt;/b&gt; (1, 2, 3)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;Hope this helps!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-2317437588568955750?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/2317437588568955750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/08/sql-in-clause-in-linq.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/2317437588568955750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/2317437588568955750'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/08/sql-in-clause-in-linq.html' title='SQL &quot;IN&quot; clause in LINQ'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-4892460722851723820</id><published>2009-07-08T00:17:00.000-07:00</published><updated>2009-07-08T00:18:00.642-07:00</updated><title type='text'>Embedding JW FLV Player to Umbraco through XSLT</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;Here comes an XSLT macro for umbraco which makes quite easy to embed the &lt;a href="http://www.longtailvideo.com/players/jw-flv-player/"&gt;JW FLV Player&lt;/a&gt; to an umbraco page:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;&amp;lt;xsl:stylesheet &amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:35.4pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;xsl:param name=&amp;quot;currentPage&amp;quot;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:35.4pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;xsl:template match=&amp;quot;/&amp;quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:70.8pt'&gt;&lt;b&gt;&lt;span lang=EN-US&gt;&amp;lt;!-- Retrieves the URL of the Video, which is a property of the document type --&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:70.8pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;xsl:variable name=&amp;quot;urlVideo&amp;quot; select=&amp;quot;umbraco.library:GetMedia($currentPage/data [@alias='myVideo'], 0)/data [@alias = 'umbracoFile']&amp;quot;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:70.8pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;xsl:if test=&amp;quot;$urlVideo != ''&amp;quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:106.2pt'&gt;&lt;b&gt;&lt;span lang=EN-US&gt;&amp;lt;!-- Includes necessary javascript library --&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:106.2pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;script type='text/javascript' src='/js/swfobject.js'&amp;gt;&amp;lt;/script&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:106.2pt'&gt;&lt;b&gt;&lt;span lang=EN-US&gt;&amp;lt;!-- In this DIV will be the player included --&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:106.2pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;div id='preview'&amp;gt;&amp;lt;/div&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:106.2pt'&gt;&lt;b&gt;&lt;span lang=EN-US&gt;&amp;lt;!-- Initializes the player --&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:106.2pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;script type='text/javascript'&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:141.6pt'&gt;&lt;i&gt;&lt;span lang=EN-US&gt;var s1 = new SWFObject('/ClientBin/player.swf','player','468','350','9');&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:141.6pt'&gt;&lt;i&gt;&lt;span lang=EN-US&gt;s1.addParam('allowfullscreen','true');&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:141.6pt'&gt;&lt;i&gt;&lt;span lang=EN-US&gt;s1.addParam('allowscriptaccess','always');&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:141.6pt'&gt;&lt;i&gt;&lt;span lang=EN-US&gt;s1.addParam('flashvars','file=&lt;/span&gt;&lt;/i&gt;&lt;span lang=EN-US&gt;&amp;lt;xsl:value-of select='$urlVideo'&amp;gt;&amp;lt;/xsl:value-of&amp;gt;&lt;i&gt;');&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:141.6pt'&gt;&lt;i&gt;&lt;span lang=EN-US&gt;s1.write('preview');&lt;/span&gt;&lt;/i&gt;&lt;span lang=EN-US&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:106.2pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;/script&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:70.8pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;/xsl:if&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:35.4pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;/xsl:template&amp;gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;Note that this macro must be included into a template associated to a document type which has &lt;i&gt;myVideo&lt;/i&gt; as a Media property with the video we want to play.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;Hope you find it useful.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-4892460722851723820?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/4892460722851723820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/07/embedding-jw-flv-player-to-umbraco.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/4892460722851723820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/4892460722851723820'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/07/embedding-jw-flv-player-to-umbraco.html' title='Embedding JW FLV Player to Umbraco through XSLT'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-1717201061649396565</id><published>2009-06-29T07:43:00.000-07:00</published><updated>2009-06-29T07:44:01.533-07:00</updated><title type='text'>Umbraco XSLT - Check empty node sets</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;Using the string function is the easiest and fastest way to check if a node set is empty or not in an umbraco XSLT macro. Here comes a quick example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:35.4pt'&gt;&lt;code&gt;&lt;span lang=CA style='font-size:10.0pt'&gt;&amp;lt;xsl:template name=&amp;quot;drawStuff&amp;quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:70.8pt'&gt;&lt;code&gt;&lt;span lang=CA style='font-size:10.0pt'&gt;&amp;lt;xsl:param name=&amp;quot;pag&amp;quot;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:70.8pt'&gt;&lt;code&gt;&lt;span lang=CA style='font-size:10.0pt'&gt;&amp;lt;xsl:if test=&amp;quot;string($pag)&amp;quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:106.2pt'&gt;&lt;code&gt;&lt;span lang=CA style='font-size:10.0pt'&gt;&amp;lt;!-- Draw stuff --&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:70.8pt'&gt;&lt;code&gt;&lt;span lang=CA style='font-size:10.0pt'&gt;&amp;lt;/xsl:if&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;  &lt;p class=MsoNormal style='margin-left:35.4pt'&gt;&lt;code&gt;&lt;span lang=CA style='font-size:10.0pt'&gt;&amp;lt;/xsl:template&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;code&gt;&lt;span lang=CA style='font-size:10.0pt'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-1717201061649396565?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/1717201061649396565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/06/umbraco-xslt-check-empty-node-sets.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/1717201061649396565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/1717201061649396565'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/06/umbraco-xslt-check-empty-node-sets.html' title='Umbraco XSLT - Check empty node sets'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-3973599332609193462</id><published>2009-05-13T03:15:00.000-07:00</published><updated>2009-05-18T00:15:59.528-07:00</updated><title type='text'>Managed properties + Search Scopes in Search Server 2008</title><content type='html'>&lt;div class="Section1"&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Just now I found the way to improve search scopes in Search Server 2008. The thing is: you can enable a Managed Property to act as filter in a search scope. Here are the steps you must do in order to configure a search scope rule for doc files:&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraph" style="margin-left: 71.4pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang="EN-US"&gt;Open Search Server Administration&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraph" style="margin-left: 71.4pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;2.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang="EN-US"&gt;Click Queries and Results &lt;/span&gt;&lt;span  lang="EN-US" style="font-family:Wingdings;"&gt;à&lt;/span&gt;&lt;span lang="EN-US"&gt; &lt;b&gt;Metada&lt;/b&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;b&gt;ta Properties&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraph" style="margin-left: 71.4pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;3.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang="EN-US"&gt;Here is where you can add or edit ma&lt;/span&gt;&lt;span lang="EN-US"&gt;naged properties: For the example we will edit the FileExtension property and we will check in the “&lt;b&gt;Allow this prop&lt;/b&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;b&gt;erty to be used in scopes&lt;/b&gt;” option.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraph" style="margin-left: 71.4pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;4.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang="EN-US"&gt;Then we head to create a new scope and we add a rule like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 35.4pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 70.8pt;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_jli4kaS3y8Q/ShELCp5iRGI/AAAAAAAAAmU/aicm6FOrnMw/s1600-h/searchscope.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 189px;" src="http://4.bp.blogspot.com/_jli4kaS3y8Q/ShELCp5iRGI/AAAAAAAAAmU/aicm6FOrnMw/s320/searchscope.jpg" alt="" id="BLOGGER_PHOTO_ID_5337059173645567074" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;I hope this helps…&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-3973599332609193462?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/3973599332609193462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/05/managed-properties-search-scopes-in_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/3973599332609193462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/3973599332609193462'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/05/managed-properties-search-scopes-in_13.html' title='Managed properties + Search Scopes in Search Server 2008'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_jli4kaS3y8Q/ShELCp5iRGI/AAAAAAAAAmU/aicm6FOrnMw/s72-c/searchscope.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-1587468472137152651</id><published>2009-04-23T00:23:00.000-07:00</published><updated>2009-04-23T00:21:59.975-07:00</updated><title type='text'>Adding "normal" aspx pages to umbraco sites</title><content type='html'>&lt;div class="Section1"&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Developing web portals in &lt;a href="http://umbraco.org/"&gt;umbraco&lt;/a&gt;, we might get the need of including “normal” aspx pages in our site. What I mean by “normal” aspx pages are pages which don’t get served by umbraco (i.e: a custom web form).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Well then, in order to do this, umbraco has the &lt;b&gt;umbracoReservedUrls&lt;/b&gt; and the &lt;b&gt;umbracoReservedPaths&lt;/b&gt; settings in the &lt;b&gt;web.config &lt;/b&gt;file. The first one allows us to reserve single files and using the second one we’ll be able to reserve folders.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Here is an example for both:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"   lang="EN-US"&gt;&amp;lt;add key="umbracoReservedUrls" value="/myWebSite/myCustomForm.aspx"/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"   lang="EN-US"&gt;&amp;lt;add key="umbracoReservedPaths" value="/myWebSite/umbraco/,/myWebSite/install/,/myWebSite/myForms/"/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;Hope this helps!&lt;/span&gt;&lt;span lang="CA"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-1587468472137152651?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/1587468472137152651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/04/adding-normal-aspx-pages-in-umbraco.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/1587468472137152651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/1587468472137152651'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/04/adding-normal-aspx-pages-in-umbraco.html' title='Adding &quot;normal&quot; aspx pages to umbraco sites'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-8227524947977312428</id><published>2009-03-11T02:12:00.000-07:00</published><updated>2009-03-11T02:09:54.423-07:00</updated><title type='text'>Interesting Web Parts for SharePoint</title><content type='html'>&lt;div class="Section1"&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Thanks to &lt;a href="http://itfootprint.wordpress.com/2009/02/13/chart-print-and-slideshow-web-parts-for-sharepoint/"&gt;Footprint of IT&lt;/a&gt; I found some interesting and free web parts for Windows SharePoint Services 3.0. Among others, there are web parts that allow us to add interactive charts or slideshows to our SharePoint sites. You can check them out at: &lt;a href="http://www.spelements.com/"&gt;http://www.spelements.com/&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-8227524947977312428?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/8227524947977312428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/03/interesting-web-parts-for-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/8227524947977312428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/8227524947977312428'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/03/interesting-web-parts-for-sharepoint.html' title='Interesting Web Parts for SharePoint'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-7442519337952137340</id><published>2009-02-18T10:34:00.000-08:00</published><updated>2009-02-18T10:37:36.436-08:00</updated><title type='text'>Interesting Video: Building Master Pages for WSS 3.0 using Site Definitions in Visual Studio</title><content type='html'>&lt;div class="Section1"&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;While performing some research in how to build master pages for WSS I found this illustrative &lt;a href="http://www.microsoft.com/resources/msdn/en-us/office/media/WSS3BuildingMasterPagesusingSiteDefinitions.wvx"&gt;video&lt;/a&gt; (7 min.) in MSDN, which shows how to build a WSS master page using a site definition created in Visual Studio 2005.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Here is the link to the full &lt;a href="http://msdn.microsoft.com/en-us/library/bb687712.aspx"&gt;MSDN article&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Hope this helps...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-7442519337952137340?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/7442519337952137340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/02/interesting-video-building-master-pages.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/7442519337952137340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/7442519337952137340'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/02/interesting-video-building-master-pages.html' title='Interesting Video: Building Master Pages for WSS 3.0 using Site Definitions in Visual Studio'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-4846500382199133621</id><published>2009-02-18T07:53:00.000-08:00</published><updated>2009-02-18T07:51:02.362-08:00</updated><title type='text'>Feeding a Sharepoint Navigation Provider with a XML file</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;Depending on how we implement a portal in Sharepoint (WSS or MOSS) we might need special sources for our navigation menus. My approach in this is to feed them with XML files in order to have the maximum flexibility in the navigation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;The first think we must do is adding a new XmlContentMapProvider provider in our web.config. Here is an example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code&gt;&lt;span lang=EN-US&gt;&amp;lt;siteMap defaultProvider=&amp;quot;CurrentNavSiteMapProvider&amp;quot; enabled=&amp;quot;true&amp;quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code style='margin-left:35.4pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;providers&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code style='margin-left:70.8pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;add name=&amp;quot;CustomXmlContentMapProvider&amp;quot; siteMapFile=&amp;quot;_app_bin/mainMenu.sitemap&amp;quot; type=&amp;quot;Microsoft.SharePoint.Navigation.SPXmlContentMapProvider, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;quot; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code style='margin-left:35.4pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;/providers&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code&gt;&lt;span lang=EN-US&gt;&amp;lt;/siteMap&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code&gt;&lt;span lang=EN-US&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;Then we have to configure a new site map, adding the file mainMenu.sitemap, here is where the XML souce comes:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code&gt;&lt;span lang=EN-US&gt;&amp;lt;siteMap&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code style='margin-left:35.4pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;siteMapNode title=&amp;quot;Home Page&amp;quot; url=&amp;quot;http://server/&amp;quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code style='margin-left:70.8pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;siteMapNode title=&amp;quot;SITE1&amp;quot; url=&amp;quot;http://server/sites/site1&amp;quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code style='margin-left:70.8pt;text-indent:35.4pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;siteMapNode title=&amp;quot;SITE1_1&amp;quot; url=&amp;quot;http://server/sites/site1_1&amp;quot;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code style='margin-left:70.8pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;/siteMapNode&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code style='margin-left:35.4pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;/siteMapNode&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code&gt;&lt;span lang=EN-US&gt;&amp;lt;/siteMap&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code&gt;&lt;span lang=EN-US&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;We can place the mainMenu.sitemap file wherever we want to place it, but we must do it according to the siteMapFile attribute we added in the web.config new provider. For this example I used: inetpub/wwwroot/wss/virtualdirectories/myportal/_app_bin/.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;Now we only have to modify the master page (default.master):&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'&gt;&lt;![if !supportLists]&gt;&lt;span lang=EN-US style='font-family:Symbol'&gt;&lt;span style='mso-list:Ignore'&gt;·&lt;span style='font:7.0pt "Times New Roman"'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;![endif]&gt;&lt;span lang=EN-US&gt;Add this code inside a SharePoint:DelegateControl next to the topSiteMap:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code style='margin-left:36.0pt'&gt;&lt;span lang=EN-US&gt;&amp;lt;asp:SiteMapDataSource&lt;br&gt; ShowStartingNode=&amp;quot;true&amp;quot;&lt;br&gt; SiteMapProvider=&amp;quot;CustomXmlContentMapProvider&amp;quot;&lt;br&gt; id=&amp;quot;xmlSiteMap&amp;quot;&lt;br&gt; runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;/span&gt;&lt;span lang=EN-US style='font-family:"Arial","sans-serif"'&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=Code style='margin-left:36.0pt'&gt;&lt;span lang=EN-US style='font-family: "Arial","sans-serif"'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;span lang=EN-US&gt;Change the datasource of the Sharepoint:AspMenu with ID=TopNavigationMenu from topSiteMap to xmlSiteMap.&lt;/span&gt;&lt;span lang=EN-US&gt; &lt;/span&gt;&lt;span lang=CA&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-4846500382199133621?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/4846500382199133621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/02/feeding-sharepoint-navigation-provider.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/4846500382199133621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/4846500382199133621'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/02/feeding-sharepoint-navigation-provider.html' title='Feeding a Sharepoint Navigation Provider with a XML file'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-7716867788169712371</id><published>2009-02-09T23:38:00.000-08:00</published><updated>2009-02-09T23:39:51.288-08:00</updated><title type='text'>umbraco 4.0 running over .NET framework 3.5</title><content type='html'>&lt;div class="Section1"&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;I’ve been a couple of days trying, with no success, to get to work &lt;/span&gt;&lt;span lang="CA"&gt;&lt;a href="http://umbraco.org/"&gt;&lt;span lang="EN-US"&gt;umbraco&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt; 4 over a Windows Server 2003 with the .NET framework 3.5. Finally today, at the &lt;/span&gt;&lt;span lang="CA"&gt;&lt;a href="http://www.codeplex.com/umbraco/Release/ProjectReleases.aspx?ReleaseId=20699"&gt;&lt;span lang="EN-US"&gt;umbraco’s codeplex releases page&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;, they posted a PDF showing how to run umbraco on 3.5. The only important thing in that document is the &lt;/span&gt;&lt;span lang="CA"&gt;&lt;a href="http://www.codeplex.com/umbraco/SourceControl/changeset/view/46604#687601"&gt;&lt;span lang="EN-US"&gt;link to a new web.config&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt; special for 3.5.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Probably I’ll start working with umbraco in some days. I hope to get the time to blog some of my experiences…&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-7716867788169712371?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/7716867788169712371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/02/umbraco-40-running-over-net-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/7716867788169712371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/7716867788169712371'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/02/umbraco-40-running-over-net-framework.html' title='umbraco 4.0 running over .NET framework 3.5'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-8676400314662713387</id><published>2009-01-22T15:10:00.000-08:00</published><updated>2009-01-22T15:47:41.417-08:00</updated><title type='text'>Writing a global error handler in ASP.NET</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;In this first article I’d like to show the way I use to control the global exceptions or errors in an ASP.NET application. Most of the times we might be keen on customizing error messages in order to avoid the typical ASP.NET Internal Server Error page.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;The first thing we must do is edit the &lt;span style="font-style: italic;"&gt;customErrors &lt;/span&gt;node in our ASP.NET &lt;span style="font-style: italic;"&gt;web.config&lt;/span&gt; XML file in order to avoid the detailed information about the errors. Here is an example:&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Web.config:&lt;/span&gt;&lt;/span&gt;&lt;span courier=""&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;customErrors mode="RemoteOnly" defaultredirect="AppErrors.aspx"&amp;gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;&amp;lt;error statuscode="404" redirect="ThereIsNoPage.aspx"&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;&amp;lt;/customErrors&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;Then we must implement with the desired code the &lt;span style="font-style: italic;"&gt;Application_Error&lt;/span&gt; function in the &lt;span style="font-style: italic;"&gt;global.asax&lt;/span&gt; code file. Here is a simple example which only grabs some error info, passes it to a customized error page (through Session) and it finally navigates to this page.&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    Global.asax:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 0);font-family:courier new;" &gt;&lt;pre&gt;&lt;span style="font-family:courier new;"&gt; Exception ex = Server.GetLastError().GetBaseException();&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt; Session[&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;CT.ERR_MESS&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;] = ex.Message;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt; Session[Ctants.SESSIO_ERROR_STACKTRACE] = ex.StackTrace;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt; Server.Transfer("Errors.aspx");&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;    &lt;span style="font-weight: bold;"&gt;Errors.aspx.cs:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt; &lt;span style="font-family:courier new;"&gt;&lt;pre&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;     if (Session[&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;CT.ERR_MESS&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;] != null)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     {&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;     lblErrorMessage.Text += Session[CT.ERR_MESS].ToString();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        Session.Remove(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;CT.ERR_MESS&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     if (Session[CT.ERR_STACK] != null)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        lblErrorStack.Text += Session[CT.ERR_STACK].ToString();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        Session.Remove(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;CT.ERR_STACK&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     }&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;br /&gt;Hope this helps…&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-8676400314662713387?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/8676400314662713387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/01/writing-global-error-handler-in-aspnet.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/8676400314662713387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/8676400314662713387'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/01/writing-global-error-handler-in-aspnet.html' title='Writing a global error handler in ASP.NET'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1200959818619186565.post-4026000445061737709</id><published>2009-01-22T15:07:00.000-08:00</published><updated>2009-01-22T15:08:44.156-08:00</updated><title type='text'>Hello World</title><content type='html'>&lt;span style="font-family: trebuchet ms;"&gt;After some time working in &lt;a href="http://www.itequia.com"&gt;Itequia &lt;/a&gt;as a Software Engineer, I finally get the time to start blogging about the stuff I almost deal every day.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Here you will find my thoughts about software and other IT matters. In the beginning my posts will be about some Microsoft technologies like .NET or SharePoint, as those are the ones which I’m working now.&lt;br /&gt;&lt;br /&gt;I hope you find it interesting…&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1200959818619186565-4026000445061737709?l=nestorrg-blogs.itequia.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nestorrg-blogs.itequia.com/feeds/4026000445061737709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/01/hello-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/4026000445061737709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1200959818619186565/posts/default/4026000445061737709'/><link rel='alternate' type='text/html' href='http://nestorrg-blogs.itequia.com/2009/01/hello-world.html' title='Hello World'/><author><name>Néstor</name><uri>http://www.blogger.com/profile/06993731835392749279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
