Link to home
Start Free TrialLog in
Avatar of dyarosh
dyarosh

asked on

The type name 'CVL' does not exist in the type 'CVL.CVL Error

I am trying to access a public method in my Master Page from my child pages.  Here is the basic layout that I have:

CVL.Master - Master page
CVL.Master.cs
============
namespace CVL
{
    public partial class CVL : System.Web.UI.MasterPage
    {
            public void ErrorHandling(parameter definitions)
            {
                     error handling code
            }
    }
}

CVLLookup.aspx - Web page using CVL.Master as it's Master Page
CVLLookup.aspx.cs
===============
namespace CVL
{
    public partial class CVLLookup : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs, e)
        {
             CVL pm = (CVL)Page.Master;
             pm.ErrorHandling(parameters);
        }
    }
}

Open in new window


I get the above error in the CVLLookup.aspx.designer.cs file which is autogenerated.  Here is what is generated in the designer file:

public new CVL.CVL Master {
    get {
        return ((CVL.CVL)(base.Master));
    }
}

The error occurs on the second reference to CVL.CVL in both places.  See attached file.

Any help is greatly appreciated!
CVLError.bmp
Avatar of kaufmed
kaufmed
Flag of United States of America image

Remove one of the "CVLs":

public new CVL Master {
    get {
        return ((CVL)(base.Master));
    }
}

Open in new window


Out of curiosity, why are you using new?
Avatar of dyarosh
dyarosh

ASKER

I am using VS2010 and the .designer file is auto-generated.  I did not create this definition explicitly.  It was done by VS2010 for me so I can't make any changes to it.
ASKER CERTIFIED SOLUTION
Avatar of dyarosh
dyarosh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dyarosh

ASKER

Found the problem on my own.