1
votes

We used SmartPart web part in MOSS 2007 for loading user controls (developed in VB.net) on to the SharePoint pages.

After we migrate to SP 2010, we want to develop using visual web part and C# instead of smartpart and Vb.net

Couple of questions: 1) In SP 2010, I guess we can develop web parts in both C# and VB.net (not in the same web part) and deploy it to a SharePoint web application (which is an asp.net web app after all)? Correct me if I am wrong.

2) How can I migrate User controls developed in VB.net to a SP 2010 environment where visual web parts are developed using C#? We do not want to do code conversion.

3) Any other challenges that we need to be aware of?

References: Mixing C# & VB In The Same Project

Appreciate your thoughts.

1

1 Answers

3
votes

To answer your questions:

  1. Yes, SharePoint allows using different languages to write code, as long as it is a supported CLR language (C#, VB.NET, F#, etc.)

  2. A Visual WebPart is simply a user control (.ascx file) wrapped in a web part (similar to the smartpart). Unless your user controls are using anything specific to SP 2007 that has changed in 2010, you should be able to just create a new visual webpart in VS 2010, and replace the generated .ascx file (and .ascx.cs) file with your existing user control.

  3. Nothing major springs to mind.

I think your biggest challenge will be re-writing the code from VB to C#.