ascx... in a class.vb

Q

Quentin

I made a class in an other
file than the aspx one. This class is juste an HtmlTable, it looks like a
window, and i'd like to add a property to this class as to add an ascx in a
cell. My english is not so good so let me give you an example.

--------MesClasses.vb-----------------------

Public Class MaFenetre : inherits WebControl

Public Sub New()
Dim Fenetre As New HtmlTable
Dim MaLigne As New HtmlTableRow
Dim MaCellule As New HtmlTableCell
Dim MyObjectAscx As ?????

MaCellule.Controls.Add(MyObjectAscx)

MaLigne.Cells.Add(MaCellule)

Fenetre.Rows.Add(MaLigne)

Fenetre.Width = "100%"
Fenetre.height = "100%"

Me.Controls.Add(Fenetre)
End Sub

Public Property InnerPage As String
Get
Return InnerPage
End Get
Set(ByVal Value As String)
InnerPage = Value
MyObjectAscx.Path = InnerPage
End Set
End Property

End Class

Where InnerPage is the path of the *.ascx file. But the thing i don't know
is how to declare the future object that will be the ascx file in my
class... Like that i could just drag and drop my class wherever i want, and
just the InnerPage property to change the ascx file that is in my cell...

Thank you for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top