473,657 Members | 2,414 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compiling multiple pages to a single code-behind page in VS2005

Hi,

I'm putting together a project that uses ASP.NET in VS2005. It uses a
single master page that is responsible for most of the heavy lifting. About
90% of the 200 pages have the same code-behind, so I implemented all of
these pages so they would reference the same code-behind cs file, as
follows:
<%@ Page Language="C#" MasterPageFile= "~/MyMaster.master "
AutoEventWireup ="true" CodeFile="~/Template.aspx.c s" Inherits="Templ ate"
Title="Page Title" %>

The problem is, though, that the project is taking forever to compile, and
there are only about four lines of code in the Template.aspx.c s file, which
I was hoping would only compile once for that single page. When I publish
the project, it creates a DLL file for each page, regardless of whether I
check the Use fixed naming and single page assemblies checkbox.

So, is there any way that I can force the compiler to compile the
Template.aspx.c s class only once and have it apply to all pages that Inherit
that page?

Thanks, Jim
Nov 20 '06 #1
1 1869
The compile times are due to each page having to reocmpile the common bits
and causing a compilation war. There is no reason to do this.

Options
1. Move common code into a class and call from each page - this does not
really solve the problem, but does provide for reuse of functionality
outside the website.
2. make a class that inherits from page and set pages to inherit from it
instead of page - best option if the code is really the same. Compiles once

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************** *************** *************** ****
Think outside the box!
*************** *************** *************** ****
"LiveCycle" <li*******@sand box.etech.adobe .comwrote in message
news:Oy******** ******@TK2MSFTN GP02.phx.gbl...
Hi,

I'm putting together a project that uses ASP.NET in VS2005. It uses a
single master page that is responsible for most of the heavy lifting.
About 90% of the 200 pages have the same code-behind, so I implemented all
of these pages so they would reference the same code-behind cs file, as
follows:
<%@ Page Language="C#" MasterPageFile= "~/MyMaster.master "
AutoEventWireup ="true" CodeFile="~/Template.aspx.c s" Inherits="Templ ate"
Title="Page Title" %>

The problem is, though, that the project is taking forever to compile, and
there are only about four lines of code in the Template.aspx.c s file,
which I was hoping would only compile once for that single page. When I
publish the project, it creates a DLL file for each page, regardless of
whether I check the Use fixed naming and single page assemblies checkbox.

So, is there any way that I can force the compiler to compile the
Template.aspx.c s class only once and have it apply to all pages that
Inherit that page?

Thanks, Jim

Nov 21 '06 #2

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

Similar topics

7
5104
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting normal functions in header files results in multiple definition errors even when include guards are used. -- STH Hatton's Law: "There is only One inviolable Law" KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com Mozilla:...
0
3053
by: David W. Fenton | last post by:
Today I was working on a hideous old app that I created a long time ago that does a lot of showing/hiding/resizing of fields on one of the forms. I had used constants to store reference values for many of the top/height/left settings. I noticed that some of the constants were defined by using other constant values, and I was impressed that VBA could do that. Here's an example: Const row1Top = 1.0208 * 1440 ' top of first row Const...
7
2153
by: jsale | last post by:
I have made an ASP.NET web application that connects to SQL Server, reading and writing data using classes. I was recommended to use session objects to store the data per user, because each user using the application needs to see their own data only. My problem is that when multiple users are in the application, when in the session object, data is fine, however as there is only one instance of the class files, when data is put into them,...
3
2207
by: Carl Johansen | last post by:
I have a big ASP website (used by several thousand car dealers) that is a collection of lots of small and medium-sized applications. Now I want to start adding ASP.NET applications to it. I have read Q307467 (How To Create an ASP.NET Application from Multiple Projects for Team Development) and it seems to work well. I understand that when you create a web project in VS.NET, it creates an IIS application root, and that you can remove this...
9
2765
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and wizards. But, I have found that trying to do something "outside the norm" adds a rather large level of complexity and/or data replication. Background I have been commissioned to create a web-based application for a client. It has a formsaunthentication...
0
9738
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile. I need it to be compiled with threads. Anyone have any wisdom on how best to do this? Here's a transcript of my latest attempt. It's long; you might want to skip to the bottom, where I try "make" and the fatal errors start happening.
4
4693
by: Matt Kruse | last post by:
While developing an internal IE6-only webapp, a discussion started about the 'best' way to apply classes to data tables across multiple pages. The two arguments were: 1. Apply a single class to each table. That class (possibly in combination with other classes on child elements) controls every part of the table - layout, colors, fonts, etc. Example: class="data" PROS: Easier to standardize, less specificity confusion, everything is...
2
1360
by: chazzy69 | last post by:
Ok heres what i have at the moment--> Two .php pages with programs on them both, currently i have two seperate posting pages for each of .php pages. Now first up i need to find a way to send to multiple .php files, this is what im currentlly using for just one --> <form id="enquiry" name="enquiry" action="test.php" enctype="multipart/form-data" method="POST" onSubmit="return checkform();"> Thats the first part of my question;
1
1675
by: raul15791 | last post by:
Hi, I'm newbie in ASP. I am trying to view multiple pages by using a single file. For example, I have a few pages of product.asp (products.asp, products1.asp and so on). Now I want to create a single single (products.asp) but can view multiple pages. Try to search through google but not even sure what to search for.
4
5478
by: anon538 | last post by:
I have been interested in switching from Java to C# for a long time now. I typically write small, stand alone programs for contests. Each program is completely self contained. I am used to, in Java, creating a file, say pr21.java with a single class and main method, compiling it, and running it. Since I've switched to C#, I have been using MS Visual C# Express 2008 as my IDE. It has this weird obsession with encapsulating all of my programs...
0
8402
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
8315
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8508
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
8608
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
7341
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
5633
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
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.