3
Ich bekomme einen Kompilierfehler Typ "Ctltype" ist nicht mit diesem Code definiert.Übergabe von Typ an eine Funktion in VB.NET
Dies ist .NET 1.1 Legacy-Code, so nicht gut, ich weiß.
Wer weiß warum?
Public Function GetControlText(ByVal ctls As Control, ByVal ctlname As String, ByVal ctltype As Type) As String
Dim ctl As Control
Dim res As String
ctl = ctls.FindControl(ctlname)
If ctl Is Nothing Then
Return ""
End If
res = CType(ctl, ctltype).Text
If res Is Nothing Then
Return ""
Else
Return res
End If
End Function
vergessen, dass Sie 1.1 verwendet haben. Habe die Antwort gelöscht. – Kirtan