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

  • Home
  • SEARCH
  • 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 1898210
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:44:17+00:00 2026-05-17T06:44:17+00:00

My current Web Site does not have any designer.cs files. (Yes it is not

  • 0

My current Web Site does not have any designer.cs files. (Yes it is not a Web Application)

The site is complete but now I added 2 Clases to my site and all good but when I want to make use of my GridView it tells me this:

alt text

This is because I wrapped my code with the same namespace as in my classes like so….

  namespace samrasWebPortalSQL
  {
     public partial class GridView : System.Web.UI.Page
   {
    protected void Page_Load(object sender, EventArgs e)
    {
        Functions.RemoveCaching(this);
        LoadGrid();

    }

    private void LoadGrid()
    {
        DataSet dataSet = SQLHelper.GetDataSet("select * from company");
        Functions.BindGridView(GridView1, dataSet);
    }

   }
}

I know I need the following code in my .designer.cs file but since I dont have one cant I place it anywhere ells?

protected global::System.Web.UI.WebControls.GridView GridView1;
  • 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-17T06:44:17+00:00Added an answer on May 17, 2026 at 6:44 am

    In your “web site”, you can add a new ASPX page (Web Form). And in that web form you can drag a GridView onto that page. Once you’ve given it an ID like this:

    <div>
    <asp:gridview ID="Grid1" runat="server"></asp:gridview>
    </div>
    

    You can then go to the code behind and do something like this:

    protected void Page_Load(object sender, EventArgs e)
    {
        Grid1.DataSource =..;
    }
    

    If you put your code behind in a different class name or namespace, then you need to tell your web form where to find it. You do this by chaning the Inherits property of the page directive like this:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="samrasWebPortalSQL.GridView" %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have an asp.net Web Application (Not Web Site) that I am trying
window.location.href does not work to save the current web page url as a bookmark.
I have recently changed from web site model to a web application model .
I have a simple class that contains some general information about the current web
I have been reviewing the setup of a current Amazon Web Store implementation to
I have a ASP.NET Web Forms application that internally makes many SOAP and REST
I am building a local intranet web application which uses the current user's AD
Added Castle.Facilities.NHibernateIntegration via NuGet, and now when I try to run the site, I
I am building a web application that will have a fair bit of forms.
I have many users on my web site (20000-60000 per day), which is a

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.