Can multiple aspx pages be linked to the same code behind file?

Discussion in 'ASP .Net' started by dan, Mar 22, 2008.

  1. dan

    dan Guest

    I have 5 aspx pages that I'd like to share the same code behind file. Those
    pages have the same set of 'core' controls and object data sources. Is this
    a good practice? It seems that VS2005 cannot handle it - gets into an
    endless loop of reading the aspx files.

    Any alternatives?
    Thanks,
     
    dan, Mar 22, 2008
    #1
    1. Advertising

  2. dan

    bruce barker Guest

    place the code file in the app_code folder as a class file. remove the
    codefile reference from the aspx pages, and have them inherit from the
    shared class.

    -- bruce (sqlwork.com)

    dan wrote:
    > I have 5 aspx pages that I'd like to share the same code behind file. Those
    > pages have the same set of 'core' controls and object data sources. Is this
    > a good practice? It seems that VS2005 cannot handle it - gets into an
    > endless loop of reading the aspx files.
    >
    > Any alternatives?
    > Thanks,
    >
    >
     
    bruce barker, Mar 22, 2008
    #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. =?Utf-8?B?Q3VydF9DIFtNVlBd?=

    RE: One code behind file and multiple ASPX pages?

    =?Utf-8?B?Q3VydF9DIFtNVlBd?=, Sep 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    439
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=
    Sep 7, 2005
  2. =?Utf-8?B?TWU=?=

    One code behind file and multiple ASPX pages?

    =?Utf-8?B?TWU=?=, Sep 7, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    945
    Craig Deelsnyder
    Sep 7, 2005
  3. Hiten
    Replies:
    2
    Views:
    1,606
    Hiten
    Aug 23, 2006
  4. WebBuilder451
    Replies:
    2
    Views:
    606
    clintonG
    Jun 27, 2008
  5. RadioSignal

    passing variables from .aspx.cs code pages to .aspx pages

    RadioSignal, Sep 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    7
    Views:
    2,252
    Mirronelli
    Oct 22, 2005
Loading...

Share This Page