.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

C# typeof

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :ASP.Net

Hi guys,

Have this code that works fine:

        ObjectHandle reportManagerObject = Activator.CreateInstance(typeof(LABReportManager).Assembly.FullName.ToString(), "eAppForm.Reporting.LABReportManager");
        IReportManager reportManager = (IReportManager)reportManagerObject.Unwrap();        
        reportManager.GetReportFileName(null, "yes", "");

        ObjectHandle reportManagerObject = Activator.CreateInstance(typeof(MyReportManager).Assembly.FullName.ToString(), "Reporting.MyReportManager");

        IReportManager reportManager = (IReportManager)reportManagerObject.Unwrap();        

        reportManager.GetReportFileName(null, "yes", "");

This creates an instance of the MyReport

View Complete Post

More Related Resource Links

using typeof for a reference type


namespace AssemblyA
    public class Product
        private int cinProductID;
        public int ProductID
            get { return cinProductID; }
            set { cinProductID = value; }

        private Array csCategoryName;
        public Array CategoryName
            get { return csCategoryName; }
            set { csCategoryName = value; }

namespace AssemblyA
    public class Categories
        private string csName;
        public string Name

TypeOf/getType ?


Hi there,

I have added a few WebUserControl's to a form and I want to check their properties values in a code behind (vb) when a user click a button.

I tried unsuccessfully to get a reference to these controls using the TypeOf and GetType functions...

How do I get a reference to the webUserControls ?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend