Categories: Jason, SharePoint, Technical Posted by jasond727 on 8/23/2011 2:41 PM | Comments (0)

If you need to get the last time that content was modified in a SharePoint site there is a SPSite and SPWeb property to get that information.

SPSite thisSite = new SPSite();
DateTime.FromFileTime(thisSite.LastContentModifiedDate.ToFileTimeUtc());

This can be helpful in writing a web part or code for displaying site in a web application not modified in a specified time.

Happy Coding!

Tags: , , | Categories: SharePoint, Technical Posted by jasond727 on 8/18/2011 3:36 PM | Comments (0)

If you are using sorting and paging in a SPGridView needing to persist the ViewState can be necessary on postback.  I created a custom SPMenuField where cliient side scripts would change an SPListItem.  The menu column needed to update based on the changes to stay accurate.  If a custom sort had been performed once posted back the default sort would apply.  On the onclientscriptclick method after your first javascript method include:

"javascript:__doPostBack('" + SPGridView.ClientID + "', '');";

Utilizing this method performs a postback and tells the system the SPGridView that sent the postback and keeping the ViewState intact and updating the custom menus with required changes.

Tags: , | Categories: SharePoint, Technical Posted by jasond727 on 9/9/2010 12:11 PM | Comments (0)

Well,  I am starting to think about how I am going to transfer my site collection to SharePoint 2010 from 2007.  I am hoping that it will be fairly smooth and all of the custom programming will port over easily.

I am working on doing some custom master pages hoping that the redesign in 2007 will still look nice in 2010.  I will soon be posting some good methods on how to make masterpages in 2010 and some functionality features.