Results 1 to 2 of 2

Thread: inherits

  1. #1

    Thread Starter
    Fanatic Member d2005's Avatar
    Join Date
    Aug 2005
    Location
    ireland
    Posts
    620

    inherits

    i have a file in my project base.vb

    in this file i have public function validate.

    the question i need to ask is that how can i make my webpages inherit this information.

    ie, base.validate() brings up an error
    base is not declared....
    is this making any sense

  2. #2
    Addicted Member
    Join Date
    Aug 2004
    Location
    Cape Town, South Africa
    Posts
    149

    Re: inherits

    the line after where you define your class..., ie.

    VB Code:
    1. Public Class MyForm

    ...you should write...

    VB Code:
    1. Inherits base

    So it looks like this

    VB Code:
    1. Public Class MyForm
    2.    Inherits Base

    And seeing as though you are inheriting it into a form, your Base class must inherit System.Web.UI.Page

    Then all you would write to call the function is: validate() OR me.validate()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width