Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have created a custom webpart.
I want to get that webpart and add it to my custom application page using code. How can I get it?
You can get all the Web Parts on a specific site by accessing the Web Part Gallery List.
Web Part Gallery
SPWeb web = SPContext.Current.Web;
SPList list = web.Lists["Web Part Gallery"];
foreach(SPListItem item in list.Items)
// do something
Required, but never shown