Geeks With Blogs
Fringe SharePoint Continued

Visual Studio 2010 is the new and improved development tool for SharePoint 2010. Major improvements are that all the Project Templates for SharePoint 2010 are included out of the box. This means a better development experience with debugging, unit testing, TFS!!! and automated builds! As I was experimenting with the overall experience I noticed some funny things I thought I would blog about.

 

1) Visual Web Parts are the only option available as part of a template. This can be kind of confusing to some because there are two kinds of webparts you can develop in SP2010, a Visual Web Part and a Web Part (more like the ones in Sharepoint 2007)

 

The Visual Web Part is no mystery. The major power of it is the fact that you have a design surface where you can drag drop controls onto the surface. The design surface is nice but it has it's drade offs. If you are wondering how is this done in 2010, well, it's no different than what developers where doing in 2007, an 'ascx' control!! this control is what gives you the design surface. It is now included as part of the template of the visual webpart.

 

2) A huge feature in 2010 are the sandbox solutions. If you are not quite sure what that entails, I will write a quick post on the differences and why they are differnt. One of the changes that you will see as these templates are now part of Visual Studio 2010 out of the box is that you have a chance to create projects as Sandbox Solutions or Farm Solutions. With Visual Web Parts there is no option. It has to be a Farm Solution!

3) The question you might have now is, "how do I create 'normal' web parts?". The ones without a design surface and the one I can deploy as a sandbox solution. Well, it's not quite clear but if you look at the first image posted above, you will see an "Empty SharePoint Project". You will need to create one of those projects. Once you have, you will right click on the solution and add a new item, where you will have an option to add SharePoint artifacts (sharepoint items such as webpart, modules, features, etc...).

After adding a new item you will be able to pick from a "regular" web part.

 

4) One other quick point that I will mention here is that you can still create Connected web parts that take a 'Consumer' and a 'Provider' role. These webparts don't seem to want to work if you deploy them as sandbox solutions. They deploy just fine but when you add the webparts to the page they don't seem to want to work. Only untill both the "Consumer" and "Provider" web part are deployed as sandbox solutions, and only then do they seem to work. It's worth mentioning.

 

Conclusion

  As a developer you need to be aware of the subtle difference between the two when it comes to deployment. The "regular" web part mentioned in point 3, is the same as the webparts in MOSS 2007. No design surface. Be aware that if you want the "regular" web part deployed as a sandbox solution you will have to make sure that the "Empty SharePoint Project" you create first is set to deploy as a sandbox solution. The advancements in Connected webparts seem to be very little if any but I have not dug deep into that topic yet, so I just might not be aware of the differences in the underlying architecture. From a developers perspective, it still uses the same mechanism in wich you pass information through one webparth to another through an interface. Hope this gives someone a quick introduction to SharePoint 2010 Web Part Development.

 

 

 

Posted on Sunday, October 24, 2010 11:35 AM SharePoint , Development , Web Parts | Back to top


Comments on this post: Web Part Development in SharePoint 2010 - What you need to know!

# re: Web Part Development in SharePoint 2010 - What you need to know!
Requesting Gravatar...
Subject is invalid for this topic: only a few steps for creating a template of web part in visual studio 2010, no words about web parts on sharepoint's pages.
Left by Guest on Jan 24, 2011 7:32 AM

# re: Web Part Development in SharePoint 2010 - What you need to know!
Requesting Gravatar...
Yes I wrote this blog post as I was discovering some of these things. I have not included any web part on pages, Web part development with SharePoint Designer, Deployment issues, Feature Versioning, XSLT in Web Parts, Security, Ajax and Ajax connected Web Parts. Maybe the subject heading should be, 'Some things you need to know about SharePoint Development with Visual Studio 2010'. Good point though
Left by Juan on Apr 04, 2011 7:46 PM

# re: Web Part Development in SharePoint 2010 - What you need to know!
Requesting Gravatar...
Web Part Development in SharePoint 2010
Left by Aydi on Jan 23, 2012 8:50 AM

Your comment:
 (will show your gravatar)


Copyright © juanlarios | Powered by: GeeksWithBlogs.net