Results 1 to 3 of 3

Thread: Inheriting another pages onLoad event

  1. #1

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375

    Inheriting another pages onLoad event

    Hi, I have a page that does a whole lot of stuff in its onLoad event.

    What I was wondering if it is possible to inherit this page (And therefore it functionality) in a new page and utilise the existing onLoad event of the inherited page by overriding the onLoad event of the new page.

    Or, is it best that I just package all the existing functionality in a new class and use it that way even though webforms are actually classes....

    I tried to specify two classes to inherit but I get an error message saying that I can only inherit a single class and its functionality.

    Code:
    ' I thought that I could do this and get the code behind page to inherit both the webform that it is associated with and another webform
    
    Public Class contact
    Inherits System.Web.UI.Page
    Inherits ProjectName.PageName


    Ideas welcome, regards
    MarkusJ

  2. #2
    Hyperactive Member SoftwareMaker's Avatar
    Join Date
    Mar 2001
    Location
    Elbonia with Dilbert and Wally
    Posts
    322
    Hi,

    You can only inherit a single class but you can do multiple interface implementation with the Implements keyword BUT i doubt thats what you want as the interface doesnt contain any implementation

    If you have a class that has to be inherited, separate that as a base class to be inherited by your web forms. It is more structured that way.

    hth
    William T
    Software Architect / Chief Software Developer
    Softwaremaker.Net Pte Ltd
    http://www.Softwaremaker.net

    *** Things are always the darkest before they go pitch black ***

  3. #3

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375
    Yeah, that's what I thought I might have to do, worth a try though

    Regards
    MarkusJ

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