Which is Better a UserControl or WebPart?

Which is Better a UserControl or WebPart?

Comparison of UserControl and WebPart

Advantages of UserControl:

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

Disadvantages of UserControl:

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

Advantages of WebPart:

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

Disadvantages of WebPart:

1. Developers are unfamiliar so learning curve is steeper.
2. They are strictly for Sharepoint and won’t work with other ASP.NET applications. Thus not reusable.
Security methods(Authentication methods)
Classic-mode authentication methods, Claims-based authentication methods......
What is the WebPartManager sealed class?
The WebPartManager sealed class manages everything in context of a WebPart page, i.e. WebParts controls......
Role of AllowUnsafeUpdates
AllowUnsafeUpdates allows updates on a GET request. It basically allows code to bypass security validation.....
Post your comment