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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:47:10+00:00 2026-06-05T03:47:10+00:00

I have apsx page that has the following simple code: <%@ Page Title= Language=C#

  • 0

I have apsx page that has the following simple code:

<%@ Page Title="" Language="C#" MasterPageFile="~/Team.master" AutoEventWireup="True" Inherits="Lib.team" Codebehind="team.aspx.cs" %>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">


    <asp:GridView ID="GridView1" runat="server">
    </asp:GridView>

</asp:Content>

My Behind code is as follow:

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


namespace Lib
{
  public partial class team : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlDataReader reader = DBData.ExecuteQuery("SELECT * FROM tblTeam");
        GridView1. //This is where the error is
    }
  }
}

My problem is I can’t seem to get the behind code to recognize the control variable GridView1. I am using a web application in VS2010 and below is my project tree:

enter image description here

I think it is something very simple that I missed. I tried to recheck my namespace, my inherit clause, recompile the project. Any help or guidance would be greatly appreciated.

Thanks

  • 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-05T03:47:12+00:00Added an answer on June 5, 2026 at 3:47 am

    I tried all of the steps everyone suggested but no luck… I’m not quite sure why. However, I have a work around as mentioned in one of the comment I wrote. Basically I just convert my project into a Web Site Project and not a web application.

    thank you everyone.

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

Sidebar

Related Questions

I have a apsx page and in that page I have two buttons called
Have data that has this kind of structure. Will be in ascending order by
Have data that has this kind of structure: $input = [ { animal: 'cat',
Have a simple one-off tasks which needs a progress bar. OpenSSL has a useful
Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
Have added the following code to my SQL query: (Note cut down version) DECLARE
I have an apsx page in the asp.net application, elements of which are built
I have some code in <head> in .apsx I would like to move to
i have two popup windows in my Home Page (Default.aspx) like below : apsx
Have the following code. The height is variable so the height of the floating

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.