Page Base Classes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom J.

    #1

    Page Base Classes

    ..NET seems to support inheritance of the Page class, but it doesn't seem to
    render the information from the base class properly, at least not by
    default.

    If I create a base class, say, PageBase that derives from the 'normal' Page
    class - then derive a new page type, say LoginPage, that derives from
    PageBase I would have expected the controls, background, etc. that I placed
    on the PageBase class level to appear in the LoginPage page - but they
    don't.

    Can anyone tell me what is going on here? ...Is there an easy work-around
    (available now), or should I abandon the idea of a visual inheritance in the
    current version of .NET?

    Thanks!


  • Marina

    #2
    Re: Page Base Classes

    The visual components can't be inherited. The code can.

    The .aspx itself, technically inherits from the class defined in the .vb
    file. You will notice, that private variables in your .vb file will not be
    accessible in server side scripts in the .aspx. But the protected ones will
    be - because protected variables can be inherited.

    "Tom J." <etjorg@hotmail .com> wrote in message
    news:%23PDIGuXR DHA.1072@TK2MSF TNGP10.phx.gbl. ..[color=blue]
    > .NET seems to support inheritance of the Page class, but it doesn't seem[/color]
    to[color=blue]
    > render the information from the base class properly, at least not by
    > default.
    >
    > If I create a base class, say, PageBase that derives from the 'normal'[/color]
    Page[color=blue]
    > class - then derive a new page type, say LoginPage, that derives from
    > PageBase I would have expected the controls, background, etc. that I[/color]
    placed[color=blue]
    > on the PageBase class level to appear in the LoginPage page - but they
    > don't.
    >
    > Can anyone tell me what is going on here? ...Is there an easy work-around
    > (available now), or should I abandon the idea of a visual inheritance in[/color]
    the[color=blue]
    > current version of .NET?
    >
    > Thanks!
    >
    >[/color]


    Comment

    • George Ter-Saakov

      #3
      Re: Page Base Classes

      How do you think it's going to look like.
      When page renders it self it renders evrything from <HTML> to </HTML>
      So do you want to see 2 <HTML> tags in your output?

      I do not think so.

      George.

      "Tom J." <etjorg@hotmail .com> wrote in message
      news:%23PDIGuXR DHA.1072@TK2MSF TNGP10.phx.gbl. ..[color=blue]
      > .NET seems to support inheritance of the Page class, but it doesn't seem[/color]
      to[color=blue]
      > render the information from the base class properly, at least not by
      > default.
      >
      > If I create a base class, say, PageBase that derives from the 'normal'[/color]
      Page[color=blue]
      > class - then derive a new page type, say LoginPage, that derives from
      > PageBase I would have expected the controls, background, etc. that I[/color]
      placed[color=blue]
      > on the PageBase class level to appear in the LoginPage page - but they
      > don't.
      >
      > Can anyone tell me what is going on here? ...Is there an easy work-around
      > (available now), or should I abandon the idea of a visual inheritance in[/color]
      the[color=blue]
      > current version of .NET?
      >
      > Thanks!
      >
      >[/color]


      Comment

      Working...