I am trying to aid another programmer with a page called Default.aspx with a code-behind section, and unfortunately I am at a bit of a loss.
Partial Class _Default
Inherits OverheadClass
'A bunch of global variables here'
Private Sub page_load(ByVal sender As Object, ByVal e As System.Eventarts) Handles Me.Load
'Function goes here'
And in the OverheadClass we have
Public Sub Sub_OverheadClass_Load(ByVal sender As Object, ByVal e as System.EventArgs) Handles MyClass.Load
The desired effect is when the OverheadClass is inherited, we want its load to run before the load event on the page runs. There is probably a very simple answer to this that I am missing.
Edit: I forgot to note that we write in VB, and not C# as many of you are used to for ASP.
You should be able to override the OnLoad and call the base class's OnLoad first, then your class, for example:
C# Version
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
// Do some stuff here
}
VB Version
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)
' Do some stuff here
End Sub
In VB it would be:
Private Sub page_load(ByVal sender As Object, ByVal e As System.Eventarts) Handles Me.Load
Mybase.Sub_OverheadClass_Load(e)
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With