HomeDevelopment (Old)Tips for creating programmatically webpart, which class should you use (SP2010)

Tips for creating programmatically webpart, which class should you use (SP2010)

You want to create a webpart for SharePoint 2010 but you don’t know which class to use ?
I was using those way :

  • Search on google and find examples
  • Randomly type in Visual studio the webpart name, example : content, and it would propose me the classes ContentByQuery…

image
But there is a more simple way :

  • Create the webpart by interface in SharePoint 2010

image

  • Export the .webpart file from the webpartimage

This will export a .webpart

  • Now edit it with a text editor

image
You could see the full namespace used, and so the ClassName : ContentByQueryWebpart.

Hope that helped,

- Advertisement -

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

CONNECT FOR MORE CONTENT

DO NOT MISS THOSE ARTICLES

Recent Comments