We can develop a custom control in Visual studio and deploy it as a webpart to use in SP.

but I head of some other ways, so can you please list possible ways to achieve this? and what's the pros and cons of each?


Well, ultimately you can do anything you could do in ASP.NET - so there are a huge number of options.

Likely candidates include:

  • List View Web Part (Shows data from a table. Pro: easy. Con: limited in control of display)
  • Data View Web Part (Shows data from a variety of sources. Pro: easy, more control. Con: harder to deploy, in my experience.)
  • The SPGridView control (Build into page, web part, user control or web control) (Pro: Gives a nice "SharePointy" looking grid, very like the normal GridView control. Con: You actually have to code it)

I'm guessing that actually what you're asking is should you go for a web part or web control, or user control. Well, that's already been asked, but my thoughts are:

User Controls are good, and Visual Web Parts in 2010 are just wrappers around User Controls.

In WCM sites, or sites where user's shouldn't be able to 'control' how the page looks themselves, User Controls or Web Controls are the way to go. User's can't change them; they are restricting.

In sites where users do need to be able to control how the page looks - like collaboration sites - then I'd suggest going for web parts.

Does that help?

  • thanks for the detailed answer, I heard of something else too, maybe called Dataform for a list in sharepoint (using xslt). how about that? – Bassel Alkhateeb Dec 9 '10 at 11:08
  • Dataform is just another name for the Data View web part. So yeah, that'd be fine. – Andy Burns Dec 10 '10 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.