To get started you need to install:
1. The live controls.
To download these controls, go to the Windows Live Tools Web site,
http://dev.live.com/tool
Instructions on installing the controls as well as a list of any prerequisites for the
controls are listed on this site.
2.You also require SharePoint extensions in Visual Studio.
1. Create a new webpart:
1. File > New > Project
2. Select SharePoint > Web Part
3. Name: MSNChatWebPart
4. Location: Your development folder e.g. D:\DEV\
5. SolutionName: MSNChatWebPart
6. Make sure your screen looks like the following :
Then hit OK.
You should now have a new Web Part project.
2. Add a Reference
- Find the Microsoft.Live.ServerControls.dll
- copy this DLL into the D:\Dev\MSNChatWebPart\ MSNChatWebPart\bin folder and also into the GAK folder of the SharePoint project.
- Add a reference to the above DLL in your project. Use the DLL in your bin folder.
- In your WebPart1.cs file add the following using statement above the namespace
3. Adding the Control
1. You will need to programmatically add the control to the Web Part.
2. This control can be configured to your liking. For now we are going to only some basic configuration. A full list of options is available a http:/msdn.microsoft.com/en-us/library/cc305083.aspx
I will talk more about this in a future post
3. Just note that the PrivacyStatementURL is required in order for this control to work. For now
you can create a default page named PrivacyPolicy.aspx You need to add the following code
to your project
- protected override void CreateChildControls()
- {
- base.CreateChildControls();
- //create new instance of the MSNChatControl
- MessengerChat myessengerChat = new MessengerChat();
- //add privacy statement URL path here
- myMessengerChat.ProvacyStatementURL = "http://~.PrivacyPolicy.aspx";
- //give your control an ID
- myMessengerChat.ID = "myMessengerChat";
- //add this control to the controls collention of the webpart this.Controls.Add(myessengerChat);
- }
4. Build your solution
5. Make sure in your Project Properties under Debug the Start browser with URL is set to your SharePoint site path
6. Deploy the solution
4. Add the web part to your site
1. Go to the design view of your page.
2. Click Add a Web Part on any zone. In this example we will add in to the middle zone
3. Expand All WebParts > and select your WebPart1 Web Part>>Add
So there we have it a nice simple MSNChat webpart for your mySite.