473,385 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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

This code has always worked but today it is getting the exception in the
subject line of this post...

protected void Page_Load(object sender, EventArgs e)
{

this.Master.HeadingLabel.Text = "Direct 4506 Purchase"; <--this
gets the cast exception

I'm changing a public property in the master page- we do it all the time. I
googled the error and a lot of people were getting it back in 2006 where it
had to do with a caching bug in IIS I think. Why would I suddenly get this
today? I bounced IIS reloaded the project but to no avail.
Thanks,
Gary
Feb 28 '08 #1
1 6861
Hello Gary,

Yes, you are right. I confirmed with the ASP.NET team. The hotfix was
released on 4/12/2007, and it has been included into .NET Framework 2.0 SP1
(See: Problems that are fixed in the .NET Framework 2.0 SP1
http://support.microsoft.com/kb/945757). I think the KB article
http://support.microsoft.com/kb/915782/en-us does need an update to reflect
this. I will file a request to the KB team and ask them to update the
article as soon as possible. Thank you for pointing it out.

The "batch" attribute in the <compilationelement indicates whether
batching is supported. If True (default to be true), eliminates the delay
caused by the compilation when you access a file for the first time.
ASP.NET precompiled all the uncompelled files in a batch mode, which causes
an even longer delay the first time the files are compiled. However, after
this initial delay, this compilation delay is eliminated on subsequent
access of the file. If this attribute is False, we turn off the batch
compilation on the web site. See MSDN article
http://msdn2.microsoft.com/en-us/library/s10awwz0.aspx

I also see a lot of community member say that batch="false" can resolved
the problem:
http://forums.asp.net/t/954194.aspx?PageIndex=7
and Scott Guthrie from Microsoft agreed that it can fix the problem. This
doesn't impact runtime performance. IIS also doesn't recompile when the
application restarts unless there has been a code or configuration change
that requires it - so you won't have performance issues related to that
unless you are making code changes on the live site.

Scott Guthrie has a great blog entry at:
http://weblogs.asp.net/scottgu/archi...x-patch-availa
ble-for-asp-net-compilation-issues.aspx
This explains the resolution of the issue in detail.

If you have any other concern or need anything else, please feel free to
let me know.

Thanks
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Feb 29 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: hlyall1189 | last post by:
Hi, I recently started upgrading some of my old vs 2003 apps to vs 2005 and used the conversion tool but now i get the following error after building the page. I have typecasted the lines as...
0
by: Jeff | last post by:
Unable to cast object of type 'ASP.pgmaster_master' to type 'ASP.pgmaster_master'. I periodically get this error on VB .Net 2005 but then it will go away on it's own. I have no idea why this is...
2
by: rn5a | last post by:
Suppose I have this property in a user control (which is named Address.ascx): <script runat="server"> Public Property Caption() As Object Get Caption = lblCaption.Text End Get Set(ByVal...
0
by: BillE | last post by:
I get an intermittent error when I start a debug session for a vb.net web site which uses master/content pages: "Unable to cast object of type 'ASP.master' to type 'ASP.master'" I think this...
1
by: Chris | last post by:
Hi, I want to limit the amount of data shown in a page coming from a database. Everything works except that I get the error: "Unable to cast object of type...
35
by: Chris | last post by:
Hi, I tried to create a class which must change the propety 'visible' of a <linktag in the masterpage into 'false' when the user is logged. But i get the error: "Object reference not set to an...
1
by: epatrick | last post by:
I have a series of custom controls developed under ASP.NET 1.1, and I've successfully migrated to ASP.NET 2.0. I have also developed a custom class dervied from System.Web.UI.Page, called...
1
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I have a master page and a content page to that master. When I try to work with them I get an inconsistent error of casting ability and it happens irregularly, which means sometimes it can work...
1
by: =?Utf-8?B?U2NvdHQ=?= | last post by:
Hello, Using VS2008 in a C# web service application, a class has been created that inherits from the ConfigurationSelection. This class file has been placed in the App_Code folder. The...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.