471,122 Members | 890 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,122 software developers and data experts.

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

BH
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?
Nov 17 '05 #1
4 6876
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" <bo*******@yahoo.com> wrote in message
news:On*************@TK2MSFTNGP09.phx.gbl...
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?

Nov 17 '05 #2
BH
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" <ke***@takempis.com> wrote in message
news:uW*************@tk2msftngp13.phx.gbl...
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" <bo*******@yahoo.com> wrote in message
news:On*************@TK2MSFTNGP09.phx.gbl...
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?


Nov 17 '05 #3
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" <bo*******@yahoo.com> wrote in message
news:eQ**************@TK2MSFTNGP09.phx.gbl...
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" <ke***@takempis.com> wrote in message
news:uW*************@tk2msftngp13.phx.gbl...
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" <bo*******@yahoo.com> wrote in message
news:On*************@TK2MSFTNGP09.phx.gbl...
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?



Nov 17 '05 #4
BH
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" <ke***@takempis.com> wrote in message
news:O8*************@TK2MSFTNGP09.phx.gbl...
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" <bo*******@yahoo.com> wrote in message
news:eQ**************@TK2MSFTNGP09.phx.gbl...
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" <ke***@takempis.com> wrote in message
news:uW*************@tk2msftngp13.phx.gbl...
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" <bo*******@yahoo.com> wrote in message
news:On*************@TK2MSFTNGP09.phx.gbl...
> 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?
>
>



Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Steve Bugden | last post: by
10 posts views Thread by bienwell | last post: by
4 posts views Thread by rn5a | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.