locked
how to inherit a abstract class in vb.net code behind !!! RRS feed

  • Question

  • User-1408383757 posted

    By Default code behind looks like -- Partial Public  Class InhAbs Inherits System.Web.UI.Page<u1:p></u1:p><o:p></o:p>

    How to inherit an abstract class 'Abs' in 'InhAbs' to implement the click event?<u1:p></u1:p><o:p></o:p>

    Public MustInherit Class Abs<u1:p></u1:p><o:p></o:p>

    Public MustOverride  Sub AddBtn_Click(ByVal sender As  Object, ByVal e As ImageClickEventArgs)<u1:p></u1:p><o:p></o:p>

    End class<u1:p></u1:p><o:p></o:p>

    -------------------<u1:p></u1:p><o:p></o:p>

    Partial Public Class InhAbs Inherits System.Web.UI.Page, Abs – I know multiple inheritances don’t work, is there a way to achieve this?<o:p></o:p>

    Public Overrides  Sub AddBtn_Click(ByVal sender As  Object, ByVal e As System.Web.UI.ImageClickEventArgs)<u1:p></u1:p><o:p></o:p>

    .....<u1:p></u1:p><o:p></o:p>

    End  Sub<u1:p></u1:p><o:p></o:p>

    End class

    Tuesday, August 25, 2009 6:31 PM

Answers

  • User-158764254 posted

    As long as the class Abs inherits System.Web.UI.Page, you can do this

        Public Class InhAbs Inherits Abs

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 25, 2009 7:31 PM

All replies

  • User-158764254 posted

    As long as the class Abs inherits System.Web.UI.Page, you can do this

        Public Class InhAbs Inherits Abs

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 25, 2009 7:31 PM
  • User-1408383757 posted

    Thanks  Mike.

    Trying to implement OOP methedologies...

    How to pass a dynamically generated variable to VirtualPath, so I can use identical pages as previous page(s) to one common target page, who will process the request of all identical pages !

    <%@ PreviousPageType VirtualPath=vPath %>

    Monday, August 31, 2009 11:50 AM