Simple Class Question

S

Shapper

Hello,

I have a class which I am calling as follows:
...
column.ItemTemplate = CreateItemTemplate()
...
Function CreateItemTemplate() As ITemplate
Return New ItemTemplate
End Function
...

Class ItemTemplate
Implements ITemplate
ReadOnly Property ITemplate_dptpt() As HtmlControl
Get
Dim _dptpt As HtmlControl
_dptpt = New HtmlGenericControl
_dptpt.Attributes.Add("class", "dptpt")
Return _dptpt
End Get
End Property

ReadOnly Property ITemplate_dengb() As HtmlControl
Get
' Div: dengb
Dim _dengb As HtmlControl
_dengb = New HtmlGenericControl
_dengb.Attributes.Add("class", "dengb")
Return _dengb
End Get
End Property

Public Sub InstantiateIn(ByVal container As Control) Implements
ITemplate.InstantiateIn

container.Controls.Add(ITemplate_dptpt)
container.Controls.Add(ITemplate_dengb)

End Sub 'InstantiateIn

End Class

What I need is to add ITemplate_dptpt OR ITemplate_dengb according to
the value in Session("culture").

I think the best way is to use only one class, i.e., ItemTemplate and
try some how to have some king of condition inside the class.

How can I do this?

Thanks,
Miguel
 

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,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top