Поделиться через


Custom WebPart Catalog

Trying to catch back up on my blogging, I have a list of topics to post on, just haven't had time to get to them.  I wrote this article over a month ago...figured I would link it up from here.

The default web part catalogs that are shipped with ASP.Net require you to configure the list of web parts you want to display in your catalog.  We've had a few requests for a more dynamic approach and the article has a sample that can get you started on this.

https://support.microsoft.com/kb/910446

The article links up to a sample Solution and lays out the files and what they do.  The main piece is a custom web part catalog that uses reflection to populate the list of web parts.  The idea is that you drop a .dll into the /bin folder of your app and the catalog will automatically pick out the web part controls in the dll.  It caches the list of parts to avoid the cost of looking up the dll's on future requests.  This works great since adding a dll to the /bin will recycle the app domain and clear the cache, so all you need to do to add web parts to the catalog is to add the dll to the /bin.

The other piece is a custom WebPart that pulls data from an RSS feed and shows the different types of properties you can implement in the web part.