0
**File :Views/Shared/Default.aspx:**

<%@ Page Language="C#" AutoEventWireup="True" CodeFile="Default.aspx.cs" Inherits="Views_Shared_Default" %>

File: Views/Shared/Default.aspx.cs:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;


public partial class Views_Shared_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}



Error: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).
My Documents\Visual Studio 2008\Projects\3ICMS\Views\Shared\Default.aspx.cs 15 14 C:\...\3ICMS\


P.S I have 2 Default.aspx files in my Project 3ICMS.

1 File is at 3ICMS\Views\Shared\Default.aspx.cs 
2nd File is at 3ICMS\Default.aspx

I have tried creating a new file and copy paste this code..Didn't work. I have tried tried changing codefile to codebehind ... Didn't work

How to solve this problem?

tereško
  • 58,060
  • 25
  • 98
  • 150
user1511069
  • 339
  • 2
  • 5
  • 11

1 Answers1

1

The files are in different folders views and view , you should put the full directory path or put them in the same folder

<%@ Page Language="C#" AutoEventWireup="True" CodeFile="../../Views/Shared/Default.aspx.cs" Inherits="Views_Shared_Default" %>
tsukimi
  • 1,605
  • 2
  • 21
  • 36
  • Sorry,typing mistake..Both are in same file Views – user1511069 Jul 17 '12 at 07:10
  • maybe try using a namespace for the Views_Shared_Default class and using that also in the inherits, what is the class name of the other default page? – tsukimi Jul 17 '12 at 07:18
  • The code looks correct ,i think we are not seeing the full story, something else is the problem, try posting the complete code. – tsukimi Jul 17 '12 at 08:24
  • Everything got solved...The site was opened as a Website on a new machine and not as a Project Solution.I think the problem is in Website mode multiple .dll files are created when complied but in Project Solution only single .dll file is created and hence all ambiguous problems gets solved. – user1511069 Jul 27 '12 at 05:04