By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,354 Members | 907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,354 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.