Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Reflection and UserControls

Posted on 2011-03-08
1
Medium Priority
?
259 Views
Last Modified: 2012-05-11
I can use reflection to load an assembly and get all the types but what i cannot do is find any class in the assembly that is a usercontrol.


Can anyone help?
0
Comment
Question by:cossy74
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 35069256
Have you tried something like:
            Assembly asm = Assembly.LoadFile(@"C:\someAssembly.dll");

            Type[] types = asm.GetTypes();
            foreach (Type t in types)
            {
                if (t.BaseType.Equals(typeof(System.Web.UI.UserControl)))
                {
                    Console.WriteLine(t.Name + " is a user control");
                }
            }

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question