how to add aspx and the class file separately in VS.NET?

Discussion in 'ASP .Net' started by BH, Jul 30, 2003.

  1. BH

    BH Guest

    I'm looking at the source code of the ASP.NET forum sample application. It
    has the "code-behind" classes compiled into a separate DLL, totally
    separated from the aspx/ascx files. Adding the class files alone in VS.NET
    is straightforward, but is there a way configure VS.NET to add aspx/ascx
    files alone?
     
    BH, Jul 30, 2003
    #1
    1. Advertising

  2. I don't understand the question. There are 2 components to an ASPX page: The
    Page Template (.aspx) and the CodeBehind (.vb or .cs). The CodeBehind is
    compiled into a DLL. The Page Template remains as text. You can't run the
    app without both. There is a way to use CodeBehind without compiling to a
    DLL. Is that what you're after?

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Complex things are made up of
    lots of simple things.

    "BH" <> wrote in message
    news:...
    > I'm looking at the source code of the ASP.NET forum sample application.

    It
    > has the "code-behind" classes compiled into a separate DLL, totally
    > separated from the aspx/ascx files. Adding the class files alone in

    VS.NET
    > is straightforward, but is there a way configure VS.NET to add aspx/ascx
    > files alone?
    >
    >
     
    Kevin Spencer, Jul 30, 2003
    #2
    1. Advertising

  3. BH

    BH Guest

    What I was referring to was to develop the "codebehind" classes in a class
    library project and compile into a DLL. Then this DLL is referenced in the
    web project, which has its own DLL. The web project would largely consists
    of the aspx/ascx files. The web project compiles into a small DLL (pretty
    much global.asax.cs). The classes in the first DLL are used in the aspx by
    registering like this:

    <%@ Register TagPrefix="AspNetForums" Namespace="AspNetForums.Controls"
    Assembly="AspNetForums" %>
    .........
    <AspNetForums:LoginProcessor id="abc123" runat="server" />
    .........

    What I want to know is if I go with this kind of code separation, how do I
    add an aspx or ascx without the VS.NET automatically sticks an
    aspx.cs/ascx.cs file for me, as I don't need the cs files in the web project
    itself, they are defined in the class library project.



    "Kevin Spencer" <> wrote in message
    news:...
    > I don't understand the question. There are 2 components to an ASPX page:

    The
    > Page Template (.aspx) and the CodeBehind (.vb or .cs). The CodeBehind is
    > compiled into a DLL. The Page Template remains as text. You can't run the
    > app without both. There is a way to use CodeBehind without compiling to a
    > DLL. Is that what you're after?
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > http://www.takempis.com
    > Complex things are made up of
    > lots of simple things.
    >
    > "BH" <> wrote in message
    > news:...
    > > I'm looking at the source code of the ASP.NET forum sample application.

    > It
    > > has the "code-behind" classes compiled into a separate DLL, totally
    > > separated from the aspx/ascx files. Adding the class files alone in

    > VS.NET
    > > is straightforward, but is there a way configure VS.NET to add aspx/ascx
    > > files alone?
    > >
    > >

    >
    >
     
    BH, Jul 30, 2003
    #3
  4. I'm still having trouble understanding you. A Class Library is just a
    collection of classes. It is different than CodeBehind. A CodeBehind class
    is the class that completes an ASP.Net Page class, which is made up of a
    Template and a CodeBehind class. If your project has a class library, it
    would have TWO DLLs with it, one for the Class Library, and one for the
    CodeBehind classes of the Pages. If you add a new .aspx page to your
    project, you will also need the CodeBehind class, assuming that you want
    that page to DO something.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Complex things are made up of
    lots of simple things.

    "BH" <> wrote in message
    news:eQLAs$...
    > What I was referring to was to develop the "codebehind" classes in a class
    > library project and compile into a DLL. Then this DLL is referenced in

    the
    > web project, which has its own DLL. The web project would largely

    consists
    > of the aspx/ascx files. The web project compiles into a small DLL (pretty
    > much global.asax.cs). The classes in the first DLL are used in the aspx

    by
    > registering like this:
    >
    > <%@ Register TagPrefix="AspNetForums" Namespace="AspNetForums.Controls"
    > Assembly="AspNetForums" %>
    > ........
    > <AspNetForums:LoginProcessor id="abc123" runat="server" />
    > ........
    >
    > What I want to know is if I go with this kind of code separation, how do I
    > add an aspx or ascx without the VS.NET automatically sticks an
    > aspx.cs/ascx.cs file for me, as I don't need the cs files in the web

    project
    > itself, they are defined in the class library project.
    >
    >
    >
    > "Kevin Spencer" <> wrote in message
    > news:...
    > > I don't understand the question. There are 2 components to an ASPX page:

    > The
    > > Page Template (.aspx) and the CodeBehind (.vb or .cs). The CodeBehind is
    > > compiled into a DLL. The Page Template remains as text. You can't run

    the
    > > app without both. There is a way to use CodeBehind without compiling to

    a
    > > DLL. Is that what you're after?
    > >
    > > --
    > > HTH,
    > >
    > > Kevin Spencer
    > > Microsoft MVP
    > > .Net Developer
    > > http://www.takempis.com
    > > Complex things are made up of
    > > lots of simple things.
    > >
    > > "BH" <> wrote in message
    > > news:...
    > > > I'm looking at the source code of the ASP.NET forum sample

    application.
    > > It
    > > > has the "code-behind" classes compiled into a separate DLL, totally
    > > > separated from the aspx/ascx files. Adding the class files alone in

    > > VS.NET
    > > > is straightforward, but is there a way configure VS.NET to add

    aspx/ascx
    > > > files alone?
    > > >
    > > >

    > >
    > >

    >
    >
     
    Kevin Spencer, Jul 30, 2003
    #4
  5. BH

    BH Guest

    I figured this out. To add aspx file alone, the VS.NET templates have to be
    changed so it shows up as a separate item in the Add New Item list. Web
    Forms and User Controls defined as is can only be added with the code behind
    file being added at the same time.

    Kevin, you can download the ASPNET Forums sample app from asp.net and you'll
    see what I mean. Thanks.

    "Kevin Spencer" <> wrote in message
    news:...
    > I'm still having trouble understanding you. A Class Library is just a
    > collection of classes. It is different than CodeBehind. A CodeBehind class
    > is the class that completes an ASP.Net Page class, which is made up of a
    > Template and a CodeBehind class. If your project has a class library, it
    > would have TWO DLLs with it, one for the Class Library, and one for the
    > CodeBehind classes of the Pages. If you add a new .aspx page to your
    > project, you will also need the CodeBehind class, assuming that you want
    > that page to DO something.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > http://www.takempis.com
    > Complex things are made up of
    > lots of simple things.
    >
    > "BH" <> wrote in message
    > news:eQLAs$...
    > > What I was referring to was to develop the "codebehind" classes in a

    class
    > > library project and compile into a DLL. Then this DLL is referenced in

    > the
    > > web project, which has its own DLL. The web project would largely

    > consists
    > > of the aspx/ascx files. The web project compiles into a small DLL

    (pretty
    > > much global.asax.cs). The classes in the first DLL are used in the aspx

    > by
    > > registering like this:
    > >
    > > <%@ Register TagPrefix="AspNetForums" Namespace="AspNetForums.Controls"
    > > Assembly="AspNetForums" %>
    > > ........
    > > <AspNetForums:LoginProcessor id="abc123" runat="server" />
    > > ........
    > >
    > > What I want to know is if I go with this kind of code separation, how do

    I
    > > add an aspx or ascx without the VS.NET automatically sticks an
    > > aspx.cs/ascx.cs file for me, as I don't need the cs files in the web

    > project
    > > itself, they are defined in the class library project.
    > >
    > >
    > >
    > > "Kevin Spencer" <> wrote in message
    > > news:...
    > > > I don't understand the question. There are 2 components to an ASPX

    page:
    > > The
    > > > Page Template (.aspx) and the CodeBehind (.vb or .cs). The CodeBehind

    is
    > > > compiled into a DLL. The Page Template remains as text. You can't run

    > the
    > > > app without both. There is a way to use CodeBehind without compiling

    to
    > a
    > > > DLL. Is that what you're after?
    > > >
    > > > --
    > > > HTH,
    > > >
    > > > Kevin Spencer
    > > > Microsoft MVP
    > > > .Net Developer
    > > > http://www.takempis.com
    > > > Complex things are made up of
    > > > lots of simple things.
    > > >
    > > > "BH" <> wrote in message
    > > > news:...
    > > > > I'm looking at the source code of the ASP.NET forum sample

    > application.
    > > > It
    > > > > has the "code-behind" classes compiled into a separate DLL, totally
    > > > > separated from the aspx/ascx files. Adding the class files alone in
    > > > VS.NET
    > > > > is straightforward, but is there a way configure VS.NET to add

    > aspx/ascx
    > > > > files alone?
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    BH, Jul 30, 2003
    #5
    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. ladygrinningsoul

    Reading stdout and stderr separately

    ladygrinningsoul, Nov 18, 2004, in forum: Perl
    Replies:
    3
    Views:
    1,045
    Alexey A. Kiritchun
    Apr 25, 2005
  2. Ken Spreitzer
    Replies:
    2
    Views:
    535
    Ken Spreitzer
    Feb 12, 2006
  3. Replies:
    1
    Views:
    424
  4. Jia Lu
    Replies:
    11
    Views:
    499
    Steve Holden
    Jul 30, 2007
  5. Davy
    Replies:
    2
    Views:
    214
Loading...

Share This Page