[ASCX] Add an ascx in a webcontrol...

  • Thread starter Thread starter Quentin
  • Start date Start date
Q

Quentin

hey there,

ok i made a class, that inherits webcontrol, and i add an htmltable to it. I
was wondering how to declare an ascx file as an object in my class, like
that i could change the content (the ascx file) of a cell thanks to a
property and it would be great :)

Merci d'avance pour l'aide :)
 
thank you for your response :)

But i'm not sure i explained my problem well... 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...

Thank you for your help.
 
Back
Top