S
sck10
Hello,
I am converting a class in the App_Code folder from c# to vb and am having
problems calling the sub procedure. I have created a Sub called HidePanels
in the class "General". When I try to declare a new object of this type in
my codebehind, I get the error: "Type 'HidePanels' is not defined". Any
help with this would be appreciated. Thanks, sck10
code behind
===========
Protected Sub HidePanelAppCode()
Dim HidePanelsHelper As New HidePanels
HidePanelsHelper (Me.Page)
End Sub
App_Code Class
======================
Imports Microsoft.VisualBasic
Public Class General
Public Shared Sub HidePanels(ByVal MyPage As Page)
For Each MasterCtrl As Control In MyPage.Controls
If TypeOf MasterCtrl Is MasterPage Then
For Each FormCtrl As Control In MasterCtrl.Controls
If TypeOf FormCtrl Is HtmlForm Then
For Each ContentCtrl As Control In FormCtrl.Controls
If TypeOf ContentCtrl Is ContentPlaceHolder Then
For Each ChildCtrl As Control In ContentCtrl.Controls
If TypeOf ChildCtrl Is Panel Then
CType(ChildCtrl, Panel).Visible = False
End If
Next
End If
Next
End If
Next
End If
Next
End Sub
End Class
I am converting a class in the App_Code folder from c# to vb and am having
problems calling the sub procedure. I have created a Sub called HidePanels
in the class "General". When I try to declare a new object of this type in
my codebehind, I get the error: "Type 'HidePanels' is not defined". Any
help with this would be appreciated. Thanks, sck10
code behind
===========
Protected Sub HidePanelAppCode()
Dim HidePanelsHelper As New HidePanels
HidePanelsHelper (Me.Page)
End Sub
App_Code Class
======================
Imports Microsoft.VisualBasic
Public Class General
Public Shared Sub HidePanels(ByVal MyPage As Page)
For Each MasterCtrl As Control In MyPage.Controls
If TypeOf MasterCtrl Is MasterPage Then
For Each FormCtrl As Control In MasterCtrl.Controls
If TypeOf FormCtrl Is HtmlForm Then
For Each ContentCtrl As Control In FormCtrl.Controls
If TypeOf ContentCtrl Is ContentPlaceHolder Then
For Each ChildCtrl As Control In ContentCtrl.Controls
If TypeOf ChildCtrl Is Panel Then
CType(ChildCtrl, Panel).Visible = False
End If
Next
End If
Next
End If
Next
End If
Next
End Sub
End Class