User Cannot Be Found?!

Upon import of a user's profile (from AD), the user is still not recognized as a 'bonafide' SharePoint account until they actually login (authenticate) to the SharePoint site. Consequently, if you're attempting to write code that iterates thru a group of users and programmatically sets their profile image - that code will fail for any user who has not logged into the SharePoint site (and will throw the infamous 'User Cannot Be Found' exception). I stumbled onto this issue when working with a new MOSS site, so most users had not yet logged in. I resolved the issue by calling SPWeb.EnsureUser(username) - (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.ensureuser.aspx) before attempting to access the user object. This method requires elevated permissions to run.
Happy Coding!

Posted on 12/16/2009 6:49:00 AM by sterlingt

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: MOSS 2007 | SharePoint 2007 | WSS 3.0

Tags:

SharePoint Rounded Corner Web Parts

Use JQuery and a content editor web part to quickly achieve rounded corner backgrounds for web parts within SharePoint 2007.

QuickStart Guide
  1. Generate images for web part corners - I used http://www.roundedcornr.com.
  2. Copy/paste the following JavaScript content into a text editor - RoundedWebPart
  3. Replace the following corner image URL's with paths to your newly generated corner images (ensure your users have 'read' privileges to the images' location)
    • /Shared%20Pictures/Top_Left_Corner.png
    • /Shared%20Pictures/Top_Right_Corner.png
    • /Shared%20Pictures/Bottom_Left_Corner.png
    • /Shared%20Pictures/Bottom_Right_Corner.png
  4. Replace the '#f3de96' color with the value of your images' color
  5. Add a Content Editor Web Part to the SharePoint page
  6. Modify the Web Part and paste your modified JavaScript text content into the Source Code Editor
Check the content editor's layout 'Hidden' property to prevent it from displaying with a rounded corner background.

Posted on 12/8/2009 5:02:00 PM by sterlingt

Permalink | Comments (7) | Post RSSRSS comment feed |

Categories: MOSS 2007 | SharePoint 2007 | WSS 3.0

Tags: