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


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??

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Somebody from Microsoft (jamesche at microsoft.com) 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 jamesche@microsoft.com 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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
osiris247Author Commented:
thanks enwhysee...

i have emailed him and wait to see.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.