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.
As has been mentioned it is good to use CreateChildControls()
to create the controls in the webpart and it is not that much of a big deal to code and package a webpart into a solution, making it worth the extra effort.
Webparts are also able to accept connections from "filter" webparts on the same page, giving additional flexibility to webparts compared to hosting ascx controls on the site.
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.
I recommend going even further and coding your webpart to use an xslt file to display the contents and making the location of that xslt a configurable property of the webpart. This really adds to the flexibility of your control.
Look at the Dataview webpart to see how much can be done with the addition of custom rendering.
LoadChildControls()
, you meanCreateChildControls()
, correct? – Subject