Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 969689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:40:49+00:00 2026-05-16T02:40:49+00:00

Our current web portal at work was a port from a classic ASP codebase.

  • 0

Our current web portal at work was a port from a classic ASP codebase. Currently, all pages in our project extend a custom Page class called PortalPage. It handles login/logout, provides access to a public User object for the currently authenticated user, and adds the standard page header and footer to all of our pages.

Every Page in our site is 100% designed in the codebehind. The ASPX page is not used at all. Every single div, img, and block of text is allocated as an object and added from a C# function, even if it is completely static content (which we have a decent amount of).

Example for a page header:

HtmlGenericControl wrapperDiv = new HtmlGeneric("div");
HtmlAnchor bannerLink = new HtmlAnchor();
HtmlImage banner = new HtmlImage();

bannerLink.HRef = "index.aspx";
banner.Src = "mybanner.png";
banner.Alt = "My Site";

bannerLink.Controls.Add(banner);
wrapperDiv.Controls.Add(bannerLink);
this.Page.Controls.Add(wrapperDiv);

Even worse, all Javascript is added to the page as a giant mess of string concatenations:

ClientScript.RegisterClientScriptBlock(this.GetType(), "javascript", @"
    <script language='javascript'>
        fullUrl = '" + ConfigurationManager.AppSettings["fullUrl"].ToString() + @"';
        function showModule()
        {
            $('#" + this.userModule.ClientID + @"').css('display','block');
            $('#" + this.groupModule.ClientID + @"').css('display','none');
            $('#" + this.listsModule.ClientID + @"').css('display','none');
            $('#" + this.labelsModule.ClientID + @"').css('display','none');
        }

Currently, one of my coworkers is arguing that allocating every object in the codebehind is hundreds of times faster than using the ASPX w/ Codebehind approach that I see every other web app using. This goes against my instincts, as it’s essentially adding runat="server" to every piece of HTML on the page.

He also says that all professional shops write code this way and never use ASPX pages. He says that all textbooks and sample code uses ASPX pages because they’re easier for newbie coders to understand. Is there truth to this, or are we just writing in an incredibly inefficient way for the sake of tradition?

In order for us to switch to the “standard” way of writing Web Forms, I need to provide some source to show that he’s wrong.

My problem is, I’ve never even heard of anyone else writing everything in the codebehind. Every example I’ve seen uses ASPX pages for the user interface and a code-behind for logic, database calls, etc.

So in summary:
1) Are ASPX pages really that much slower than 100% codebehind?
2) Do professional shops actually use 100% codebehind?
3) If ASPX w/ codebehind is the way to go, does anyone have any creditable links that could help back me up?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T02:40:50+00:00Added an answer on May 16, 2026 at 2:40 am
    1. They all get compiled to assemblies. The .aspx gets loaded once at application startup and parsed once.
    2. No, not if they have any sense.
    3. Look at every book at website about ASP.NET. They all use .aspx.

    One way to test this is to run a performance test, with two .aspx pages that are entirely identical. Apart from a possible short startup delay for the .aspx (parse and compile), I doubt any significant difference will be detected.

    Using all code behind is a way to miss out on:

    • Working with designers who understand HTML
    • Being able to visually inspect the markup
    • Being able to easily change layouts
    • Getting experienced asp.net developers to work with you…
    • Having a sane way of developing asp.net
    • The great tooling and existing integration
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our current project at work is a new MVC web site that will use
Our current project is written in ASP.NET MVC 1 using mvc-turbines (and unity) for
I'm working on an ASP.NET project where I need to split our current application
I am a web developer working with 2-3 people including me. Our current setup
Our current MVC project is set up to have ViewModels that encapsulate the data
Our current project has ran into a circular dependency issue. Our business logic assembly
in our current project we are using ADO.NET Entity Framework as data layer for
For our current J2EE project based on JBoss, we need to interface with a
Our current web application url reveals the class package structure to the end user.
Our current web application is using SQL Server, we have a requirement for support

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.