Error Message: Could not load type

Posted on 2014-08-10
Last Modified: 2014-08-11
I have 2 web form pages. One loads without error. One displays error.  
I cannot find any difference between them.

This works:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="BestPicks.aspx.cs"
    Inherits="StockProMax.BestPicks" %>

This does not work:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="AlionEval.aspx.cs"

Parser Error
  Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

 Parser Error Message: Could not load type 'StockProMax.AlionEval'.

Source Error:

Line 1:  <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master"
Line 2:      AutoEventWireup="true" CodeBehind="AlionEval.aspx.cs"
Line 3:      Inherits="StockProMax.AlionEval"

 Source File:  /AlionEval.aspx    Line:  1

Steps to reproduce:
Select Best Picks from the Features menu.
The Best Picks page opens and tells you that you must log in. This is OK.

Now select Alion Demo.
The error will display.

What should I look at?

Question by:Dovberman
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    Check in AlionEval.aspx.cs, very likely the class is not exactly StockProMax.AlionEval.
    Namespace not correct, or class name not being the same. Note that it may be a case sensitivity issue (I had that recently after copying a web page)

    Author Comment

    BestPicks works:

    namespace StockProMax
        public partial class BestPicks : System.Web.UI.Page

    AlionEval does not work:

    namespace StockProMax
        public partial class AlionEval : System.Web.UI.Page


    Here is more info.

    AlionEval works from localhost, but not from hosted site.

    Should I copy BestPicks, rename it, and upload to the hosted site?
    LVL 142

    Accepted Solution

    Ensure that both class files match the class name and namespace
    ensure you recompile full and upload the aspx and dll files.

    Author Comment

    The dll hint did it. I did a full recompile and manually uploaded new and changed files via ftp. However I forgot to Publish to the host.


    Author Closing Comment

    Perfect.  Thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
    When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
    The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

    737 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

    18 Experts available now in Live!

    Get 1:1 Help Now