Here are the code and slides from my march presentation at Philly Office Geeks title "MS AJAX and jQuery with SharePoint"

Tony Testa posted on April 20, 2009 15:09

Yet another post thats better late than never.  Back in Feb I was lucky enough to present at the Microsoft Silverlight Firestarter event and we have a GREAT turnout, over 100+ people attended and I of course presented on integrating Silverlight with SharePoint.

On the MSDN forums I answered a blog posting about how to update some values of a user profile.  I’ve answered this question more than a few times so I threw up this posting about it.

Here is some basic code to achieve this (its actually from MSDN but I’ve written the same code enough times just couldn’t find it offhand)

using (SPSite site = new SPSite("http://servername"))
    ServerContext context = ServerContext.GetContext(site);
    UserProfileManager profileManager = new UserProfileManager(context);
    string sAccount = "domainname\\username";
    UserProfile u = profileManager.GetUserProfile(sAccount);
    u[PropertyConstants.PictureURL].Value = "SOME URL";



Be sure to check out MSDN for the members of the PropertyConstants.

Tony Testa posted on March 15, 2009 03:48

A few days late but I finally got to posting my code/slides for the March Office Geeks we had on March 10th.  I've zipped up the code that I went over during the presentation which will show you some of the ways you can incorporate MS AJAX and jQuery into your SharePoint sites.

SharePoint has issues with using keywords "today" and "my". Due to this issue, a few workarounds have to be done to achieve the "Today" functionality. See steps below to create a "rolling" calendar view that shows calendar entries for X number of months out.

FYI, MS has on their site a list of some advanced filter options that I would recommend if your looking to do filtering, check it out, it helped me a lot


  1. Go to your Calendar list and create a column named "Today" and select "single line of text" and do not add it to the default view. This column is merely a placeholder column to achieve "Today" functionality that we can use to filter views
  2. Create a new column named "RollingDateFilter", make it a "calculated column"
    1. Set the calculated formula to "=AND(MONTH([Start Time])>=MONTH(Today),MONTH([Start Time])<=MONTH(Today)+2)"
      1. This formula will be used to filter our list
      2. If you want to see more months out, change 2 in the formula above to the # of months you want to see.
    2. Be sure to set the data type returned to "Yes/No"
    3. Be sure to uncheck "add to default view"
    4. IF you need to change the formula later, you will first have to recreate the "Today" column in step 1, modify the formula, save the formula, then delete the "Today" column.
  3. Delete the "Today" column
    1. This is needed for the "Today" value to be properly parsed in the above formula
    2. IF the "Today" column is not deleted, the formula using "Today" WILL NOT PROCESS CORRECTLY
  4. Create a new View and base it off the "All Events" view
    1. Select the columns you want to show, just accept the defaults
    2. Scroll down to the Filter section
    3. Set the filter to "RollingDateFilter" and set "is equal to" and set "Yes"
    4. Save the view
    5. You should now have a view that only shows 2 months out.
  5. Go to the homepage that has your un-filtered calendar view


    1. Edit the webpart
    2. Switch the view to "2MonthRolling" and save the changes

The results below

Posted in: Sharepoint  Tags: , ,
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017 Tony Testa's World