1

Having a SharePoint 2013 installation, I wanted to try creating a web part for SP 2013. I opened visual studio 2012, I could see, project templates for SharePoint 2010 visual web part and SharePoint 2013 visual web part. I was confused as to which one to choose.

What is the core difference between the "SharePoint 2010 Visual web part" template and the 2010 and the "SharePoint 2013 Visual web part" one? Will web part created using

SharePoint 2010 - visual web part

work in SP 2013?

3

AFAIK, the "SharePoint 2010 - visual web part" solution template will create a web part targeted at SharePoint 2010, while the other will create a web part to be deployed to a SP 2013 farm. If anything else, the referenced assemblies would be different so I strongly advise against mixing the two (that is - assuming that VS actually allows you to do that).

Also notice that the inner working of the two web part models have been changed. SharePoint 2010 utilize a web control deployed to the 14 folder and then load it from there at runtime. On the other hand, SharePoint 2013 visual webpart utilizes an approach similar to the razor generator module from MVC to embed the control inside the solution Dll (the SharePointWebPartCodeGenerator custom tool) - this means that it is now easier to use a visual web part inside a sandboxed solution.

That said, if you have a visual web part created for use with SP 2010, you can migrate it to SP 2013. The procedure is automated by visual studio and generally shouldn't raise problem. That said there is always the possibility that you incur in a breaking change somewhere in the SharePoint object model.

  • 1
    My pleasure. Btw - I have also performed a minor revision on your question... nothing great, but I believe the question core now stands out more. Fell free to rollback or to further improve as needed. – SPArchaeologist Oct 11 '13 at 11:47
  • My pleasure too. – Biju Joseph - MCSD Oct 11 '13 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.