problem between aspx page and aspx.cs?

Posted on 2006-05-01
Medium Priority
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:Tom Knowlton

Author Comment

by:Tom Knowlton
ID: 16580713
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

Accepted Solution

HappyFunBall earned 2000 total points
ID: 16580943
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

578 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