Home > Asp Net Unable > Asp.net Unable To Cast Master Page

Asp.net Unable To Cast Master Page

All rights reserved. One way I think you can fix it in the meantime (besides the fix I already mentioned above with disabling batch compilation) would be to define an interface within your /app_code The experiance is jarring. After a (not so wonderfully quick) restart of VS, my code works fine again, for about another hour. have a peek here

i have a master page, nothing really weird, with 4 user control in it.. 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. Dim dt As New Data.DataTable dt = CType(e.message, Data.DataTable) Dim mp As New MasterPage mp = CType(Me.Master, MasterPage) Try mp.AdtoCart(dt) Catch ex As Exception many thanlks Simon This posting is provided "AS IS" with no warranties, and confers no rights. http://stackoverflow.com/questions/15837523/unable-to-cast-object-of-type-masterpage-to-type-master

Otherwise, we recommend that you wait for the next .NET > Framework 2.0 Service pack release. > > If you have any other concerns or questions, please feel free to let The case is a no-charge case for delivery of a hotfix. We've noticed this error when we've made changes to an aspx page and then only uploaded the one aspx file (not the .cs).

To enable this, please follow one of the below steps, then request the URL: Add a "Debug=true" directive at the top of the file that generated the error. The reason would be you are really trying to see if something is of type System.Web.UI.MasterPage But you're actually comparing to your own file named "MasterPage". I have disabled batch compilation for now, which is getting around the problem. If you have any other concern or need anything else, please feel free to let me know.

The site that I am working in is pretty complex(at least I feel that way[:)] ) I have Nested Master pages and I am also using the MasterType in order to Jim Cheshire Senior Escalation Engineer ASP.NET Critical Problem Resolution Team Microsoft Corporation Reply shahj99 None 0 Points 2 Posts Re: Unable to cast object of type 'ASP.masterpage_master' to type 'ASP.masterpage_master'. We're a friendly computing community, bustling with knowledgeable members to help solve your tech questions. Jul 11, 2006 11:25 PM|TravisWhidden|LINK I just read all of the threads to this post.

But yeah.. more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Jun 02, 2006 05:39 PM|davidebb|LINK FYI, we still have not been able to repro this problem with the patch installed, though based on the reports here, it is clear that it We will, though, post back on this thread as soon as it is available.

Mar 15, 2006 09:24 PM|JamesChe|LINK Great to hear, John. https://www.experts-exchange.com/questions/21800605/Unable-to-cast-object-of-type-'ASP-masterpage-master'-to-type-'MasterPage'.html Error Msg: "Unable to cast object of type 'ASP.femaster_master' to type 'FEMaster'." The same page happens to work fine when reupload via FTP, looks strage Please do help on this. Do spacecraft in Star Wars produce jet blasts when taking off? It is happening in my production enviroment so I'll use the workaround...

AJAX Programming Tutorials Reply StrongTypes Contributor 6294 Points 5770 Posts ASPInsiders Re: Unable to cast object of type 'ASP.masterpage_master' to type 'ASP.masterpage_master'. Unfortunately the contact information is on a previous page within the thread which is why you might have missed it. This > hotfix may receive additional testing. Please use that method first, but if you have difficulties because of the unpublished KB, please contact me directly at [email protected] and I'll get you the fix.

My usecase is: I have 2 ASCX controls. Reply Magnus K None 0 Points 2 Posts Re: Unable to cast object of type 'ASP.masterpage_master' to type 'ASP.masterpage_master'. All was fine until we needed to programatically change masterpage file, done in the Page_PreInit method. Check This Out It would always show the type as ASP_MyControlName instead of the class name.

Note: If T is, say, a string, the exception is not thrown. No, create an account now. It's more of a nusance to me than anything else.

Do you maybe know, when this bug will be fixed?

Thanks. Reply RyanSmith345 None 0 Points 119 Posts Re: Unable to cast object of type 'ASP.masterpage_master' to type 'ASP.masterpage_master'. Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. The "batch" attribute in the element indicates whether batching is supported.

If anyone has a consistent repro of this issue (with the patch installed), please let us know. As a last ditch effort, I have wrapped the master page within my own namespace, which immediately stopped the problem during compile - we will see if this is long enough So if you use classname (in addition to inherits) just make sure you don't use the same name as the base class. Sometimes hours, sometimes minutes.

Example: or: 2) Add the following section to the configuration file of your application: Note that this second technique will cause all files within a given application to be compiled in Just click the sign up button to choose a username and then you can ask your own questions on the forum. Mar 14, 2006 02:43 PM|JamesChe|LINK Hi all, We now have a fix available for this issue. That way, they can ping me if they need any assistance.

Jun 09, 2006 12:09 PM|juan13|LINK maybe this could help you: in the aspx replace your line <%@ Reference Control="~/SearchAttribute.ascx"%> for this one <%@ Register Src="Incentivo.ascx" TagName="Incentivo" TagPrefix="ucIG" %>

in code to but I need to read up on it first to know exactly what that does. This is how it reads:

I am running Win 2003 SP1 and WSS (Windows SharePoint Services) v3 Beta 1 on my dev machine. If you > want to test this fix please contact, Todd Carter, MCSE, MCSD Senior > Escalation Engineer ASP.NET Escalation Services, Microsoft Corp.

Are the mountains surrounding Mordor natural? See this article. Hit F5, start with debugging The code from step 3 will throw an InvalidCastException. Holidays for Christmas What caused my meringue to fall after adding cocoa?

How would people living in eternal day learn that stars exist? Feb 20, 2006 06:44 AM|Teal'c|LINK I'm getting this error randomly when I try to cast an object stored in a session. Closing/restarting VS cures this for a random period of time. default.aspx Master.PageTitle = "View - Summary"; Master page public string PageTitle { get { return Header1.PageTitle; } set { Header1.PageTitle =

Sue's edream - www.edream.org Reply RogerH Member 30 Points 74 Posts Re: Unable to cast object of type 'ASP.masterpage_master' to type 'ASP.masterpage_master'. asked 4 years ago viewed 1286 times active 3 years ago Blog Stack Overflow Gives Back 2016 Developers, Webmasters, and Ninjas: What’s in a Job Title? Kind of bummed out that this one slipped through the cracks; .net 2.0 seemed pretty damn good up until this point (still is, but you get the idea). How to respond to a ridiculous request from a senior colleague?

Jim Cheshire Senior Escalation Engineer ASP.NET Critical Problem Resolution Team Microsoft Corporation Reply craigw7272 Member 131 Points 201 Posts Re: Unable to cast object of type 'ASP.masterpage_master' to type 'ASP.masterpage_master'.