Pages

Showing posts with label SharePoint WebParts. Show all posts
Showing posts with label SharePoint WebParts. Show all posts

28 Sept 2012

Design a Classical WebPart


1. Add a reference "System.web"
    Then you will get the following namespaces
    System.Web.UI;
    System.Web.UI.WebControls;
    System.Web.UI.WebControls.WebParts;

2. We should inherit the class from "WebPart" base class

3. WebPart base class contains the methods like CreateChildControls( ) and  
    Render(HTMLTextWriter writer).

    CreateChildControls( ) is a method is useful  to create controls with in a  
    WebPart  and Render( ) method is used for rendering the content on the
    webpage.

4. we can override these two methods







27 Sept 2012

WebPart Notes - Part 1


1.WebParts are highly customizable and reusable components(contains predefined functionality).

2.Webparts can be developed, deployed and that can be used any no of times in sharepoint site.

3.Generally WebParts are used to display the data from various sources like lists, libraries, forms, search results, and other pages.

4.Extension of WebPart is 
  .dwp (in older versions)
  .webpart (in Moss 2007 and SharePoint 2010)

5.WebParts can be placed within WebPart  zones only.

6.WebPart zone is a container control, we can place different types of controls    like
   1. HTML controls
   2. Webserver controls
   3. Webuser controls
   4. Custom controls
   5. Ajax controls
   6. WebParts controls

7.We can place any no of WebParts n a WebParts one and A single page may contain any no of WebPart zones.

8.There are 3 levels in WebParts.
   1. Creating webpart
   2. Deploying webpart
   3. Use the webpart

9.While creating WebParts, we should inherit the class from "WebPart" base 
   class.
   example: class class1 : WebPart
                {

                   // logic here

                 }

10.What is the difference between Normal page and WebPart page?
Normal page does not contain webpart zone, where as webpart page has WebPart zones.