in

Dot Net Mafia

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

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for SharePoint 2013, Office 365 / SharePoint Online and Visual Studio 2013.

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 an independent SharePoint consultant specializing in ECM, Apps, and Search.
2015 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems