1

I am endeavouring to correct a problem with a Web Project:-

Could not load type 'MyProg._Default'.

To fix this I have adopted the solution suggested here and changed CodeBehind into CodeFile. As is customary in ASP.Net Whack-a-Mole, this has introduced a new and different error:-

Context is not a member of 'MyProg._Default'

The very strange solution to this suggested here doesn't seem likely to fix the problem as I have no user-defined controls on the form.

I have two questions, really. First, is changing CodeBehind this way likely to fix the original problem, and if so how do I fix the new problem?

Edit to answer wazz's question, the top line in the aspx is:-

<%@ Language="VB"
    AutoEventWireup="true"
    Inherits="MyProg._Default" 
    CodeFile="Default.aspx.vb"
    MaintainScrollPositionOnPostback="true" %>

and the class is defined thus:-

Public Class _Default
    Inherits System.Web.UI.Page
Community
  • 1
  • 1
Brian Hooper
  • 21,544
  • 24
  • 88
  • 139
  • just a couple simple checks (i use lower case): page: `AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="_default"` and .cs : `public partial class _default : System.Web.UI.Page`. anything different for you? – wazz Nov 11 '15 at 20:44
  • i imagine you've already seen more than a few threads but here's another jic: http://stackoverflow.com/questions/1707835/could-not-load-type-webapp1-default-in-asp-net – wazz Nov 11 '15 at 20:48
  • @wazz, Thanks for the suggestion; I've answered your questions in the edit. – Brian Hooper Nov 12 '15 at 08:39
  • i'm used to websites and i don't know if projects are any different, but have you tried removing the `MyProg.` part from MyProg._Default ? sry if i'm missing the core, it just seems it should be inheriting the same name. – wazz Nov 12 '15 at 19:56

0 Answers0