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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:21:33+00:00 2026-06-04T09:21:33+00:00

I created a branch new web project: File -> New -> Project -> ASP.NET

  • 0

I created a branch new web project:
File -> New -> Project -> ASP.NET Web Application

Then I tried to add a simple control asp:Label but the aspx.cs doesn’t recognize this declaration for some reasons. I didn’t make any changes to the default project. It contains 6 pages:

enter image description here

Does anyone know what could cause this issue? Thanks.

EDIT
Here what I added to the file About.aspx is a label with id = id1

<%@ Page Title="About Us" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="About.aspx.cs" Inherits="WebApplication2.About" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:label ID="id1" runat="server" >A Label</asp:label>
    <h2>
        About
    </h2>
    <p>
        Put content here.
    </p>
</asp:Content>

I ran the project without calling that variable id1, everything works fine.

enter image description here

But if I called id1 within About.aspx.cs, it gave me error said the variable was not found.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication2 {
    public partial class About : System.Web.UI.Page {
        protected void Page_Load(object sender, EventArgs e) {
            id1.Text = "What the heck?";
        }
    }
}
  • 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-04T09:21:35+00:00Added an answer on June 4, 2026 at 9:21 am

    Based on you comment it seems your your About.aspx.designer.cs file is missing the Label definition. Delete your About.aspx.designer.cs file and to regenerate it, right click on the Project (WebApplication2) and Choose ‘Convert To Web Application‘ this will regenerate your About.aspx.designer.cs file.

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

Sidebar

Related Questions

Noob here.... I cloned a git and then created a new branch in it.
I created a new branch of my project and now when I try to
Story: in the middle of a project my colleague created a new branch from
I have created a new branch and did svn import of the source files
I have a local branch work, where I created two new files a.py, b.py
I created a branch and then made changes to trunk which need merging into
I'm new to TFS (and branch/merge style source control). I've been reading through the
I'm working on a relatively small, but fast-changing project (a web application) with a
I created a new Branch before I started dev on something experimental. I usually
I created a new branch named newbranch from the master branch in git. Now

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.