in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint 2010, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Corey Roth - DotNetMafia.com - Tip of the Day

Bringing you the latest time saving tips for SharePoint 2010, MOSS 2007, ASP.NET, LINQ, and Visual Studio 2010

Introducing the Visual Web Part in SharePoint 2010

You might have seen that there is a new designer for working with web parts in Visual Studio 2010.  This is actually, not quite the case, so I thought I would share with you how it actually works.  When you use the Visual Web Part SPI (SharePoint Project Item), it will create a number of files for you: a .cs file, a .webpart file, an elements.xml file, and a .ascx file.  That’s right, it creates an ASP.NET user control.  Now, the Visual Studio interface does a nice job of grouping all of the files together.  When you open the designer on the web part, you in fact just open the designer for the user control. 

So now you might be thinking, how does this work?  Well no SharePoint can’t host user controls directly still. In fact all it does is create a simple web part with a Page.LoadControl() method pointing at our user control.  This in fact is the same method we’ve been using for years to get user controls into SharePoint.  I don’t really see this as an issue though, since Visual Studio does a great job making it painless to deploy these now and use them inside SharePoint.

Comments

 

Two Techniques for Deploying Sharepoint Content said:

Pingback from  Two Techniques for Deploying Sharepoint Content

March 23, 2010 12:12 PM
 

Two Techniques for Deploying SharePoint Content said:

Pingback from  Two Techniques for Deploying SharePoint Content

March 23, 2010 8:00 PM
 

Two Techniques for Deploying Sharepoint Content said:

Pingback from  Two Techniques for Deploying Sharepoint Content

March 23, 2010 8:03 PM
 

Two Techniques for Deploying SharePoint Content said:

Pingback from  Two Techniques for Deploying SharePoint Content

March 23, 2010 8:16 PM
 

Two Techniques for Deploying SharePoint Content said:

Pingback from  Two Techniques for Deploying SharePoint Content

March 23, 2010 8:20 PM

Leave a Comment

(required)  
(optional)
(required)  
Add

About CoreyRoth

Corey Roth is a SharePoint Consultant for Stonebridge, Inc. specializing in clients in the Energy Sector.
2009 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems