Writing a MOSS WebPart

February 14th, 2007 by mdp

Here is a link that helped me in creating my first MOSS WebPart, since it is a little different than SharePoint 2003.  I hope this helps you as much as it helped me:

http://www.codeguru.com/csharp/.net/net_asp/webforms/article.php/c12293__1/

 

Published Wednesday, February 14, 2007 6:57 PM by mykiep

 

Writing Custom Event Handlers for MOSS

February 14th, 2007 by mdp

I had to create a custom event handler in MOSS to calculate the remaining budget for a user, here is the code:  

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;

namespace MP.EventHandlers
{
    public class EventHandler1 : SPItemEventReceiver
    {
        public override void ItemAdded(SPItemEventProperties properties)
        {
            base.ItemAdded(properties);
            SPListItem listItem = properties.ListItem;
            // Update List Item Properties Here            listItem.Update();
        }

        public override void ItemUpdated(SPItemEventProperties properties)
        {
            base.ItemUpdated(properties);
            SPListItem listItem = properties.ListItem;
            // Update List Item Properties Here
            listItem.Update();
        }
    }
}

I have been using Event Handler Explorer by Patrick Tisseghem to attach my custom event handlers to MOSS which is available here: http://blog.u2u.info/DottextWeb/patrick/archive/2006/07/31/27876.aspx