Results 1 to 2 of 2

Thread: Dynamically Load a Class ASP.NET 2.0

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Question Dynamically Load a Class ASP.NET 2.0

    For this question, I have a project with a Class called Class1.

    All I want to do is create the Class1 using

    MyAssembly.GetType("Class1")

    but it does not find the Class1. In a Windows app you can call it doing this

    MyAssembly.GetType("WindowsApplication1.Class1").

    How can I do it in ASP.NET 2.0.

    Thanks,

    Code:
            Dim ep As String = Assembly.GetExecutingAssembly.ManifestModule.FullyQualifiedName ' Assembly.GetExecutingAssembly.Location
            Dim MyAssembly As Assembly = Assembly.LoadFrom(ep)
            '--Pass the name of the class you want to create.
            Dim mType As Type = MyAssembly.GetType("Class1")

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Dynamically Load a Class ASP.NET 2.0

    Have you tried

    MyAssembly.GetType("WebApplication1.Class1") ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width