asp.netweb-user-controls

Context is not a member of in asp.net usercontrol


I just created new usercontrol in an asp.net webapplication project.

Right after creation, the source looks like this:

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SSR_Project.ascx.vb" Inherits="CS_SSR_RAIO.SSR_Project" %>

But as soon as i add some additional code to it, the error on the first line is immedeately:

Context is not a member of 'CS_SSR_RAIO.SSR_Project

I do have other usercontrols who appear to have the exact same declarations, but dont have this error.

Any help would be greatly appreciated!


Solution

  • I got this error because it couldn't find the class of my new usercontrol's codebehind. I had this because I'd copied a usercontrol and it was in a Namespace which I'd not added to the Inherits attribute correctly.

    Added the namespace prefix and it started working again :)