473,811 Members | 3,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tying the pieces (files) together

Hi all,

I'm working with the .NET framework and Web Matrix and am having trouble
finding how to tie together the files when deriving classes. What I've got
is a TestBase.cs file that defines a class derived from page. I also have a
codebehind file that I'm referencing from an ASP.NET page. For example,
something like:

Test.aspx...
<%@ Page Language="C#" Src="Test.aspx. cs"
Inherits="Test. Welcome.Welcome Page" %>

/* Test.aspx.cs */
namespace Test.Welcome
{
using Test.HelperStuf f
public class WelcomePage : LabeledPage
{
protected void Page_Load(objec t Src, EventArgs e)
{ /* Some code */ }
}
}

/* TestBase.cs */
namespace Test.HelperStuf f
{
using System.WebForms
using System.WebForms .UI
class LabeledPage : Page
{
protected void DoSomething()
{ /* Some Other Code */ }
}
}

If I'm just building a C# app, I'd compile an exe referencing not only my
main file but any other .cs files it uses. How do I do the analogous thing
in ASP.NET?

To paraphrase a friend: "Please note: I am not as irretrievably stupid as
this post makes me appear.", but am starting to feel that way!

TIA,

John
Nov 17 '05 #1
2 1463
I don't know enought about Web Matrix.

Is Web Matrix solution driven? I mean could you add the TestBase.cs to the
solution.

Or do you have to compile it command-line style?

bill

"John Spiegel" <js******@c-comld.com> wrote in message
news:O0******** ******@TK2MSFTN GP10.phx.gbl...
Hi all,

I'm working with the .NET framework and Web Matrix and am having trouble
finding how to tie together the files when deriving classes. What I've got is a TestBase.cs file that defines a class derived from page. I also have a codebehind file that I'm referencing from an ASP.NET page. For example,
something like:

Test.aspx...
<%@ Page Language="C#" Src="Test.aspx. cs"
Inherits="Test. Welcome.Welcome Page" %>

/* Test.aspx.cs */
namespace Test.Welcome
{
using Test.HelperStuf f
public class WelcomePage : LabeledPage
{
protected void Page_Load(objec t Src, EventArgs e)
{ /* Some code */ }
}
}

/* TestBase.cs */
namespace Test.HelperStuf f
{
using System.WebForms
using System.WebForms .UI
class LabeledPage : Page
{
protected void DoSomething()
{ /* Some Other Code */ }
}
}

If I'm just building a C# app, I'd compile an exe referencing not only my
main file but any other .cs files it uses. How do I do the analogous thing in ASP.NET?

To paraphrase a friend: "Please note: I am not as irretrievably stupid as
this post makes me appear.", but am starting to feel that way!

TIA,

John

Nov 17 '05 #2
Hey Bill,

Thanks for reading! It's basically a free environment that, at least as far
as I've seen, doesn't do that much in the way of project building. To be
fair, I haven't explored it heavily.

I guess my more generic question goes outside of Web Matrix and more to how
..NET manages its applications (which I understand to essentially be the
folder the files are in, at least in the case of ASP.NET). I would think
that I could somehow reference the "base" .cs file (that defines the class I
want to use) from the file .cs file I want to use as the src in the aspx
page. For example, I can reference Test1.aspx.cs from the @Page directive
and ASP.NET will then be able to compile and use Test1.aspx.cs. If
Test1.aspx.cs needs a class in Test2.cs, how would it reference that?

Thanks,

John

"William F. Robertson, Jr." <wf*********@kp mg.com> wrote in message
news:#7******** *****@TK2MSFTNG P12.phx.gbl...
I don't know enought about Web Matrix.

Is Web Matrix solution driven? I mean could you add the TestBase.cs to the solution.

Or do you have to compile it command-line style?

bill

"John Spiegel" <js******@c-comld.com> wrote in message
news:O0******** ******@TK2MSFTN GP10.phx.gbl...
Hi all,

I'm working with the .NET framework and Web Matrix and am having trouble
finding how to tie together the files when deriving classes. What I've got
is a TestBase.cs file that defines a class derived from page. I also have a
codebehind file that I'm referencing from an ASP.NET page. For example,
something like:

