473,418 Members | 2,061 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,418 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 6872
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: 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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.