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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:07:18+00:00 2026-05-20T16:07:18+00:00

What is the use of the CodeFile attribute in an ASP.NET page ?

  • 0

What is the use of the CodeFile attribute in an ASP.NET page ?

  • 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-20T16:07:18+00:00Added an answer on May 20, 2026 at 4:07 pm

    CodeFile attribute is used for deploying a single page without deploying the whole application :-

    Here are the instructions to deploy a single page to a web application. The following example is using the page /Forms/CreateUser.aspx

    In the .cs file change the name of the class to one that doesn’t exist. For example, change the following:

    public partial class CreateUser : System.Web.UI.Page
    

    To:

    public partial class CreateUser1 : System.Web.UI.Page
    

    In the aspx, ascx, master, etc. change the Codebehind to CodeFile and change the name of the class specified in the Inherits attribute to the same name as in the .cs file. For example change the following:

     Page Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeBehind="CreateUser.aspx.cs" Inherits="Forms.CreateUser"
    

    To:

    Page Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="CreateUser.aspx.cs" Inherits="Forms.CreateUser1"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to use jQuery in ASP.NET User Control. Can some one tell
i am trying to use javascript events in asp.net webforms. but events for input
I want to create a WCF Service for use on my ASP.Net website (not
I was intending on use the Title attribute in the @Page directive to customise
Use of gradient images is very common among developers for styling a page. Gradient
I'm trying to use protobuf in a C# project, using protobuf-net, and am wondering
I want to use an AJAX update panel in a web master page ,
I use scriptManager in masterpage, because every content page is to be ajxify. In
Solved using this post: Can you convert an ASP.NET MVC Application to a Web
In most .NET project I can use folder to organise the code files. In

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.