Month: March 2010

SharePoint 2010–Application Page for Anonymous Access

Recently I was working on a smart 404 page with a redirect handler so that custom urls could be handled through a SharePoint list with RegEx.  For example http://domain.com/vanity1 would see the “.com/vanity1”, and look it up on the SharePoint list to redirect the client to the appropriate URL. The site itself was set to anonymous, however some of the solution files were placed in the /_layouts/RedirectHandler directory and I kept getting a “401 Unauthorized” message when accessing the vanity urls (despite having the _layouts/RedirectHandler in the web.config like this: <location path="_layouts/RedirectHandler"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> Turns out that even though the site is anonymous, the key here is that you cannot use the default LayoutsPageBase class for the page because it would trigger SharePoint to prompt anonymous users to log on.  For example, the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS\login.aspx page that ships with Microsoft SharePoint Foundation 2010 inherits from an internal class named LoginPage, which itself inherits from UnsecuredLayoutsPageBase. Instead, you need to use another class for your anonymous application page called UnsecuredLayoutsPageBase. You can find its MSDN reference at: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.unsecuredlayoutspagebase.aspx Your page class would look like this, and now everything works quite nicely without prompting anonymous users to login. public partial class Handler : UnsecuredLayoutsPageBase { protected override void OnPreRender(EventArgs e) { }...

Read More

SharePoint 2010 Folder Design Best Practices

This is probably one of the biggest banes of a SharePoint Admin’s existence – Folder structure.  It’s important to really lay out a structure that makes sense and is flexible enough for the future.  There are several design considerations when using SharePoint 2010 folders when designing the information architecture. Importantly and obviously, plan for the number of items that will be organized in each folder. Those items can be moved either manually or it can be automated. Incorporate features to include the metadata navigation so that the amounts of items in folders don’t have such strict limits. Use metadata navigation and folder navigation so that the folders are able to be used for policies and retention. This is in addition to the folders being used for organization. Organization of content in folders so that they can be easily navigated as well as combined with other available options for the simplification of navigation. The content organizer will automatically move the documents into folders base on the metadata. They can also be enabled with the option for creating various sub folders after the limit in a given folder has been reached. Organize items into folder so that only the list view threshold at the root of the folder is there when you use the Open with Explorer. In order to retrieve content in list views there is metadata navigation and indexing...

Read More

SharePoint – How To Hide Recycle Bin & View All Site Content links in SharePoint 2010 and 2007

Sometimes more functionality is confusing to the end user.  While I think these are good features to have, just like with the article from last month : http://iedaddy.com/2010/02/how-to-hide-left-display-panel-in-sharepoint-2010/ the owner wants the site to “look less sharepointy”.  And so here’s how to remove the Recycle bin from your pages as well: The easiest way is to use the old school CEWP trick that worked even back in 2003, just add a the Web Part that now has the name Content Editor and add the following text in the HTML Source mode: In a 2007 site: <style type="text/css"> .ms-quicklaunchheader{display: none;} .ms-recyclebin{display: none;} </style> In a SharePoint 2010 Site: <style type="text/css"> /* To Hide both */ .s4-specialNavLinkList{display:none;} /* To Hide "Recycle bin" */ .s4-rcycl{display:none;} /* To Hide "All Site Content" */ #ctl00_PlaceHolderLeftNavBar_PlaceHolderQuickLaunchBottom_PlaceHolderQuickLaunchBottomV4_idNavLinkViewAllV4{display:none;}...

Read More