<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0MHRH4ycSp7ImA9WhBaEEQ.&quot;"><id>tag:blogger.com,1999:blog-20371103</id><updated>2013-05-20T18:23:55.099-07:00</updated><category term="Live SharePoint Sites" /><category term="Windows 2008 Server" /><category term="SharePoint Conference 2011 South East Asia" /><category term="My Sites" /><category term="Blog Recommendations" /><category term="General SharePoint (All Versions)" /><category term="javascript" /><category term="alerts" /><category term="SharePoint 2010 Installation" /><category term="debugging" /><category term="Accessibility" /><category term="BDC" /><category term="Tech Ed 2007" /><category term="Speaking engagements" /><category term="Service Pack" /><category term="PowerPivot" /><category term="events" /><category term="Personal Junk" /><category term="Enhanced Content Query Web Part" /><category term="SharePoint Foundation" /><category term="Content Query Web Part" /><category term="I found a bug" /><category term="Visual Studio 2010" /><category term="Training Courses" /><category term="Administration" /><category term="troubleshooting" /><category term="SharePoint User Groups" /><category term="Excel Services" /><category term="internet sites" /><category term="SharePoint Summit Toronto" /><category term="Audiences" /><category term="Event Handlers" /><category term="infrastructure update" /><category term="Thesaurus" /><category term="Begginer Guide" /><category term="Links" /><category term="Macro" /><category term="WTF" /><category term="Visual Studio 2010 Beta" /><category term="folders" /><category term="Video" /><category term="sharepoint 2010 book" /><category term="hardware" /><category term="Search Customization" /><category term="XSLT Data Views" /><category term="SharePoint Hierarchical Tasks" /><category term="Office 365" /><category term="Canberra User Group" /><category term="Nested Tasks Project" /><category term="Recommended SharePoint Products" /><category term="SharePoint 2007" /><category term="jQuery" /><category term="XSLT" /><category term="SharePoint How To Book" /><category term="Certification" /><category term="silverlight" /><category term="MVP Summit 2008" /><category term="Office" /><category term="SharePoint 2010 Beta" /><category term="SharePoint 2003" /><category term="Workflow" /><category term="CAML" /><category term="April Fools" /><category term="web services" /><category term="Web Part Development" /><category term="Search" /><category term="Windows 2008 R2 Server" /><category term="Office 2010" /><category term="Best Practices" /><category term="SharePoint Conference 2010 South East Asia" /><category term="SharePoint Product recommendation of the week" /><category term="Error Messages" /><category term="Open Source" /><category term="SharePoint Conference 2010 Australia" /><category term="Development" /><category term="site definitions" /><category term="sandboxed solutions" /><category term="Assembly" /><category term="Upgrade" /><category term="Features" /><category term="User Profiles" /><category term="Tech Ed 2008" /><category term="SharePoint Designer" /><category term="Free Web Parts" /><category term="Free Downloads" /><category term="Code Sample" /><category term="Datasheet View" /><category term="Databases" /><category term="Site Columns" /><category term="Custom fields" /><category term="Extelligent Design" /><category term="InfoPath" /><title>Sharepoint Tips And Tricks</title><subtitle type="html">Sharepoint Tips And Tricks is Ishai Sagi's sharepoint information blog. It specializes in Microsoft SharePoint technologies, including web parts, development, configuration, customization, and best practices for the use of Microsoft SharePoint Server and Windows SharePoint Services.
It also provides some related Office Information, including VSTO and VSTA and other office application development tips.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.sharepoint-tips.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>386</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/sharepoint-tips/ToIC" /><feedburner:info uri="sharepoint-tips/toic" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;A0MHRH87cCp7ImA9WhBaEEQ.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-7786299932182999729</id><published>2013-05-20T18:23:00.002-07:00</published><updated>2013-05-20T18:23:55.108-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-20T18:23:55.108-07:00</app:edited><title>Activating the Document ID feature by code causes document sets welcome pages to show each web part twice</title><content type="html">&lt;p&gt;This is a weird one - I have a feature, that when activated loops over a list of other features and activates them - using "Force" : &lt;br/&gt;&lt;br /&gt;
&lt;span style="font-family: Consolas;"&gt;site.Features.Add(currentFeatureID, true);&lt;/span&gt;&lt;br /&gt;
&lt;br/&gt;&lt;br /&gt;
This works fine on most sites, but in Document Center sites, where the document ID feature is already activated document sets in the site suddenly show the web parts on the welcome page twice. I debugged it, and it turns out that this happens when the document ID feature is the culprit. However, this doesn't happen if I activate the ID feature using powershell.&lt;br /&gt;
&lt;br/&gt;&lt;br /&gt;
My only solution at the moment is to check if the feature is already activated before activating it. This stopped the problem, but doesn't explain it.&lt;br /&gt;
&lt;br /&gt;
 &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/NnQE6AWgLYU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/7786299932182999729/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=7786299932182999729" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7786299932182999729?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7786299932182999729?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/NnQE6AWgLYU/activating-document-id-feature-by-code.html" title="Activating the Document ID feature by code causes document sets welcome pages to show each web part twice" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2013/05/activating-document-id-feature-by-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcDSHc7eSp7ImA9WhBaEEQ.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-3252502181343681938</id><published>2013-05-19T22:47:00.001-07:00</published><updated>2013-05-20T15:47:59.901-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-20T15:47:59.901-07:00</app:edited><title>Finding if a site column exists in a site, by ID</title><content type="html">Scenario - you have an ID of a site column (SPField belonging to SPWeb)and you want to find out if there is a field by that ID in the collection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Problem: if you try something like:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;br /&gt;
