T
Tomk
I would like to make a routine that I can reuse on all my web forms to loop
thru all webcontrols. However to do this I will need to pass a reference of
the class that is associated with the form but I can't figure out the type
to use in the method paramenter.
something like this:
Public Class myWebForm
Inherits System.Web.UI.Page
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
InitializeComponent()
Dim objCommonRoutine as new myCommonRoutine()
Call objCommonRoutine .DoStuff("Select * From Table", Me)
End Sub
End Class
Public Class myCommonRoutine
Public Sub New()
End Sub
Public Sub DoStuff(ByVal strStuff as String, ByRef objWebForm as ????)
For Each WebControl in objWebForm
bla bla
Next
End Sub
End Class
thru all webcontrols. However to do this I will need to pass a reference of
the class that is associated with the form but I can't figure out the type
to use in the method paramenter.
something like this:
Public Class myWebForm
Inherits System.Web.UI.Page
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
InitializeComponent()
Dim objCommonRoutine as new myCommonRoutine()
Call objCommonRoutine .DoStuff("Select * From Table", Me)
End Sub
End Class
Public Class myCommonRoutine
Public Sub New()
End Sub
Public Sub DoStuff(ByVal strStuff as String, ByRef objWebForm as ????)
For Each WebControl in objWebForm
bla bla
Next
End Sub
End Class