MustInherit base class inherited by UserControl

Discussion in 'ASP .Net Building Controls' started by Craig Edmunds via .NET 247, Jul 3, 2004.

  1. Following on from this discussion

    http://www.dotnet247.com/247reference/msgs/29/146830.aspx

    i'm having the same problem, the classes that i think should work but are throwing up the "type abstract" error are:

    ########################################
    base class:
    ########################################

    Public MustInherit Class ControlBase
    Inherits System.Web.UI.UserControl

    End Class


    ########################################
    derived class (all code shown):
    ########################################

    Public Class Control
    Inherits ControlBase

    #Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
    'CODEGEN: This method call is required by the Web Form Designer
    'Do not modify it using the code editor.
    InitializeComponent()
    End Sub

    #End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'Put user code to initialize the page here
    End Sub

    End Class

    ########################################

    If the MustInherit keyword is removed from the base class everything works fine, but this is not the behaviour i want.



    Any help will be much appreciated.



    --------------------------------
    From: Craig Edmunds

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>MDwgr/CDzkSs/UVrq7SXyg==</Id>
    Craig Edmunds via .NET 247, Jul 3, 2004
    #1
    1. Advertising

  2. "Craig Edmunds via .NET 247" <> wrote in message
    news:ew75$...
    > Following on from this discussion
    >
    > http://www.dotnet247.com/247reference/msgs/29/146830.aspx
    >
    > i'm having the same problem, the classes that i think should work but are

    throwing up the "type abstract" error are:
    >
    > ########################################
    > base class:
    > ########################################
    >
    > Public MustInherit Class ControlBase
    > Inherits System.Web.UI.UserControl
    >
    > End Class
    >


    The designer won't work with an abstract base class. I believe that's fixed
    in VS.NET 2005.
    --
    John Saunders
    johnwsaundersiii at hotmail
    John Saunders, Jul 4, 2004
    #2
    1. Advertising

  3. Craig, John

    Yes, this is already fixed in the VS.NET 2005 beta 1.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx

    "John Saunders" <> wrote in message
    news:...
    > "Craig Edmunds via .NET 247" <> wrote in message
    > news:ew75$...
    > > Following on from this discussion
    > >
    > > http://www.dotnet247.com/247reference/msgs/29/146830.aspx
    > >
    > > i'm having the same problem, the classes that i think should work but

    are
    > throwing up the "type abstract" error are:
    > >
    > > ########################################
    > > base class:
    > > ########################################
    > >
    > > Public MustInherit Class ControlBase
    > > Inherits System.Web.UI.UserControl
    > >
    > > End Class
    > >

    >
    > The designer won't work with an abstract base class. I believe that's

    fixed
    > in VS.NET 2005.
    > --
    > John Saunders
    > johnwsaundersiii at hotmail
    >
    >
    Victor Garcia Aprea [MVP], Jul 4, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arthur Dent

    ASP.NET 2 and MustInherit classes?

    Arthur Dent, Dec 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    400
    Arthur Dent
    Dec 22, 2004
  2. Arthur Dent

    Framework 2.x vs. MustInherit?

    Arthur Dent, May 6, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    433
    Arthur Dent
    May 6, 2005
  3. Alicia
    Replies:
    3
    Views:
    923
    jjr2004a
    Nov 24, 2004
  4. Replies:
    0
    Views:
    462
  5. 7stud --
    Replies:
    11
    Views:
    385
    7stud --
    Nov 9, 2007
Loading...

Share This Page