Hi,
in VB.NET there is the following code:
Friend htProvidedPrope rties As New Hashtable()
Private Class TextboxValidato rProvidedProper ties
Public DataType As DataTypeConstan ts
Public RegularExpressi on As String = String.Empty
End Class
'casting 1
Dim ProvidedPropert ies As
TextboxValidato rProvidedProper ties = DirectCast
(htProvidedProp erties(ctrl),
TextboxValidato rProvidedProper ties)
'Casting2
Return DirectCast(htPr ovidedPropertie s(ctrl),
TextboxValidato rProvidedProper ties).DataType
How can I do the casting (1 and 2) in C#?
I tried Convert.ChangeT ype(htProvidedP roperties(ctrl) ,
TextboxValidato rProvidedProper ties);
But it don't work (gives errors).
Thanks in advance
Vic
in VB.NET there is the following code:
Friend htProvidedPrope rties As New Hashtable()
Private Class TextboxValidato rProvidedProper ties
Public DataType As DataTypeConstan ts
Public RegularExpressi on As String = String.Empty
End Class
'casting 1
Dim ProvidedPropert ies As
TextboxValidato rProvidedProper ties = DirectCast
(htProvidedProp erties(ctrl),
TextboxValidato rProvidedProper ties)
'Casting2
Return DirectCast(htPr ovidedPropertie s(ctrl),
TextboxValidato rProvidedProper ties).DataType
How can I do the casting (1 and 2) in C#?
I tried Convert.ChangeT ype(htProvidedP roperties(ctrl) ,
TextboxValidato rProvidedProper ties);
But it don't work (gives errors).
Thanks in advance
Vic
Comment