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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:07:23+00:00 2026-06-03T05:07:23+00:00

So I seem to have some difficulties with making my CodeFile reference into CodeBehind.

  • 0

So I seem to have some difficulties with making my CodeFile reference into CodeBehind. Before you ask, I do not have Visual Studio and I’m not on Windows. The code is being hosted on an IIS server that I have access to.

<% @Page Language="C#" Inherits="corn.cheese.pies.CasLogin" CodeFile="anon.cs" %>

This code works perfectly, however upon changing it to:

<% @Page Language="C#" Inherits="corn.cheese.pies.CasLogin" CodeBehind="anon.cs" %>

The page returns an error:

Parser Error Message: Could not load type 'corn.cheese.pies.CasLogin'.
  • 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-06-03T05:07:25+00:00Added an answer on June 3, 2026 at 5:07 am

    Are you sure you understand the difference between CodeFile and CodeBehind? See, for example, CodeFile vs CodeBehind (ignore the accept answer, though, both links are dea) or this article about the difference.

    In a nutshell:

    A CodeBehind file is assumed to be compiled into an assembly that is deployed in the bin folder of your web site. When the ASP.NET engine loads your aspx file, it uses the Inherits directive to try to find that class. The CodeBehind file is primarily used to aid compiling (and tooling, e.g. “View Source”) but the work is done at compile time.

    A CodeFile file is located and compiled by ASP.NET at runtime, on demand. You can “pre-compile” your web site to fall back on the older model, which is useful if you won’t want to deploy your source code to every web site. But by default, your CodeFile file is a .cs file that is deployed to the site, and the class is generated in the ASP.NET temporary storage folder. (From a technical perspective: CodeFile pages are partial class definitions, with only the custom code-behind part of the class actually deployed in the C# file; this is why CodeFile didn’t exist initially, because the C# compiler could not initially do partial classes.)

    By changing from CodeFile to CodeBehind you are telling ASP.NET to ignore the presence of the C# file, and only look for it in the compiled assembly. ASP.NET is, in turn, telling you that the compiled assembly doesn’t actually contain the class you told it to look for.

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

Sidebar

Related Questions

I was looking into claimed identifiers, but they seem to have some issues with
so I'm not well versed in overriding hashCode and I seem to have some
I have some colors that seem to come from a Delphi TColor variable (e.g
I have some troubles while writing logs from log4net to the file. I seem
I have read through several reviews on Amazon and some books seem outdated. I
I seem to have some weird issue going on that I am sure will
I'm fairly new to OpenGL, and I seem to be experiencing some difficulties. I've
I seem to have some files in my Xcode project that I can't erase.
Sorry I saw similar questions but they don't seem to have some full answers
I seem to have some problems wrapping my head around the concept about how

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.