开发者

asp.net inline override

开发者 https://www.devze.com 2022-12-17 08:54 出处:网络
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?

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?

Ri开发者_StackOverflow中文版ght 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号