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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:53:47+00:00 2026-05-27T01:53:47+00:00

I have a grid that is named grdUserActivity. I’m not sure what the error

  • 0

I have a grid that is named grdUserActivity. I’m not sure what the error means.

The name ‘grdUserActivity’ does not exist in the current context

C#

public partial class frmViewPersonnel : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            // Declares the DataSet
            dsUserActivity myDataSet = new dsUserActivity();

            // Fill the dataset with what is returned from the function
            myDataSet = clsDataLayer.GetUserActivity(Server.MapPath("PayrollSystem_DB.mdb"));

            // Sets the DataGrid to the DataSource based on the table
            grdUserActivity.DataSource = myDataSet.Tables["tblUserActivity"];

            // Binds the DataGrid
            grdUserActivity.DataBind();
        }
    }
}

.ASPX

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="frmPersonnel.aspx.cs"      Inherits="frmPersonnel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
<form id="form1" runat="server">
<div align="center">

</div>
<asp:Panel ID="Panel1" runat="server" Height="250px" HorizontalAlign="Left" 
    Width="300px">
    <asp:Label ID="Label1" runat="server" Text="First Name:" Width="80px"></asp:Label>
    <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
    <br />
    <asp:Label ID="Label2" runat="server" Text="Last Name:" Width="80px"></asp:Label>
    <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox>
    <br />
    <asp:Label ID="Label3" runat="server" Text="Pay Rate:" Width="80px"></asp:Label>
    <asp:TextBox ID="txtPayRate" runat="server"></asp:TextBox>
    <br />
    <asp:Label ID="Label4" runat="server" Text="Start Date:" Width="80px"></asp:Label>
    <asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox>
    <br />
    <asp:Label ID="Label5" runat="server" Text="End Date:" Width="80px"></asp:Label>
    <asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>
    <br />
    <asp:Button ID="btnSubmit" runat="server" 
        PostBackUrl="~/frmPersonnalVerified.aspx" Text="Submit" 
        onclick="btnSubmit_Click" />
    <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
    <br />
    <asp:Label ID="lblError" runat="server"></asp:Label>
</asp:Panel>
</form>

  • 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-27T01:53:48+00:00Added an answer on May 27, 2026 at 1:53 am

    Not sure if this is a type-o

    But your aspx file is pointing to frmUserActivity rather than frmViewPersonnel

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="frmUserActivity.aspx.cs" Inherits="frmUserActivity" %>
    

    So either you are editing the wrong .cs file, OR the wrong .aspx file 😉

    EDIT

    After seeing your edits, your frmUserAcitivty aspx page does not contain the grdUserActivity control. So of course it wont be found.

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

Sidebar

Related Questions

I have a button named [Filter] that I'm trying to call the grid search
I have a scenario that does not seem to be covered in any of
I have a grid that has multiple rows. I want to hide/show one of
I have a data grid that has a checkbox item renderer in a cloumn
I have a parent grid that contains multiple row definitions, all of which have
I have a grid and I need to dynamically replace a control that resides
I need to have a grid on one of my webpages that will be
I have a grid (DevExpress XtraGrid, if that matters) which is bound to a
I have a Data Grid View inside a control that is displayed in a
I have used a list view that uses a grid view in WPF. I

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.