Answer 1)
One of the limitations of user control is that they cannot be shared across web applications but they can be created using a designer tool. On the other hand if you take custom controls, they can be shared across web applications, but there is no visual designer for creating custom controls through which we cannot drag and drop custom controls. By now, we understand that there is a need to have a solution that would combine the features of both the user controls and custom controls. The solution which will solve this issue is Web Parts.
Web Parts are prefabricated components that are basically targeted at easing the job of portal site / collaboration sites development. They are basically server-side controls that run inside the context of special pages (known as Web Part pages) within an ASP.NET application or a WSS (Windows SharePoint Services) site. Web parts combine the flexibility of user controls and custom controls. Developers can drag completed Web Parts from Web Part galleries and drop them into Web Part zones. It can also be said that web parts add more value over other types of ASP.NET controls in that they add extra dimensions of user customization and personalization.
A bare ASP.NET ascx control would have to be added to a custom layout page. This limits the utility of the control a little as it cannot be added "just anywhere".
Having a webpart gives the flexibility of the control being added to the site multiple times in different locations or even multiple times on the same page with different properties.
When it comes to editors using the site, it makes a lot of difference for them to be able to add a webpart compared to editing a page layout, publishing it and then creating pages based on that page layout, so from the perspective of a site editor, the difference in usability is really quite large.
|