SharePoint Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 3042 Page Views: 

Which base class we have to inherit to develop a custom web part for SharePoint 2007?



Posted By: moss2007 Date: 10 May 2010 12:10:26 PM
 Answer:

There are two base classes that a custom WebPart can inherit from, either the SharePoint WebPart Base class or the ASP.Net 2.0 WebPart base class. When inheriting from the SharePoint WebPart Base class your custom WebPart class will inherit from Microsoft.SharePoint.WebPartPages.WebPart. When inheriting from the ASP.Net 2.0 WebPart base class your custom WebPart class will inherit from System.Web.UI.WebControls.WebParts.WebPart.

It is recommended to use the ASP.Net WebPart base class since the SharePoint WebPart base class is older one and is meant for backwards compatibility with previous version of SharePoint.

But there is an exception as the SharePoint WebPart base class provides following additional capabilities over ASP.Net WebPart base class: 1) Cross page connections
2) Connections between Web Parts that are outside of a Web Part zone
3) Client-side connections (Web Part Page Services Component)
4) Data caching infrastructure


Posted By: Kuldeep Singh


Date: 10 May 2010 12:10:26 PM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image 7Ktkj0
Related Questions
SharePoint : Write the STSADM command to add the solution file (.wsp, .cab, .wpp) to the solution store in SharePoint 2007?

Write the STSADM command to add the solution file (.wsp, .cab, .wpp) to the solution store in ShareP....

Following STSADM command can be used to add the solution file (.wsp, .cab, .wpp) to the solution sto....
Category: SharePoint Date: 11/18/2009 7:03:06 AM
SharePoint : What are the correct values for Scope for a Feature in SharePoint 2007?

What are the correct values for Scope for a Feature in SharePoint 2007?

Scope of a Feature in SharePoint 2007 can have one of thr following: 1) Farm 2) WebApplication 3) S....
Category: SharePoint Date: 11/18/2009 6:44:35 AM
SharePoint : Write code in C# to fetch all the data from SharePoint Custom List?

Write code in C# to fetch all the data from SharePoint Custom List?

SPSite objSite = new SPSite("http://servername:1234"); SPWeb objWeb = objSite.OpenWeb(); S....
Category: SharePoint Date: 11/18/2009 6:35:44 AM
SharePoint : Explain the concept of "Feature" in SharePoint?

Explain the concept of "Feature" in SharePoint?

SharePoint "Feature" is a container of various defined extensions for SharePoint. It's a ....
Category: SharePoint Date: 10/26/2009 6:41:04 AM
SharePoint : How can we create SharePoint Site Definition?

How can we create SharePoint Site Definition?

There are two options to create SharePoint Site Definition: 1) Create New Site Definition manually....
Category: SharePoint Date: 10/26/2009 6:04:40 AM