Unable to cast object of type 'ASP.masterpage_master' to type 'MasterPage'.

Posted on 2006-04-04
Last Modified: 2010-05-18

I get this error every now and again.  It seems to be mainly when i change something on a usercontrol which is on the master page.

I get this error on this line of code trying to access a property on the master page, which then changes another property on the user control.

Master.PageTitle = "View - Summary";

Master page
public string PageTitle
        get { return Header1.PageTitle; }
        set { Header1.PageTitle = value; }

user control
public string PageTitle
        get { return lblPageTitle.Text; }
        set { lblPageTitle.Text = value; }

the only way i can stop this error is to close VS 2005 and open project again.

any ideas??

Question by:osiris247
    LVL 6

    Accepted Solution

    This is a known bug in the product. Check out this thread on ASP.NET forums:

    Somebody from Microsoft (jamesche at posted the following instructions for obtaining a fix:

    << We now have a fix available for this issue.  If you need the fix, you will need to call PSS and get a case created so that we can track distribution of the fix. The case is a no-charge case for delivery of a hotfix.

    You can call (800) 936-5800 and tell them that you are calling for an ASP.NET hotfix.  The KB for the fix has not yet been published, but you can ask for the hotfix for issue 915782.  The support engineer can look up that fix internally and send it to you. You might want to let them know as well that you are calling because you saw this post from me. That way, they can ping me if they need any assistance.

    Please use that method first, but if you have difficulties because of the unpublished KB, please contact me directly at and I'll get you the fix. This is a pretty popular issue, so please do use the 800 number first!  If everyone e-mails me, it will take longer. I promise you that.  :)

    The KB will hopefully be published soon.
    LVL 7

    Author Comment

    thanks enwhysee...

    i have emailed him and wait to see.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 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

    14 Experts available now in Live!

    Get 1:1 Help Now