1

If I'm writing in-line code on a .aspx page is it possible to override the onLoad of the class that the .aspx is directly inheriting from?

Right now if I do the override the base.onLoad inline on the .aspx page it is overriding the "Page" object's onLoad event not the class the .aspx is inheriting from.

Thanks for your help.

Brandon
  • 381
  • 1
  • 4
  • 6

1 Answers1

1

Did you try creating a class inline in your aspx page?

<script runat="server">
    public class MyPage : MyBaseClass
    {
        protected override OnLoad....
    }
</script>

and then have your aspx header inherit from MyPage

hunter
  • 62,308
  • 19
  • 113
  • 113
  • consider [this](http://stackoverflow.com/questions/6612420/calling-the-original-page-load-fuction-from-inline-code#) answer for better understanding. – Mostafa Rezaei Apr 04 '13 at 07:11