Friday, August 24, 2007

SharePoint Custom Web Parts

What is Web Part?

ASP.NET Web Parts controls are an integrated set of controls for creating Web sites that enable end users to modify the content, appearance, and behavior of Web pages directly in a browser. The topics in this section provide information on what Web Parts are, how they work, and how to use them to create user-customizable ASP.NET Web pages.

How to create custom VS 2005 web parts, Using Windows SharePoint Services 3.0 Tools: Visual Studio 2005 Extensions:

This is a new addons to VS 2005 IDE that will enable developers create web parts, by downloading this setup from here.

After installation, open VS 2005 IDE, click on New Project at File Menu, then go Share Point node at the left menu, then here you go, you got new project types, for example Web Parts, see below:



After that, select web part, then the projects open, and you can place any Html contents you wanted on following line sub that will appear:

protected override void Render(HtmlTextWriter writer)
{
// TODO: add custom rendering code here.
writer.write("Hello World web part.");
}

Then by Just clicking on "F5" & Run the VS will compile & deploy it at SharePoint, and by adding new web parts from the Share Point, you will notice that your web part will be available on the web parts galley !

Cheers,

No comments: