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 444927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:19:10+00:00 2026-05-12T21:19:10+00:00

I have a website that has 2 files as follows: page.aspx page.aspx.cs It used

  • 0

I have a website that has 2 files as follows:

  • page.aspx
  • page.aspx.cs

It used to be that I could just drop new files onto the web server and IIS would automatically compile the files and I could access the page e.g.

http://www.website.com/page.aspx

… and the associated functionality in the page class contained in the .cs file would work nicely.

Now I get the error: “Could not load type namespace.classname” which refers to my page class.

Now for some strange reason I have to put all my .cs files, even page classes into the app_code folder.

All that has changed on my website is that I reorganised the structure so that instead of my pages being on the web root they are now inside http://…/newfolder/page.aspx.

For some reason all my page.aspx.cs files now have to be in app_code.

Any ideas?

  • 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-12T21:19:11+00:00Added an answer on May 12, 2026 at 9:19 pm

    Sounds like you are mixing up a Web Application Project and a Web Site.

    Are you sure the files are exactly the same? Perhaps one @Page directive says CodeBehind=Page.aspx.cs and the other says CodeFile=Page.aspx.cs?

    CodeBehind requires project compilation, so you cannot just drop in a new .cs file, you need to upload a new compiled DLL. CodeFile will allow dynamic compilation.

    The App_Code directory is dynamically compiled (in both cases) when your app is accessed, so the Inherit directive has a valid type when you put the file there. In general, don’t do this. You want the .cs file to go with the .aspx file. Use App_Code for business logic or utility classes that aren’t associated with a particular page.

    Finally, is this new subdirectory set up as a new app in IIS? What does the web.config file in your new directory change? Are you running the same version of ASP.NET? Check the “compilation” tag. I’m not sure what you could do there to cause this, but I’m sure you could cause some chaos.

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

Sidebar

Related Questions

We have a process in place that uploads files to our website. It has
I have a website that has highly granulised access and hence requires many web.config
I have a website that has products list page and product detail page .
I have a Drupal website that has a page at the URL alias of
i have taken over a website that has tons of css files and lots
So basically I have website that has names of cities that can be checked
I have a website that has one database I have also Desktop apps that
I have a website that has approx 1000 different strings in a mysql database
I have a website that has a relative path to a stylesheet that looks
I have a travel related website that has been online for several years (since

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.