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

  • Home
  • SEARCH
  • 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 944165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:32:57+00:00 2026-05-15T22:32:57+00:00

Any time I need to write code I almost always put it in the

  • 0

Any time I need to write code I almost always put it in the code behind file. For some reason this has always seemed like the “right” way to write code.

Based on most of the examples I see online, a lot of other people choose to write code this way too, but it seems like putting your code in the aspx file allows you to do all the same stuff as well as offering a few advantages.

Top of the list being:

  • Easier to make changes since no
    recompile.
  • You have access to all code if
    you can’t find the project in source
    control (this recently happened to
    me).

Is there any benefit to having code in a code behind file? Is there any disadvantage to putting code in your aspx file?

  • 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-15T22:32:57+00:00Added an answer on May 15, 2026 at 10:32 pm

    Separating the code from the markup results in much cleaner structure, especially for non-trivial pages.
    This is one of the major benefits to ASP.Net over ASP Classic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some time ago I got this error when building ANY Visual Studio Deployment project.
I need some code to be triggered if any error occurs. Basically I need
Is VBA going to go away any time soon, like VB6 has? Should I
I need to write code that reads the corflags of a .net assembly without
Any time I try to publish my Portal project on a Websphere Portal 6.1
I've discovered that any time I do the following: echo '<a href=http:// title=bla>huzzah</a>'; I
My IDE crashes any time I try add a new component to the toolbar.
In Delphi 2009 I'm finding that any time I use TThread.CurrentThread in an application,
Working to get DateTimes for any time zone. I'm using DateTimeOffset, and a string,
I'm using Visual Studio 2008 SP1 on .NET 3.5 SP1 on Vista Any time

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.