A solution with multiple web projects and ASPX page reusability

Discussion in 'ASP .Net' started by Max2006, Oct 1, 2007.

  1. Max2006

    Max2006 Guest

    Hi,



    Is there any way to break a web application into separated web projects, so
    we can re-use pages\?



    I am trying to put aspx pages and/or ascx pages in separated web projects,
    but when we run the solution, the start-up web project contain all necessary
    aspx/ascx pages + dlls to run.



    Any help would be appreciated,

    Max
     
    Max2006, Oct 1, 2007
    #1
    1. Advertising

  2. Max2006

    Tim Mackey Guest

    hi max
    the easiest step is to place the code behind files in a class library
    project and compile them. then you can refer to the full namespace of the
    code behind class in the Inherits attribute in your ASPX page declaration.
    this way you at least get to re-use the codebehind, although you would still
    have to deploy the ASPX file itself. there is also a way of compiling ascx
    pages into a binary, http://msdn2.microsoft.com/en-us/library/aa479318.aspx

    hope this helps
    tim



    "Max2006" <> wrote in message
    news:...
    > Hi,
    >
    >
    >
    > Is there any way to break a web application into separated web projects,
    > so we can re-use pages\?
    >
    >
    >
    > I am trying to put aspx pages and/or ascx pages in separated web projects,
    > but when we run the solution, the start-up web project contain all
    > necessary aspx/ascx pages + dlls to run.
    >
    >
    >
    > Any help would be appreciated,
    >
    > Max
    >
    >
    >
     
    Tim Mackey, Oct 1, 2007
    #2
    1. Advertising

  3. Thanks for Tim's input!

    Hi Max,

    Yes, as Tim suggested, for web application, you can easily reuse the codes
    via define common classes or base classes and separate them into a class
    library.

    However, for aspx page or other page stuffs, it is not quite convenient and
    practical to separate them into separate projects because diffrent project
    may result to different Application context(such as appdomain, cache,
    sessionstate boundary...) and it will be much difficult for you develop the
    pages' code and coordinate them.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------
    >From: "Tim Mackey" <>
    >References: <>
    >In-Reply-To: <>
    >Subject: Re: A solution with multiple web projects and ASPX page

    reusability
    >Date: Mon, 1 Oct 2007 16:06:26 +0100


    >
    >hi max
    >the easiest step is to place the code behind files in a class library
    >project and compile them. then you can refer to the full namespace of the
    >code behind class in the Inherits attribute in your ASPX page declaration.
    >this way you at least get to re-use the codebehind, although you would

    still
    >have to deploy the ASPX file itself. there is also a way of compiling

    ascx
    >pages into a binary, http://msdn2.microsoft.com/en-us/library/aa479318.aspx
    >
    >hope this helps
    >tim
    >
    >
    >
    >"Max2006" <> wrote in message
    >news:...
    >> Hi,
    >>
    >>
    >>
    >> Is there any way to break a web application into separated web projects,
    >> so we can re-use pages\?
    >>
    >>
    >>
    >> I am trying to put aspx pages and/or ascx pages in separated web

    projects,
    >> but when we run the solution, the start-up web project contain all
    >> necessary aspx/ascx pages + dlls to run.
    >>
    >>
    >>
    >> Any help would be appreciated,
    >>
    >> Max
    >>
    >>
    >>

    >
    >
     
    Steven Cheng[MSFT], Oct 2, 2007
    #3
    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. Stephen Miller
    Replies:
    0
    Views:
    1,658
    Stephen Miller
    Jun 24, 2003
  2. =?Utf-8?B?cG9wc292eUBydXNtZXguY29t?=

    Code Reusability -- Extending web Application

    =?Utf-8?B?cG9wc292eUBydXNtZXguY29t?=, Jan 31, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    437
    Kevin Spencer
    Feb 2, 2004
  3. mister catering

    c code reusability

    mister catering, Aug 29, 2006, in forum: C Programming
    Replies:
    47
    Views:
    1,038
    Dave Thompson
    Sep 10, 2006
  4. Jerry Mcnealy
    Replies:
    0
    Views:
    334
    Jerry Mcnealy
    Aug 14, 2007
  5. Jerry Mcnealy
    Replies:
    0
    Views:
    415
    Jerry Mcnealy
    Aug 14, 2007
Loading...

Share This Page