web.Fields[fieldID] == null&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result is an exception if the field doesnt exist. What a shame. &lt;br /&gt;
&lt;br /&gt;
The solution is to use the Contains method of the Fields collection:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;br /&gt;
web.Fields.Contains(fieldID)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
*Thanks Ofer Gal for pointing this out.&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/W4aVioinxbU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/3252502181343681938/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=3252502181343681938" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/3252502181343681938?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/3252502181343681938?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/W4aVioinxbU/finding-if-site-column-exists-in-site.html" title="Finding if a site column exists in a site, by ID" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2013/05/finding-if-site-column-exists-in-site.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cMRXo9cSp7ImA9WhBSFEQ.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-215722237772578824</id><published>2013-02-21T15:58:00.001-08:00</published><updated>2013-02-21T15:58:04.469-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-21T15:58:04.469-08:00</app:edited><title>Fields not sortable or filterable</title><content type="html">A client alarmed me today, showing me that in one document library a field I created didn't allow users to filter or sort on it. I couldn't find why in that library it did that, while the same site column in all other libraries allowed filtering and sorting. Checking in sharepoint manager showed no difference between the field in the different libraries - so I was stuck on that one as well.&lt;br /&gt;
&lt;br /&gt;
After a while it dawned on me - the difference between the libraries was that in the one that was misbehaving the column was specified as a key filter - to help users filter and sort on it from the metadata navigation panel. This disabled the sort and filter in the list view. &lt;br /&gt;
&lt;br /&gt;
Learn something new everyday = high blood pressure for the rest of your life.&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/PMGcc098ZVg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/215722237772578824/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=215722237772578824" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/215722237772578824?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/215722237772578824?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/PMGcc098ZVg/fields-not-sortable-or-filterable.html" title="Fields not sortable or filterable" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2013/02/fields-not-sortable-or-filterable.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcGRH46fip7ImA9WhNbEUk.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-8085788185959914737</id><published>2013-01-13T21:40:00.001-08:00</published><updated>2013-01-13T21:40:25.016-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-13T21:40:25.016-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="folders" /><title>Folder sorting in views</title><content type="html">A client has alerted me to an unexpected behavior of list views where folders are involved. &lt;br /&gt;The client wanted to make sure the folders are always on the top of the view, regardless of sort order, and, looking at the settings of the view it should have happened. However, seemingly at random some document libraries stopped doing that, while other libraries were fine.&lt;br /&gt;
After digging into it a bit, I realised what the issue is: enabling and disabling folders.&lt;br /&gt;
&lt;br /&gt;
You see, the client had custom folder content types added to some of the document libraries, and in those libraries the client&amp;nbsp;wanted to make sure the users don't create folders of the built-in content type using the "New Folder" button in the ribbon. To achieve this, they changed the setting in document library advanced settings to not "&lt;strong&gt;&lt;em&gt;Make "New Folder" command available?&lt;/em&gt;&lt;/strong&gt;".&lt;br /&gt;
Turns out that when this setting is set to "no", there are other ramifications than just not showing the new folder command. It also tells views to behave as it there are no folders - and treat all folders items. Result - in those libraries folders were sorted with items, and were not at the top of the views. Makes sense if you consider that that setting is mapped to the SPList.&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
EnableFolderCreation&lt;br /&gt;
in code - meaning it tells the list that folders are not available - even though you can still create folder using the "new" button and choose a content type that inherits from folder.
&lt;br /&gt;
To resolve this, we made sure the "&lt;strong&gt;&lt;em&gt;Make "New Folder" command available?&lt;/em&gt;&lt;/strong&gt;" option is always set to "yes", but we activated a feature that disabled the new folder button itself - not touching the document library setting.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/RSixOcWy9R8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/8085788185959914737/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=8085788185959914737" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/8085788185959914737?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/8085788185959914737?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/RSixOcWy9R8/folder-sorting-in-views.html" title="Folder sorting in views" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2013/01/folder-sorting-in-views.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MFQHg5fyp7ImA9WhNUFU8.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-7181263588981697837</id><published>2013-01-06T19:30:00.000-08:00</published><updated>2013-01-06T19:30:11.627-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-06T19:30:11.627-08:00</app:edited><title>SharePoint error 0x81020030 Invalid file name</title><content type="html">&lt;p&gt;If you try to upload a file to a sharepoint document library, and get an error about invalid file name or url, it could be that your problem has nothing to do with the file name - it could be a problem with a corrupt column that has been added to the document library.&lt;br /&gt;
 &lt;/p&gt;&lt;p&gt;In my case, I had to remove column by column until I found that the issue goes away if I remove a calculated column that I created using a feature (using CAML), and the XML definition of the column was missing a critical attribute - the ResultType attribue. Adding that attribute to my XML solved the problem.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/qwq6110bjq4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/7181263588981697837/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=7181263588981697837" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7181263588981697837?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7181263588981697837?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/qwq6110bjq4/sharepoint-error-0x81020030-invalid.html" title="SharePoint error 0x81020030 Invalid file name" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2013/01/sharepoint-error-0x81020030-invalid.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMFSHs4eyp7ImA9WhNQEEk.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-2232802763012503310</id><published>2012-11-15T21:06:00.003-08:00</published><updated>2012-11-15T21:06:59.533-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-15T21:06:59.533-08:00</app:edited><title>Getting the full name of a feature by code</title><content type="html">&lt;p&gt;When you use the SPFeatureDefinition object, and you want to get the name of the feature you are manipulating, the "DisplayName" property of that object returns a string that is NOT the display name of the feature as you see it when you view the feature list on the site. For example, the display name of "Publishing Infrastructure" feature will be returned as "PublishingSite". &lt;br /&gt;
 &lt;/p&gt;&lt;p&gt;The reason is that the feature list is showing a localized version of the display name - so depending on the language of the site, the name of the feature displayed will be different than the display name the object exposes.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;So, how to get the full display name? the SPFeatureDefinition object has a function called "GetTitle", which, when specifying a language, will return the full name of the feature. The following code sample loops over all features installed in the local farm, and using the English locale:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt; foreach (SPFeatureDefinition def in SPFarm.Local.FeatureDefinitions)
                    {
                        CultureInfo locale = CultureInfo.CreateSpecificCulture("en-US");   
                                                if (def.Hidden)
                            continue;
                        Console.WriteLine(def.GetTitle(locale) + ":" + def.Id.ToString());
                        }
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/dmrh0wQqX60" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/2232802763012503310/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=2232802763012503310" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/2232802763012503310?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/2232802763012503310?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/dmrh0wQqX60/getting-full-name-of-feature-by-code.html" title="Getting the full name of a feature by code" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/11/getting-full-name-of-feature-by-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYGRH8zfyp7ImA9WhJVGEQ.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-6941926863607139016</id><published>2012-09-05T19:22:00.000-07:00</published><updated>2012-09-05T19:22:05.187-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-05T19:22:05.187-07:00</app:edited><title>Repeated authentication prompts from SharePoint</title><content type="html">&lt;p&gt;In the past few weeks I had two clients with a similar issue - both had &lt;strong&gt;some&lt;/strong&gt; users expiriencing multiple requests for user name and password whenever they accessed the site. With one client entering the user name and password sometimes worked, and sometimes would request 10 times and then show the site, and sometimes would just result in a blank, empty page. With the other client, they would always get to a "internet explorer cannot display the web page" error page.&lt;br /&gt;
 &lt;/p&gt;&lt;p&gt;If you research the issue on your favorite search engine, you will find a lot of references to authentication providers (forms, claims and so on), registry issues, trusted sites or intranet zone settings or maybe the users are on the server and the loopback check was not disabled. Well, none of these were valid in the case of these two clients - for one thing, the users were not on the server - they were on their desktops. For another thing - even when the site was added to trusted sites it still happened. Most perpelxingly - with one client it only happenned to users on windows XP, not the users who were on Windows7... &lt;br /&gt;
