When you deploy .aspx pages, if their associated code-behind class files are precompiled, you only have to deploy the assembly to the Bin folder of the application. You do not have to deploy the actual code-behind class files with the application.
When you deploy .aspx pages, if their associated code-behind class files are not precompiled, you must deploy the code-behind class files with the application. Additionally, you must add the Src attribute to the @ Page directive because the class file must be available when it is compiled on demand.
More information about code-behind class file you can refer to this link: code-behind-class-files.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
@Coreysan You can refer to this code:
<%@ Page language="c#" Codebehind="SrcSample.aspx.cs" AutoEventWireup="false" Inherits="CodeBehindSamples.SrcSample" Src="SrcSample.aspx.cs"%>
Please forgive me - I am sure I asked my question incorrectly. I should restate the problem I have. I hope you'll bear with me.
I have a project with two files;
Default.aspx.cs (public partial class Default : System.Web.UI.Page)
The Default.aspx.cs file has 7 methods, and in VS2019 I separated those out into their own files (for example, DoWork1.cs, DoWork2.cs, DoWork3.cs, etc.).
Each file has "public partial class Default".
So in a classic IIS project environment with no pre-compiled DLLs, can I get Default.aspx to recognize those 7 additional code files?
@Coreysan Have you considered putting these 7 methods into the Default.aspx.cs file? Then your problem is gone.
Sign in to comment