Test.aspx...
<%@ Page Language="C#" Src="Test.aspx. cs"
Inherits="Test. Welcome.Welcome Page" %>

/* Test.aspx.cs */
namespace Test.Welcome
{
using Test.HelperStuf f
public class WelcomePage : LabeledPage
{
protected void Page_Load(objec t Src, EventArgs e)
{ /* Some code */ }
}
}

/* TestBase.cs */
namespace Test.HelperStuf f
{
using System.WebForms
using System.WebForms .UI
class LabeledPage : Page
{
protected void DoSomething()
{ /* Some Other Code */ }
}
}

If I'm just building a C# app, I'd compile an exe referencing not only

my main file but any other .cs files it uses. How do I do the analogous

thing
in ASP.NET?

To paraphrase a friend: "Please note: I am not as irretrievably stupid as this post makes me appear.", but am starting to feel that way!

TIA,

John


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
3190
by: JKop | last post by:
Here's what I know so far: You have a C++ project. You have source files in it. When you go to compile it, first thing the preprocessor sticks the header files into each source file. So now you have your ".cpp" files all ready, without any "#include" or "#define" in them. Let's assume that there's 2 source files in this project, "a.cpp" and
16
12551
by: matthurne | last post by:
I just started learning C++ on my own...I'm using Accelerated C++. Something it hasn't explained and I keep wondering about is how header files actually work. I suspect it doesn't get into it because it is, as the authors love to say, "implementation specific". If that's the case, how does the compiler commonly handle them? I use Linux and gcc specifically. Basically, I don't understand how a header file being included makes a...
1
1626
by: Christopher M. Lusardi | last post by:
Hello, I have a program that can be compiled and run on SGI and Linux computers, and only one of the files in the program has is different. On the SGI system, the file has a dot capital C suffix, and on Linux it has a dot lower case c suffix. When I put both files in one file and surround them with precompiler directives such as #if SGI ... #elif LINUX ... #endif, the compiler complains when it includes other files. How can I get it...
10
9931
by: TokiDoki | last post by:
Hello there, I have been programming python for a little while, now. But as I am beginning to do more complex stuff, I am running into small organization problems. It is possible that what I want to obtain is not possible, but I would like the advice of more experienced python programmers. I am writing a relatively complex program in python that has now around 40 files.
11
2406
by: Jay | last post by:
Hey Guys, I need an algorithm/formula to do the following: I have two 32-bit timers cascaded to form a 64-bit timer, max value per timer(50sec). This is the way they work: value | timer1 | timer2 5 50 3 when timer1 counts down to zero, timer2 would count down to two.
5
2187
by: Alan Searle | last post by:
I am exporting ms-access data to XML files. This works fine. However, I need to insert one line at the top of each exported file (i.e. a reference to the XSL file) and am having a problem with this. First I did the following: Export the XML file (using standard XML export) and then read the file (line by line) and writing it out (together with the required extra line) to a new file.
2
1774
by: Jenny | last post by:
Hello All! I have a long XML file that I should transmit to other computer using http. Problem is that the whole XML Document is too large for one transmitting. What is the nicest way to split XML document into smaller pieces e.g. to 10 pieces? XML document is same kind what comes to itäs tags.
11
1709
by: J.Evans.1970 | last post by:
Hello. I've got a table I'm trying to tie to two other tables. The problem is that there is nothing distinct between the 3 tables. Yes, I know... But this is what I have to work with. Let me explain exactly what it is I'm trying to do with a little background history. First, the fast food company I work for has registers in their stores. We capture TLD files from the registers every 15 minutes. On a daily basis those files are...
15
2579
by: fyi | last post by:
My new blog on bits and pieces of PHP coding. http://bitspiecesphp.blogspot.com/ Have used all of them. Hope they're as useful to others: Use PHP to track email sender from your web site http://bitspiecesphp.blogspot.com/2008/06/use-php-to-track-email-sender-from-your.html Using PHP to solve the session_start() Error
0
9727
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10398
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10133
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9204
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.