Asp.Net 2.0 Web Application Project Inherited Base class?

Discussion in 'ASP .Net' started by gabe, Mar 21, 2007.

  1. gabe

    gabe Guest

    Hi,

    Is it possible using Web Application Projects with Asp.Net 2.0 Sp1 to
    have a partial class code behind inherit from a base class that could
    be used for all the pages on a web site?

    The site uses a Master page, but there are some tasks I'd prefer to be
    done elsewhere. For example there a couple of common controls in the
    Master Page that may be used differently by some of the pages. And I'd
    like to have common code that can call a service layer for things like
    logging user actions to a db without have to repeat it in every page.

    Thanks in advance,

    Gabe
    gabe, Mar 21, 2007
    #1
    1. Advertising

  2. gabe

    Mark Rae Guest

    "gabe" <> wrote in message
    news:...

    > Is it possible using Web Application Projects with Asp.Net 2.0 Sp1 to
    > have a partial class code behind inherit from a base class that could
    > be used for all the pages on a web site?


    Yes absolutely! I do this all the time.

    Just create your base class and then change the partial class declaration to
    ineherit from it instead of System.Web.UI.Page
    Mark Rae, Mar 21, 2007
    #2
    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. Softari
    Replies:
    1
    Views:
    422
    John Harrison
    Jul 14, 2004
  2. Softari
    Replies:
    1
    Views:
    372
    red floyd
    Jul 14, 2004
  3. Alicia
    Replies:
    3
    Views:
    924
    jjr2004a
    Nov 24, 2004
  4. Josh Mcfarlane
    Replies:
    2
    Views:
    335
    Josh Mcfarlane
    Aug 18, 2005
  5. 7stud --
    Replies:
    11
    Views:
    386
    7stud --
    Nov 9, 2007
Loading...

Share This Page