&lt;/p&gt;&lt;p&gt;After wasting a lot of time troublshooting the issue, I finally realised what must be different between those users and the rest, and why it sometimes worked and sometimes it didn't - it was the proxy server!&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;Turns out both clients had a proxy server, with proxy settings deployed to desktops via group policy. The proxy would behave differently every time it was asked for the new web site address, and would cause an authentication prompt for each image on the page. In one organisation, the proxy settings that were deployed were different for Windows XP users - which explains why only those users expirienced the issues.&lt;/p&gt;&lt;p&gt;The solution? I told the network admins to either add the web site to the proxy exception list in IE (via group policy) or fix the proxy server itself.&lt;br /&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/bohRbh1uNYs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/6941926863607139016/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=6941926863607139016" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/6941926863607139016?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/6941926863607139016?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/bohRbh1uNYs/repeated-authentication-prompts-from.html" title="Repeated authentication prompts from SharePoint" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/09/repeated-authentication-prompts-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEEQ388cSp7ImA9WhJVEkw.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-7736286371793396477</id><published>2012-08-28T21:13:00.001-07:00</published><updated>2012-08-28T21:13:22.179-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-08-28T21:13:22.179-07:00</app:edited><title>Setting a default to the site collection administrator value</title><content type="html">&lt;p&gt;If you are like me, you may find yourself constantly creating site collections manually to test and retest something or other, and scripting the site collection creation doesnt always make sense - depending on what you are testing.&lt;br /&gt;
 &lt;/p&gt;&lt;p&gt;Today I got tired of entering the user name over and over again in the site collection administrator box - it is always the name of my user - which is the only user in my domain as it is a stand along development box. So...I hacked the page for site collection so it would have a default and I won't have to worry about it. Note that this should only be done in development boxes, and at your own risk.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;My solution was to edit the built-in "createsite.aspx" file, sitting at "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\ADMIN\createsite.aspx". In that file I located the "PeopleEditor" control with ID "PickerOwner" and added &lt;b&gt;CommaSeparatedAccounts="mydomain\ishai"&lt;/b&gt;. Save, and done!&lt;br /&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/8OWPMXPfGJE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/7736286371793396477/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=7736286371793396477" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7736286371793396477?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7736286371793396477?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/8OWPMXPfGJE/setting-default-to-site-collection.html" title="Setting a default to the site collection administrator value" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/08/setting-default-to-site-collection.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYMSHoyeSp7ImA9WhJWF0s.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-8767620120439475061</id><published>2012-08-23T16:23:00.001-07:00</published><updated>2012-08-23T16:23:09.491-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-08-23T16:23:09.491-07:00</app:edited><title>Activating Features using PowerShell does not trigger feature event code</title><content type="html">&lt;p&gt;If you ever try to activate a feature using powershell, and the code the feature was supposed to run doesnt run (or it runs, but doesnt reflect your changes) consider this- PowerShell, much like IIS, scans the GAC when it is started and caches the assemblies there. If you redeployed your code with modifications to your feature event handler (or anything else) and use an already open powershell window, the code will fail or will run the old version of the code, because it is cached.&lt;br /&gt;
 &lt;/p&gt;&lt;p&gt;Lesson learnt: always close the powershell window and open a new one when deploying a package...&lt;br /&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/CRYvkufsYek" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/8767620120439475061/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=8767620120439475061" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/8767620120439475061?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/8767620120439475061?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/CRYvkufsYek/activating-features-using-powershell.html" title="Activating Features using PowerShell does not trigger feature event code" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/08/activating-features-using-powershell.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEMSH09eip7ImA9WhJWFUQ.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-4513081333284414826</id><published>2012-08-21T17:25:00.000-07:00</published><updated>2012-08-21T18:08:09.362-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-08-21T18:08:09.362-07:00</app:edited><title>Setting the "AllowedContentTypes" for a document set doesnt work</title><content type="html">&lt;p&gt;I really liked &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/11/29/how-to-provision-a-document-set-using-caml.aspx" target="_blank"&gt;Cory's article&lt;/a&gt; on how to deploy documents sets using declartive XMl. However, when implementing it, I noticed two issues that prevented sharepoint from using the AllowedContentTypes declartion I used.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;The first - the culprit was &lt;b&gt;Inherits="TRUE" Version="0"&lt;/b&gt; in the content type declaration. If I removed those, sharepoint created the content type with the allowed content types properly defined.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;The second one is that the content type that is referenced inside the AllowedContentTypes has to be created by a seperate feature. I had carefully made sure that all the document content types are declared before the document sets, but nothing worked until I seperated the document sets to a seperate feature, with a dependancy on the document content types' feature.&lt;br /&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/sg2qd-z6cwk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/4513081333284414826/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=4513081333284414826" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/4513081333284414826?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/4513081333284414826?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/sg2qd-z6cwk/setting-allowedcontenttypes-for.html" title="Setting the &quot;AllowedContentTypes&quot; for a document set doesnt work" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/08/setting-allowedcontenttypes-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8DRHw6eSp7ImA9WhJWFUQ.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-3256430132269614452</id><published>2012-08-21T17:21:00.000-07:00</published><updated>2012-08-21T17:21:15.211-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-08-21T17:21:15.211-07:00</app:edited><title>Duplicate content type "report" error</title><content type="html">&lt;p&gt;If you have a visual studio project that deploys a content type with the name "Report" - it may work...until you try to deploy it to a different site template. Different site templates in sharepoint contain different built-in content types, which explains why you should test your content type deploying solutions on different templates before announcing them ready for production!&lt;br /&gt;
 &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/wUKAn3M_jWI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/3256430132269614452/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=3256430132269614452" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/3256430132269614452?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/3256430132269614452?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/wUKAn3M_jWI/duplicate-content-type-report-error.html" title="Duplicate content type &quot;report&quot; error" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/08/duplicate-content-type-report-error.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QDQ3s_cSp7ImA9WhJQF0o.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-7949813265049897686</id><published>2012-07-31T17:02:00.000-07:00</published><updated>2012-07-31T17:02:52.549-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-31T17:02:52.549-07:00</app:edited><title>CAML Query on datetime columns</title><content type="html">I always forget (and end up looking it up again), so I might as well write a blog post so I can search my own blog instead of the entire internet.&lt;br /&gt;
&lt;br /&gt;
The issue is when you are doing a CAML query to get items from a sharepoint list, and want to specify a filter based on a datetime column in that list - to be greater than the current date for example. &lt;br /&gt;
&lt;br /&gt;
There are two issues when querying datetime fields - the first, is comparing datet time values in the correct format, and the second is relevant if you want the query to include the time, and not just the date.&lt;br /&gt;
To handle the first, the query requires you to convert the date value you are comparing to, to a format recognised by sharepoint's caml. To do so, you should use &lt;br /&gt;
the &lt;span style="color: #38761d;"&gt;SPUtility.CreateISO8601DateTimeFromSystemDateTime&lt;/span&gt; function on the date value you want to compare to. &lt;br /&gt;
Here is an example of testing that the "Expires" column is greater or equal to the current date:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;geq&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;fieldref name="Expires"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value type="DateTime"&amp;gt;" + SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Now) + @"&amp;lt;/value&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/fieldref&amp;gt;&amp;lt;/geq&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
The second issue is when we want to make the same comparison, but include the time in the query. we have&amp;nbsp;the "Expires" field set to accept both date and a time, the query above will only compare the date - so even items that should have expired an hour ago, would still show - until tomorrow.&lt;br /&gt;
To fix that, we need to add &lt;span style="color: #a31515; font-family: Consolas; "&gt;&lt;span style="color: #a31515; font-family: Consolas; "&gt;&lt;span style="color: #a31515; font-family: Consolas; "&gt;IncludeTimeValue='TRUE' &lt;span style="color: black; font-family: Times New Roman; font-size: small;"&gt;to the value node:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&amp;lt;value includetimevalue="TRUE" type="DateTime"&amp;gt;" + SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Now) + @"&amp;lt;/value&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/A8Y9ldQzRN4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/7949813265049897686/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=7949813265049897686" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7949813265049897686?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7949813265049897686?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/A8Y9ldQzRN4/caml-query-on-datetime-columns.html" title="CAML Query on datetime columns" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/07/caml-query-on-datetime-columns.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcDQHc_cCp7ImA9WhJQE0k.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-1133457087312559635</id><published>2012-07-26T17:11:00.001-07:00</published><updated>2012-07-26T17:14:31.948-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-26T17:14:31.948-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code Sample" /><title>Securing custom application pages</title><content type="html">&lt;p&gt;When you create a custom application page in sharepoint (a page deployed to the layouts folder) as part of a visual studio project, often you will want to make sure it is used by the right people. Especially if the actions on the page happen with elevated privilages. &lt;br /&gt;
&lt;/p&gt;&lt;p&gt;The only security settings you get out of the box is setting rules on when the links to those pages are shown through custom actions. In a custom action you can specify required permissions on the site, and so the link isnt shown to people who are not supposed to use the page.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;The problem is - any user can open the page if they just type the URL in the browser. To avoid this, I always add a bit of script that checks if the user is allowed to use the page. Where? In the Page_Load function!&lt;br /&gt;
&lt;br /&gt;
Here is an example of how I secured a page to only show to web administrators, and I also added a check that a required feature has to be activated in the site or the page will not display. For this purpose, I made sure all the controls in the web page are in a panel called pnlControls - so I can easily hide them when the user shouldnt be using the page. I also created a lable called lblErrors outside the panel - so I can so an error to the user if they are not supposed to use the page. An alternative would be to just redirect the user to the site's home page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the sample:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;protected void Page_Load(object sender, EventArgs e)
{
            lblErrors.Visible=false;
            if (!IsFeatureActivated(SPContext.Current.Web, new Guid(Constants.C_SiteActionsFeatureID)))
            {
                lblErrors.Visible=true;
                lblErrors.Text = "The required feature is not activated in this site. This page is not available when the feature is not activated.";
                pnlControls.Visible = false;
                return;
            }
            if (!SPContext.Current.Web.UserIsWebAdmin)
            {
                lblErrors.Visible = true;
                lblErrors.Text = "You don't have permissions to view this page. Only web administrators are allowed to use the functionality on this page.";
                pnlControls.Visible = false;
                return;
            }
}

