MOSS Question:
Download Questions PDF

Which one is Better a UserControl or a WebPart?

MOSS Interview Question
MOSS Interview Question

Answer:

Comparison of UserControl and WebPart

Advantages of UserControl:

Developers are already familiar with user controls which reduce the learning curve.
UserControls can be used with other ASP.NET applications. Hence reusable.
Developing user controls using Visual studio is much faster than building it through code as in the case of WebParts.

Disadvantages of UserControl:

There is a performance overhead as usercontrol use a shim as a wrapper to work with Sharepoint.
Deployment is a bit messy.

Advantages of WebPart:

Everything is available and customizable, i.e. toolbar, behavior, content etc.
Better performance as there is no shim wrapper.
Provide a structured deployment mechanism.

Disadvantages of WebPart:

Developers are unfamiliar so learning curve is steeper.
They are strictly for Sharepoint and won’t work with other ASP.NET applications. Thus not reusable.

Download MOSS Interview Questions And Answers PDF

Previous QuestionNext Question
Explain the WebPartManager sealed class? What is its purpose?What is the role of AllowUnsafeUpdates?