problem between aspx page and aspx.cs?

Posted on 2006-05-01
Last Modified: 2012-05-05
Can anyone shed some light on this?

Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

Source Error:


Line 1:  using System;
Line 2:  using System.Collections;
Line 3:  using System.ComponentModel;

Source File: c:\Inetpub\wwwroot\C_824Admin\824Admin.aspx.cs    Line: 1
Question by:knowlton
    LVL 5

    Author Comment

    Okay, I think I fixed the one above, but now I get this:

    Compiler Error Message: CS0260: Missing partial modifier on declaration of type 'Transport._824Admin.WebForm1'; another partial declaration of this type exists

    Source Error:


    Line 23:         ///
    Line 24:
    Line 25:         public class WebForm1 : System.Web.UI.Page
    Line 26:         {
    Line 27:             protected System.Web.UI.WebControls.DataGrid DataGridCarrier824;

    Source File: c:\Inetpub\wwwroot\C_824Admin\824Admin.aspx.cs    Line: 25
    LVL 9

    Accepted Solution

    Check the @Page directive at the top of your aspx page.  The inherits attribute needs to be named the same as the class (in the .cs file)

    For instance, if the you have the following:
    <%@ Page Language="c#" Inherits="MyWebForm" ...%>

    You'll need to have a code-behind file that has the following:

    public class MyWebForm : System.Web.UI.Page

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now