I am having major trouble with the following and Im not sure of the syntax line to use.
I have a vb file with 2 classes defined in it. One is for the page and other is for creating a toolbar.
I simply want to pass control back to the first class when the user selects something on the toolbar, then I want to load a user control into a container...
THE EXAMPLE BELOW SHOULD MAKE THIS CLEARER.
Public Class Whatever
has page load event, etc.
Public Sub HandleThis(x As Integer)
below command works
Context.Response.Write("hello")
THE COMMAND BELOW WILL NOT WORK, GET OBJECT REFERENCE NOT SET ERROR!!!! WHAT IS THE CORRECT SYNTAX FOR THE LINE BELOW??
Page.FindControl("PageOutput").Controls.Add(LoadControl("../Apps/TSS/TicketEntry.ascx"))
End Sub
End Class
Public class Toolbar
has constructor and other stuff
The code below send control back to the class above.
Public Overridable Sub ActionHandler(ByVal sender As Object, e As EventArgs) Handles Sweet_Toolbar.SelectedIndexChange
Dim x As New IntraSweetAdmin
x.HandleThis(Sweet_Toolbar.SelectedIndex)
End Sub
End Class
Any help would be extremely appreciated.
I have a vb file with 2 classes defined in it. One is for the page and other is for creating a toolbar.
I simply want to pass control back to the first class when the user selects something on the toolbar, then I want to load a user control into a container...
THE EXAMPLE BELOW SHOULD MAKE THIS CLEARER.
Public Class Whatever
has page load event, etc.
Public Sub HandleThis(x As Integer)
below command works
Context.Response.Write("hello")
THE COMMAND BELOW WILL NOT WORK, GET OBJECT REFERENCE NOT SET ERROR!!!! WHAT IS THE CORRECT SYNTAX FOR THE LINE BELOW??
Page.FindControl("PageOutput").Controls.Add(LoadControl("../Apps/TSS/TicketEntry.ascx"))
End Sub
End Class
Public class Toolbar
has constructor and other stuff
The code below send control back to the class above.
Public Overridable Sub ActionHandler(ByVal sender As Object, e As EventArgs) Handles Sweet_Toolbar.SelectedIndexChange
Dim x As New IntraSweetAdmin
x.HandleThis(Sweet_Toolbar.SelectedIndex)
End Sub
End Class
Any help would be extremely appreciated.