Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2013-01-07
Medium Priority
Last Modified: 2013-01-12
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
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
namespace CVL
    public partial class CVLLookup : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs, e)
             CVL pm = (CVL)Page.Master;

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!
Question by:dyarosh
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 38752608
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?

Author Comment

ID: 38752678
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.

Accepted Solution

dyarosh earned 0 total points
ID: 38752726
I finally found the problem.  I had the following statement in my .aspx page:

<%@ MasterType VirtualPath="~/CVL.Master" %>

I thought I needed that to access the methods in the master page.  I removed it and now I am able to build without any errors.

Author Closing Comment

ID: 38769733
Found the problem on my own.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 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