public static bool IsFeatureActivated(SPWeb web, Guid featureId)
        {
            return web.Features[featureId] != null;
        }

&lt;/pre&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/XyI-Jhynqiw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/1133457087312559635/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=1133457087312559635" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/1133457087312559635?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/1133457087312559635?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/XyI-Jhynqiw/security-custom-application-pages.html" title="Securing custom application pages" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/07/security-custom-application-pages.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcDRH47fCp7ImA9WhJRGEk.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-6286465256044856476</id><published>2012-07-20T21:14:00.002-07:00</published><updated>2012-07-20T21:14:35.004-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-20T21:14:35.004-07:00</app:edited><title>Troubleshooting SharePoint 2010 issues</title><content type="html">Friend and colleague&amp;nbsp;in &lt;a href="http://www.exd.com.au/"&gt;Extelligent Design&lt;/a&gt; Jeremy Taylor is doing a webcast on Troubleshooting SharePoint 2010 issues (with some 2013 coverage). Head over to his blog to register!&lt;br /&gt;
&lt;a href="http://www.jeremytaylor.net/webcast/"&gt;http://www.jeremytaylor.net/webcast/&lt;/a&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/11LSQVYJpvI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/6286465256044856476/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=6286465256044856476" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/6286465256044856476?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/6286465256044856476?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/11LSQVYJpvI/troubleshooting-sharepoint-2010-issues.html" title="Troubleshooting SharePoint 2010 issues" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/07/troubleshooting-sharepoint-2010-issues.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEMR3o8eyp7ImA9WhJREEs.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-8727829945889471324</id><published>2012-07-11T20:44:00.003-07:00</published><updated>2012-07-11T20:44:46.473-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-11T20:44:46.473-07:00</app:edited><title>Reporting code errors when running code in SPLongOperation</title><content type="html">As we all know, SPLongOperation is a great device to run a bit of code that takes a long time, while showing the user a turning cogwheel, and then redirecting when the operation is done.&lt;br /&gt;
However, when I checked, I saw people are on the search for a way to properly report on errors that happen during the long&amp;nbsp;operation.&lt;br /&gt;
Some solutions involve redirecting to a new page, and passing the errors' details in the query string, or in some other way. Another way is to use the "EndScript" method to show a javascript "alert" (a messagebox, with the details.&lt;br /&gt;
I'd like to propose a different way. The page that is showing the cogwheel can be modified using the same javascript ("EndScript" method) by injecting html with the error details into the 's4-simple-card-content' div.&amp;nbsp;This is critical if the page that is doing the long operation was opened as a dialog - in which case redirecting can be confusing, and we want to show the error if there was one, or close the dialog if there wasnt.&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;SPLongOperation&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt; longOp = &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;SPLongOperation&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;this&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;.Page);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt; &lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;StringBuilder&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt; sbErrors = &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;StringBuilder&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;            longOp.Begin();&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;throw new &lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt;&lt;span style="color: black;"&gt;("Sample");&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;}&lt;br /&gt;
&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;catch&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: x-small;"&gt;Exception&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt; ex)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;{ &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;sbErrors.Append("An error occurred: " + ex.MEssage);&lt;br /&gt;

}&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;(sbErrors.Length &amp;gt; 0)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;                {&lt;br /&gt;

longOp.EndScript(&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;"document.getElementById('s4-simple-card-content').innerHTML = \"&lt;b&gt;Errors have occurred during the submission.&lt;/b&gt;
Details: &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt; + sbErrors.ToString() + &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;\";"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;                }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: green; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: green; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: green; font-family: Consolas; font-size: x-small;"&gt;//close the dialog if there were no errors&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;longOp.EndScript(&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: #a31515; font-family: Consolas; font-size: x-small;"&gt;"window.frameElement.commitPopup();"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-family: Consolas; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/8QKLqwKYOx0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/8727829945889471324/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=8727829945889471324" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/8727829945889471324?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/8727829945889471324?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/8QKLqwKYOx0/reporting-code-errors-when-running-code.html" title="Reporting code errors when running code in SPLongOperation" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/07/reporting-code-errors-when-running-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4AQnw_eSp7ImA9WhVUEk4.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-7054301950655667928</id><published>2012-05-17T00:15:00.002-07:00</published><updated>2012-05-17T00:15:43.241-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-17T00:15:43.241-07:00</app:edited><title>SharePoint Upgrade or Migrate</title><content type="html">Hello again everyone.&lt;br /&gt;
In March I have published an article in IDM magazine (australia) about upgrading sharepoint and what is the difference between that and migration, and the pros and cons of each one. I even gave tips to successfull upgrade\migration projects. If you want to read it, I have now republished it in my company's site:&lt;br /&gt;
&lt;a href="http://www.extelligentdesign.com/Articles/UpgradingSharePoint.aspx"&gt;http://www.extelligentdesign.com/Articles/UpgradingSharePoint.aspx&lt;/a&gt;&lt;br /&gt;
Feel free to drop me comments on the article here (and please feel free to tell people about it).&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/5m3z7S7IDN4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/7054301950655667928/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=7054301950655667928" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7054301950655667928?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7054301950655667928?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/5m3z7S7IDN4/sharepoint-upgrade-or-migrate.html" title="SharePoint Upgrade or Migrate" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/05/sharepoint-upgrade-or-migrate.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MGQXwyfyp7ImA9WhVVGUU.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-6261002405581747388</id><published>2012-05-14T02:57:00.000-07:00</published><updated>2012-05-14T02:57:00.297-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-14T02:57:00.297-07:00</app:edited><title>Useful Event handlers for SharePoint</title><content type="html">In a few of my recent posts,&amp;nbsp;I wrote about event handlers to set titles and permissions on items automatically as items are created. Since then, I have received a lot of questions from none developers who wanted to use the code samples, but didnt want to compile themselves, and didnt want to go through&amp;nbsp;making the code more generic and robust. So I have done the work for&amp;nbsp;everyone out there who wants to&amp;nbsp;have the code samples as a downloadable product.&lt;br /&gt;
The product&amp;nbsp;I am now selling&amp;nbsp;as part of my Company's offerings is&amp;nbsp;called "Extelligent Design's SharePoint List Events&amp;nbsp;Package". The idea is that I will keep&amp;nbsp;adding event handlers to that package, so you pay once, and get a whole lot of functionality. The event handlers are as flexible as possible - allowing you to configure what permissions are assigned&amp;nbsp;and to whome,&amp;nbsp;or what format the title of the list items or documents&amp;nbsp;should be, and even hide the title field from users in the&amp;nbsp;editing forms.&lt;br /&gt;
If you purchase, not only do you get the code compiled, you also benefit from 1 year support (patches and added features).&lt;br /&gt;
To read more, and to purchase, go to the &lt;a href="http://www.extelligentdesign.com/SitePages/List%20Events%20Package.aspx"&gt;product's page&lt;/a&gt; in our web site.&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/w6jI_aBMzPM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/6261002405581747388/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=6261002405581747388" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/6261002405581747388?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/6261002405581747388?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/w6jI_aBMzPM/useful-event-handlers-for-sharepoint.html" title="Useful Event handlers for SharePoint" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/05/useful-event-handlers-for-sharepoint.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UDQ386fip7ImA9WhRbFks.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-6361168112465672189</id><published>2012-02-06T19:50:00.000-08:00</published><updated>2012-02-07T16:34:32.116-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-07T16:34:32.116-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code Sample" /><category scheme="http://www.blogger.com/atom/ns#" term="Free Downloads" /><title>Enabling Managed Metadata in Office365 (includes download)</title><content type="html">If you have office365 or other hosted sharepoint solutions, you may find that the managed metadata column is not available to use - it shows an error that "the required feature is not enabled for this column type".
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-xGDbJVImZ7Y/TzCdxvwn1CI/AAAAAAAAEls/emECT73INp4/s1600/featurenotenabled.jpg" imageanchor="1"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-xGDbJVImZ7Y/TzCdxvwn1CI/AAAAAAAAEls/emECT73INp4/s400/featurenotenabled.jpg" width="346" /&gt;&lt;/a&gt;&lt;/div&gt;
There are two possible reasons. The first - you don't have a hosted site that supports managed metadata. To check if that is the case, check with your hosting company, or, if you have Office365, you should have a "manage term store" link in your sharepoint online administration centre. If you dont have that link, then you cannot have managed metadata - sorry.&lt;br/&gt;
The other possibility is because a feature that is needed on the site is not enabled by default, and because it is a hidden feature you will not be able to activate it yourself.
&lt;br /&gt;
If you search for this, you will find a lot of articles about how to solve it on a regular sharepoint farm using either command line or powershell. However, what happens if you don't have access to the server, such as in the case of SharePoint online (Office365) or a hosted environment?
&lt;br /&gt;
In such a case, you need to use a sandboxed solution to enable the feature. To simplify this, I have created a sandbox solution that has a single feature called "Enable Managed Metadata":
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-IDO2r_HEyeQ/TzCdxYmKbBI/AAAAAAAAElk/L5axxw3KO1Q/s1600/feature%2Bto%2Benable.jpg" imageanchor="1"&gt;&lt;img border="0" height="22" src="http://2.bp.blogspot.com/-IDO2r_HEyeQ/TzCdxYmKbBI/AAAAAAAAElk/L5axxw3KO1Q/s640/feature%2Bto%2Benable.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
This feature simply activates and deactivates the managed metadata feature.
&lt;br /&gt;
To download this solution, visit my company's web site's &lt;a href="http://www.extelligentdesign.com/Code%20Sample%20Downloads/Forms/AllItems.aspx" target="_blank"&gt;code sample library&lt;/a&gt; or click &lt;a href="http://www.extelligentdesign.com/Code%20Sample%20Downloads/Extelligent%20Design%20Office365%20Enable%20Managed%20Metadata.wsp" target="_blank"&gt;this direct download link&lt;/a&gt;.
&lt;br /&gt;
After you have downloaded the solution, you need to upload it to your site. Go to the site's settings page, and click the "Solutions" link to go to the solution gallery. Here, click on "Solutions" in the ribbon and then "upload solution" button. Browse to the file you downloaded, and upload the file. Once uploaded you will have the option to Activate the solution. This should also automatically activate the feature, so from that moment on you can start creating managed metadata columns!

&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-o8gdXa3mKJ4/TzCdxr_FPpI/AAAAAAAAEl8/HTPa7bQy8AU/s1600/solution%2Bto%2Bactivate.jpg" imageanchor="1"&gt;&lt;img border="0" height="305" src="http://2.bp.blogspot.com/-o8gdXa3mKJ4/TzCdxr_FPpI/AAAAAAAAEl8/HTPa7bQy8AU/s640/solution%2Bto%2Bactivate.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;/p&gt;
&lt;p&gt;While you'r there, would you mind clicking the "like" button for our web site?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/_0e3whExGfo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/6361168112465672189/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=6361168112465672189" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/6361168112465672189?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/6361168112465672189?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/_0e3whExGfo/enabling-managed-metadata-in-office365.html" title="Enabling Managed Metadata in Office365 (includes download)" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-xGDbJVImZ7Y/TzCdxvwn1CI/AAAAAAAAEls/emECT73INp4/s72-c/featurenotenabled.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/02/enabling-managed-metadata-in-office365.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4ERH8yfyp7ImA9WhRVFkU.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-3694707852978026793</id><published>2012-01-15T19:35:00.000-08:00</published><updated>2012-01-15T19:35:05.197-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-15T19:35:05.197-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Event Handlers" /><category scheme="http://www.blogger.com/atom/ns#" term="Code Sample" /><category scheme="http://www.blogger.com/atom/ns#" term="events" /><title>The importance of synchronous event handlers</title><content type="html">&lt;p&gt;
In SharePoint, we can create list item event handlers (or receivers). I have written about this in the past, and even posted some code for setting the security automatically on a list item as it is created.&lt;br/&gt;Now, there is one thing I wanted to write about this topic. Event handlers can be defined as either Synchronous or Asynchronous - regardless of the event type. By default, events were always asynchronous if they had the "ed" suffix (ItemAdd&lt;b&gt;ed&lt;/b&gt;, ItemUpdat&lt;b&gt;ed&lt;/b&gt;), and synchronous if they had the "ing" suffix (ItemAdd&lt;b&gt;ing&lt;/b&gt;, ItemUpdat&lt;b&gt;ing&lt;/b&gt;). However, sometimes we want to run our code in an "ed" event, but have it synchronous (notice that the opposite is impossible have the "ing" properties to run asynchronously)- for example, when we want to modify item properties when its added, but before the user has been redirected to a new page. &lt;br/&gt;
A classic example is the upload of a document to a document library. The user gets prompted to browse for a file and clicks upload. The next page would be the properties page for the file that was uploaded. If we want to set some of the properties to be pre-filled for the user, we have to do that after the file has been uploaded - but we cannot do that in ItemAdding, as at that point we don't have access to the item - it wasn't created yet. In ItemAdded we can set values to the item - but by default this event is asynchronous - and sharepoint will show the user the properties dialog while the event is still happening in the background. The result is disastrous : the user sees the properties screen, clicks "Save" and gets an error telling him or her that the item has been modified by another process or user.&lt;/p&gt;&lt;p&gt;
To resolve this we use the "Synchronization" XML tag in the receiver's registration XML with the value set to "Synchronous" or, if the receiver is registered using server object model code, we set the "Synchronization" property of the receiver class to SPEventReceiverSynchronization.Synchronous. To quote MSDN: "Synchronous processing provides the ability to run the event in the same thread before sending the Web response back to the browser."
&lt;/p&gt;
&lt;p&gt;
As an example, lets create an event receiver that sets the title of a file to the file name, as the file is being uploaded. The code is simple:


&lt;!-- HTML generated using hilite.me --&gt;&lt;div style="background: #ffffff; overflow:auto;width:auto;color:black;background:white;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"&gt;&lt;pre style="margin: 0; line-height: 125%"&gt;&lt;span style="color: #008000; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;override&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;void&lt;/span&gt; &lt;span style="color: #0060B0; font-weight: bold"&gt;ItemAdded&lt;/span&gt;(SPItemEventProperties properties)
       {
           &lt;span style="color: #008000; font-weight: bold"&gt;base&lt;/span&gt;.ItemAdded(properties);
           &lt;span style="color: #008000; font-weight: bold"&gt;if&lt;/span&gt; (properties.ListItem[&lt;span style="background-color: #fff0f0"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;] == &lt;span style="color: #008000; font-weight: bold"&gt;null&lt;/span&gt;)
           {
               &lt;span style="color: #303090; font-weight: bold"&gt;int&lt;/span&gt; startingPoint = properties.AfterUrl.LastIndexOf(&lt;span style="background-color: #fff0f0"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;);
               properties.ListItem[&lt;span style="background-color: #fff0f0"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;] = properties.AfterUrl.Substring(startingPoint + &lt;span style="color: #6000E0; font-weight: bold"&gt;1&lt;/span&gt;);
               properties.ListItem.Update();
           }
       }
&lt;/pre&gt;&lt;/div&gt;
&lt;br/&gt;
Now, the XML that registers the receiver is :
&lt;!-- HTML generated using hilite.me --&gt;&lt;div style="background: #ffffff; overflow:auto;width:auto;color:black;background:white;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"&gt;&lt;pre style="margin: 0; line-height: 125%"&gt;&lt;span style="color: #007000"&gt;&amp;lt;Receivers&lt;/span&gt; &lt;span style="color: #0000C0"&gt;ListTemplateId=&lt;/span&gt;&lt;span style="background-color: #fff0f0"&gt;&amp;quot;101&amp;quot;&lt;/span&gt;&lt;span style="color: #007000"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="color: #007000"&gt;&amp;lt;Receiver&amp;gt;&lt;/span&gt;
        &lt;span style="color: #007000"&gt;&amp;lt;Name&amp;gt;&lt;/span&gt;SetTitleFromFileNameItemAdding&lt;span style="color: #007000"&gt;&amp;lt;/Name&amp;gt;&lt;/span&gt;
        &lt;span style="color: #007000"&gt;&amp;lt;Type&amp;gt;&lt;/span&gt;ItemAdded&lt;span style="color: #007000"&gt;&amp;lt;/Type&amp;gt;&lt;/span&gt;
        &lt;span style="color: #007000"&gt;&amp;lt;Assembly&amp;gt;&lt;/span&gt;$SharePoint.Project.AssemblyFullName$&lt;span style="color: #007000"&gt;&amp;lt;/Assembly&amp;gt;&lt;/span&gt;
        &lt;span style="color: #007000"&gt;&amp;lt;Class&amp;gt;&lt;/span&gt;DocumentTitleSetter.SetTitleFromFileName.SetTitleFromFileName&lt;span style="color: #007000"&gt;&amp;lt;/Class&amp;gt;&lt;/span&gt;
        &lt;span style="color: #007000"&gt;&amp;lt;SequenceNumber&amp;gt;&lt;/span&gt;10000&lt;span style="color: #007000"&gt;&amp;lt;/SequenceNumber&amp;gt;&lt;/span&gt;
        &lt;span style="color: #007000"&gt;&amp;lt;Synchronization&amp;gt;&lt;/span&gt;Synchronous&lt;span style="color: #007000"&gt;&amp;lt;/Synchronization&amp;gt;&lt;/span&gt;
      &lt;span style="color: #007000"&gt;&amp;lt;/Receiver&amp;gt;&lt;/span&gt;

  &lt;span style="color: #007000"&gt;&amp;lt;/Receivers&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
Now, when uploading a file, the users are first asked for the file:&lt;br/&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-t9o8_zVA7ws/TxOXncKVi0I/AAAAAAAAEjo/cdyhLMgXKr4/s1600/uploading-before.jpg" imageanchor="1" style=""&gt;&lt;img border="0" height="237" width="400" src="http://4.bp.blogspot.com/-t9o8_zVA7ws/TxOXncKVi0I/AAAAAAAAEjo/cdyhLMgXKr4/s400/uploading-before.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;


And when they upload, they see the dialog allowing them to change the file's name, and by magic the title is already filled for them!&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-bAhFh2wXdik/TxOXnZUn7hI/AAAAAAAAEjw/SY_C_-UnnNs/s1600/uploading-after.jpg" imageanchor="1" style=""&gt;&lt;img border="0" height="243" width="400" src="http://2.bp.blogspot.com/-bAhFh2wXdik/TxOXnZUn7hI/AAAAAAAAEjw/SY_C_-UnnNs/s400/uploading-after.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;
Where can this be useful? I can think of a very real world example: assigning a number to a document as it is being uploaded. The title setting event can be critical in some scenarios where we have lists with lookup columns to a document library - since the lookup column cannot show the file name column we need to show the title, which means we cannot have an empty title (in which scenario you will also want to set the title to unique, and add extra code to make sure the title you are setting is not unique - dont assume that because it is a copy of the file name there wont be duplicates - remember that users may edit both file names and titles!).
&lt;/p&gt;
&lt;p&gt;Just in case someone finds this useful, I am uploading the code, and the compiled solution package to my company's web site as a free, open source solution for anyone to use on their own risk. I have tested this to work with Office365 (SharePoint online) and as a farm solution - so enjoy!. You can find all my company's free code samples and solutions in our &lt;a href="http://www.extelligentdesign.com/Code%20Sample%20Downloads" target="_blank" title="Extelligent Design - Canberra Based SharePoint Consulting"&gt;document library on our web site&lt;/a&gt;. The specific files are: &lt;a title="Source code for event receiver by Extelligent Design - SharePoint experts in Canberra" href="http://www.extelligentdesign.com/Code%20Sample%20Downloads/DocumentTitleSetter.zip"&gt;[Source Code]&lt;/a&gt; and &lt;a title="Packaged free solution for event receiver by Extelligent Design - SharePoint experts in Canberra" href="http://www.extelligentdesign.com/Code%20Sample%20Downloads/DocumentTitleSetter.wsp"&gt;[Sandbox Ready Package]&lt;/a&gt;.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/81BLlNwGoTQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/3694707852978026793/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=3694707852978026793" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/3694707852978026793?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/3694707852978026793?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/81BLlNwGoTQ/importance-of-synchronous-event.html" title="The importance of synchronous event handlers" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-t9o8_zVA7ws/TxOXncKVi0I/AAAAAAAAEjo/cdyhLMgXKr4/s72-c/uploading-before.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2012/01/importance-of-synchronous-event.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YBRHs8eip7ImA9WhRSFEQ.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-7207639494308595056</id><published>2011-11-16T00:12:00.000-08:00</published><updated>2011-11-16T16:52:35.572-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-16T16:52:35.572-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Event Handlers" /><category scheme="http://www.blogger.com/atom/ns#" term="Code Sample" /><title>Event handler to archive items when deleted</title><content type="html">&lt;p&gt;A person just asked this on a mailing list I am on, so I thought I'd share this code. The requirement - copy a list item that is deleted to an archive list. The solution - event receiver that copies the item. The code below does the job, but again is only a sample - you still need to implement error handling, and there are hard coded variables there you will want to change. &lt;br/&gt;
Note: this code is specifically for list items, not for documents in document libraries. You can easily change the code to support documents as well (see the CopyAttachments function for an example on how to copy files).
&lt;/p&gt;
&lt;p&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, "Courier New", Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ItemDeleting(SPItemEventProperties properties)
       {
           &lt;span class="rem"&gt;//note: may require permission elevation.&lt;/span&gt;
           &lt;span class="rem"&gt;//TODO: add error handling&lt;/span&gt;

           &lt;span class="rem"&gt;//get the item being deleted&lt;/span&gt;
           SPListItem item = properties.ListItem;
           &lt;span class="rem"&gt;//get the target list&lt;/span&gt;
           SPList targetList = properties.Web.Lists[&lt;span class="str"&gt;"Announcements Archive"&lt;/span&gt;];
           &lt;span class="rem"&gt;//create the new item&lt;/span&gt;
           SPListItem newItem = targetList.Items.Add();
           &lt;span class="rem"&gt;//copy the list item to the target&lt;/span&gt;
           &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (SPField f &lt;span class="kwrd"&gt;in&lt;/span&gt; item.Fields)
           {
                &lt;span class="kwrd"&gt;if&lt;/span&gt; (!f.ReadOnlyField &amp;amp;&amp;amp; newItem.Fields.ContainsField(f.InternalName))
                    newItem[newItem.Fields.GetFieldByInternalName(f.InternalName).Id] = item[f.Id];   
           }
           &lt;span class="rem"&gt;//copy "special" read only fields that can be written to&lt;/span&gt;
           newItem[&lt;span class="str"&gt;"Created By"&lt;/span&gt;] = item[&lt;span class="str"&gt;"Created By"&lt;/span&gt;];
           newItem[&lt;span class="str"&gt;"Modified By"&lt;/span&gt;] = item[&lt;span class="str"&gt;"Modified By"&lt;/span&gt;];
           newItem[&lt;span class="str"&gt;"Modified"&lt;/span&gt;] = item[&lt;span class="str"&gt;"Modified"&lt;/span&gt;];
           newItem[&lt;span class="str"&gt;"Created"&lt;/span&gt;] = item[&lt;span class="str"&gt;"Created"&lt;/span&gt;];
           newItem.SystemUpdate(&lt;span class="kwrd"&gt;false&lt;/span&gt;);
           CopyAttachments(item, newItem);
           &lt;span class="kwrd"&gt;base&lt;/span&gt;.ItemDeleting(properties);
       }&lt;/pre&gt;
&lt;br/&gt;
Note - for the "CopyAttachments" I used code that I published in the past: &lt;a href="http://www.sharepoint-tips.com/2008/11/how-to-copy-attachments-from-one-list.html"&gt;http://www.sharepoint-tips.com/2008/11/how-to-copy-attachments-from-one-list.html&lt;/a&gt;

&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/cWV_s4H_oE0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/7207639494308595056/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=7207639494308595056" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7207639494308595056?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7207639494308595056?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/cWV_s4H_oE0/event-handler-to-archive-items-when.html" title="Event handler to archive items when deleted" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2011/11/event-handler-to-archive-items-when.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UAQ3k9eSp7ImA9WhRSFE8.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-4298855651651155099</id><published>2011-11-15T23:28:00.000-08:00</published><updated>2011-11-15T23:40:42.761-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-15T23:40:42.761-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Event Handlers" /><category scheme="http://www.blogger.com/atom/ns#" term="Code Sample" /><title>Setting item permissions for new items</title><content type="html">&lt;p&gt;A common question that I recently answered in a sharepoint conference is how to make a sharepoint list only show items to the users who wrote the items, and users specified in the item's properties.&lt;br/&gt;A good example of this is a task list where only the original creator of the task and the assignee can see and change the task. This is impossible to do in sharepoint out of the box, and that is where we, as developers, come in.
&lt;br/&gt;The way to do it is by developing a simple event handler and attaching it to the list. I prefer to attach to ItemAdded and ItemUpdated - put the exact same code in both events (so that people can reassign the task). The code sample below is a good starting point for you to figure out how to do this. The code sample assumes you know how to use visual studio to create a new event handler, and is meant only as a sample - it doesn't have error handling and it does have some hard coded values for a task list that you may want to change.&lt;br/&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, "Courier New", Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ItemAdded(SPItemEventProperties properties)
        {
            &lt;span class="rem"&gt;//get the list item that was created&lt;/span&gt;
            SPListItem item = properties.ListItem;
            &lt;span class="rem"&gt;//get the author user who created the task&lt;/span&gt;
            SPFieldUserValue valAuthor = &lt;span class="kwrd"&gt;new&lt;/span&gt; SPFieldUserValue(properties.Web, item[&lt;span class="str"&gt;"Created By"&lt;/span&gt;].ToString());
            &lt;span class="rem"&gt;//get the "assigned to" user. Note - this will throw an error if the task is not assigned to anyone - implement error handling!&lt;/span&gt;
            SPFieldUserValue valAssignedTo = &lt;span class="kwrd"&gt;new&lt;/span&gt; SPFieldUserValue(properties.Web, item[&lt;span class="str"&gt;"Assigned To"&lt;/span&gt;].ToString());
            &lt;span class="rem"&gt;//disconnect the security from the list, and delete all permissions&lt;/span&gt;
            item.BreakRoleInheritance(&lt;span class="kwrd"&gt;false&lt;/span&gt;);
            &lt;span class="rem"&gt;//create the object that will hold the roles for the author user&lt;/span&gt;
            SPRoleAssignment authorRole = &lt;span class="kwrd"&gt;new&lt;/span&gt; SPRoleAssignment(valAuthor.User);
            &lt;span class="rem"&gt;//create the object that will hold the roles for the assigned to user&lt;/span&gt;
            SPRoleAssignment assignedToRoles = &lt;span class="kwrd"&gt;new&lt;/span&gt; SPRoleAssignment(valAssignedTo.User);

            &lt;span class="rem"&gt;//get the contribute role from the web. Alternatively use code to create a new role definition with custom permissions.&lt;/span&gt;
            SPWeb oWebsite = properties.Web;
            SPRoleDefinitionCollection collRoles = oWebsite.RoleDefinitions;
            SPRoleDefinition oRoleDefinition = collRoles[&lt;span class="str"&gt;"Contribute"&lt;/span&gt;];

            &lt;span class="rem"&gt;//assign permissions to task author&lt;/span&gt;
            authorRole.RoleDefinitionBindings.Add(oRoleDefinition);
            item.RoleAssignments.Add(authorRole);
            &lt;span class="rem"&gt;//assign permissions to task assignee&lt;/span&gt;
            assignedToRoles.RoleDefinitionBindings.Add(oRoleDefinition);
            item.RoleAssignments.Add(assignedToRoles);
            &lt;span class="rem"&gt;//update the item&lt;/span&gt;
            item.Update();
            &lt;span class="kwrd"&gt;base&lt;/span&gt;.ItemAdded(properties);
        }&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
You can download the entire code sample as a visual studio project from my company's site's code samples document library at &lt;a href="http://www.extelligentdesign.com/Code%20Sample%20Downloads/Forms/AllItems.aspx" target="_blank" title="Extelligent Design SharePoint Code Samples"&gt;http://www.extelligentdesign.com/Code%20Sample%20Downloads/Forms/AllItems.aspx&lt;/a&gt;. You will want to change the project's properties to point to your local development site before debugging.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/InKYyvLT9iE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/4298855651651155099/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=4298855651651155099" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/4298855651651155099?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/4298855651651155099?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/InKYyvLT9iE/setting-item-permissions-for-new-items.html" title="Setting item permissions for new items" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2011/11/setting-item-permissions-for-new-items.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MNSXo-eip7ImA9WhdbF0k.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-7453884894561668592</id><published>2011-10-15T22:25:00.000-07:00</published><updated>2011-10-15T23:11:38.452-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-15T23:11:38.452-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint Conference 2011 South East Asia" /><title>Speaking in the upcoming Asia conferences</title><content type="html">&lt;p&gt;
Next month I will be in both Singapore and Hong Kong for the Asian sharepoint conferences. If you are coming, why not jump in my session to learn about sharepoint development? Who knows, there may be prizes...
&lt;br/&gt;
&lt;a href="http://www.sharepointconference.asia/hk/2011/"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 400px;" src="http://3.bp.blogspot.com/-cyIubM05Cg8/Tpp1OF2KBVI/AAAAAAAAEY4/jJn1ijHkADk/s400/HKImSpeakingBadge.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5663968366319764818" /&gt;&lt;/a&gt;


&lt;br/&gt;

&lt;a href="http://www.sharepointconference.asia/SEA/2011"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 400px;" src="http://3.bp.blogspot.com/--iXW0bR6AeY/Tpp1N1YXdgI/AAAAAAAAEYs/CufKf4gnvnk/s400/SEAImSpeakingBadge.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5663968361899849218" /&gt;&lt;/a&gt;
&lt;br/&gt;

&lt;a href="http://www.sharepointconference.asia"&gt;http://www.sharepointconference.asia&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/0qgWM5Z41W8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/7453884894561668592/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=7453884894561668592" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7453884894561668592?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/7453884894561668592?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/0qgWM5Z41W8/speaking-in-upcoming-asia-conferences.html" title="Speaking in the upcoming Asia conferences" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-cyIubM05Cg8/Tpp1OF2KBVI/AAAAAAAAEY4/jJn1ijHkADk/s72-c/HKImSpeakingBadge.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2011/10/speaking-in-upcoming-asia-conferences.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIHR3Yyfip7ImA9WhdbFk4.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-5389461743519577983</id><published>2011-10-14T00:08:00.000-07:00</published><updated>2011-10-14T16:22:16.896-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-14T16:22:16.896-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code Sample" /><category scheme="http://www.blogger.com/atom/ns#" term="Features" /><title>Setting the images for a publishing page from a module</title><content type="html">&lt;p&gt;Here is a small tip for developers (about time I wrote one again). What do you do if you want to provision a publishing page to a sharepoint site, and set the page's image (or rollup image) during the provisioning?
&lt;br/&gt;Well, step one should be obvious - make sure you upload the image you want to display. This can be done in the same feature or a seperate one. I will assume that you already know how do do that (if not, then the MSDN article "&lt;a href="http://msdn.microsoft.com/en-us/library/ms441170.aspx"&gt;how to provision a file&lt;/a&gt;" is your friend). The same goes for actually how to build the feature and module that uploads your publishing page (again, refer to the MSDN article, or better yet, see my friend Waldek's &lt;a href="http://blog.mastykarz.nl/provisioning-publishing-pages-features-declarative-markup/"&gt;article discussing just this&lt;/a&gt;).
&lt;br/&gt;
So what am I talking about? I want to focus on how to set two specific properties on the page - the page's image and the page's rollup image. These two are not regular properties, since they are publishing properties. They do not expect the same kind of value that regular image properties expect (which is the same as a hyperlink - first part is the link to the image, than a space and a comma and then the description of the image). With publishing fields you need to supply the actual HTML that will be shown as the image.
&lt;br/&gt;
Since this is done in the module, you will have to create a "Property" element in your "File" element in the module. The value of that property should be the HTML, but encoded so that the XML doesnt become invalid. The value (when not encoded) should look like this:
&lt;br/&gt;
&lt;br/&gt;&lt;font color='red'&gt;
&amp;lt;img alt='This is a picture of a chicken' src='/PublishingImages/chicken.jpg' style='border:0px solid;'&amp;gt;&lt;/font&gt;
&lt;br/&gt;
&lt;br/&gt;
And the entire property (with the value encoded) should look like this:
&lt;br/&gt;
&lt;br/&gt;&lt;font color='red'&gt;
&amp;lt;Property Name="PublishingRollupImage" Value="&amp;amp;lt;img alt='AFL peace Team at Whitten Oval' src='/newsandblog/PublishingImages/22-gal-tn.jpg' style='border:0px solid;'&amp;amp;gt;" /&amp;gt;&lt;/font&gt;
&lt;br/&gt;
&lt;br/&gt;
Hope that helps someone!


&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/FZFZ8YENIt8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/5389461743519577983/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=5389461743519577983" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/5389461743519577983?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/5389461743519577983?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/FZFZ8YENIt8/setting-images-for-publishing-page-from.html" title="Setting the images for a publishing page from a module" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2011/10/setting-images-for-publishing-page-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08ARH46cCp7ImA9WhdQEkU.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-8329056260336027915</id><published>2011-08-13T19:26:00.000-07:00</published><updated>2011-08-13T19:44:05.018-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-13T19:44:05.018-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Office 365" /><title>Office 365 development</title><content type="html">&lt;p&gt;I am a bit excited about office 365. &lt;/p&gt;
&lt;p&gt;My company (&lt;a href="http://www.exd.com.au/" target="_blank"&gt;Extelligent Design&lt;/a&gt;) is now a 365 partner, and we aim to support clients implementing it. We want to help people set it up, understand how to use it (my book may come in handy, seeing as the end user interface to the sharepoint online is the same as regular sharepoint) and customise it.&lt;/p&gt;
&lt;p&gt;Customising is where the real challange begins. As you probably know, to develop for office 365, you can only use the sandbox - which limits what you can achieve in your customisations. I find that not being able to install application pages (pages that go to the _layouts folder) especially frustrating, and, like a fish out of the water for the first time in its life, I suddenly realise how much I tend to rely on having that resource.&lt;/p&gt;
&lt;p&gt;Ok, maybe the fish analogy is a bit much. I can still write web parts, and features with event receivers - not to mention list and library event receivers as well! But this is when I hit another wall - a lot of code I wrote in the past relied on me being able to run sections of the code with elevated privilages. This is gone if you develop a sandbox solution, and is very frustrating. Some obvious things that people will want to do in their hosted sharepoint site rely on code being able to run as other users. Workflows are a great example - having a user with permissions on list A enter data into that list, and then the workflow enters data into another list to which the user does not have permissions. Oh, wait, workflows are also not allowed in hosted sharepoint, so replace the word "workflow" with "event receiver" in the sentance above and you still get the same functionality, and you still hit a wall with not being able to write code that implements that requirement.&lt;/p&gt;
&lt;p&gt;PS - the security limitation is blocked for both usual methods of running in elevated privilages mode - you cannot use the security namespace (preveting you from using SPSecurity.RunWithElevatedPrivilages) and you cannot use the SPSite constructore - preventing you from loading a new SPSite object with the system user's token.&lt;/p&gt;
&lt;p&gt;So where does this leave us? Not all is doom and gloom - we can still write web parts and event handlers and features - as long as they are not too complex. This is great for deploying look and feel, features that implement site templates and more. I see a lot of developers now focusing on creating turn-key solutions that implement industry-specific templates for sites. Small businesses have a lot in common, and they are the real target of office 365 - so anyone who comes up with a feature that creates lists and libraries that solve a common problem for a small business may hit a jackpot similar to the mobile phone app developers.&lt;/p&gt;
&lt;p&gt;Finally, hosting companies that host office 365 may let you deploy code to the servers directly, allowing non-sandbox development to take place. I think this will be hardest to do, since those companies will be very afraid to change their environment from the microsoft default, but a strong partnership with such a company may be a great thing for a sharepoint developer. Come to think of it- if you ARE a hosting company that office 365 hosting and you want some value add to your clients - talk to me!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/avSfwT2iRh4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/8329056260336027915/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=8329056260336027915" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/8329056260336027915?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/8329056260336027915?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/avSfwT2iRh4/office-365-development.html" title="Office 365 development" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2011/08/office-365-development.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkABSHc-fCp7ImA9WhdQEkU.&quot;"><id>tag:blogger.com,1999:blog-20371103.post-2281890039634102114</id><published>2011-08-13T19:20:00.000-07:00</published><updated>2011-08-13T19:25:59.954-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-13T19:25:59.954-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Service Pack" /><category scheme="http://www.blogger.com/atom/ns#" term="Office 2010" /><title>Office 2010 SP1</title><content type="html">&lt;p&gt;Ok, this may not be a sharepoint post, but...&lt;/p&gt;
&lt;p&gt;If you are like me, you have "Virtual Clone Drive" installed, allowing you to mount ISO files as virtual CDs (other virutal CD software is available).&lt;/p&gt;
&lt;p&gt;If you are like me, you do not have a physical CD drive in your laptop (having pulled it out and put a second SSD in instead).&lt;/p&gt;
&lt;p&gt;If you are like me, you are running office 2010.&lt;/p&gt;
&lt;p&gt;If you are like me, you always install whatever Windows Update tells you to install.&lt;/p&gt;
&lt;p&gt;So...if you are like me, then you have been unable to install service pack 1 of Office 2010, failing (of all things) on installing a sharepoint client component.&lt;/p&gt;
&lt;p&gt;The solution turns out to be simple - disable the virtual CD drive and then do the update. Some recommendations from Microsoft also suggests to put a DVD or CD in your physical CD drive while patching. Seems to be a bug in SP1. &lt;/p&gt;
&lt;p&gt;Lucky for us sharepoint people that the SharePoint SP1 doesnt have all these annoying installation bugs. Oh, wait...

&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client="ca-pub-2727174828663024";
google_ad_width=468;
google_ad_height=60;
google_ad_format="468x60_as";
google_ad_type="text";
google_color_border="333333";
google_color_bg="940F04";
google_color_link="99C9FF";
google_color_url="99C9FF";
google_color_text="FFFFFF";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/sharepoint-tips/ToIC/~4/39yd6iB6sqg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.sharepoint-tips.com/feeds/2281890039634102114/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=20371103&amp;postID=2281890039634102114" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/2281890039634102114?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/20371103/posts/default/2281890039634102114?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/sharepoint-tips/ToIC/~3/39yd6iB6sqg/office-2010-sp1.html" title="Office 2010 SP1" /><author><name>Ishai Sagi [SharePoint MVP]</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_ZLr3wvXiUTE/SkrVwRChguI/AAAAAAAAD0I/8anOhQDTJkw/S220/Ishai+-+hand+on+chin+normal.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.sharepoint-tips.com/2011/08/office-2010-sp1.html</feedburner:origLink></entry></feed>
