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.