Results 1 to 4 of 4

Thread: [RESOLVED] [2005] .NET equivalent of COM's CreateObject

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Resolved [RESOLVED] [2005] .NET equivalent of COM's CreateObject

    How do you create an object instance if all you have is the name of the class?
    I want to add controls (derived from webcontrols) onto a webpage at runtime. Information is stored in a database, so all I know is the class name of the control, ie

    Code:
        Public Class wssList
            Inherits System.Web.UI.WebControls.BulletedList
            Public Sub New()
                Me.Items.Add("Test 1")
                Me.Items.Add("Test 2")
            End Sub
        End Class
    
        Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim ctl As System.Web.UI.Control
            Dim str as String = "wssList"
            ctl = New ?????????
            Me.Forms.Controls.Add(ctl)
        End Sub
    Last edited by brucevde; Sep 12th, 2007 at 03:51 PM.

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