Unable to cast object
am 19.04.2007 11:16:01 von daveI 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 and sometimes
not, without making any changes to the code.
Is this a bug concern? Or do you have any advice for this issue?
Here is the error message I get:
Server Error in '/LocalIms' Application.
------------------------------------------------------------ --------------------
Unable to cast object of type 'ASP.masterims_master' to type 'MasterIms'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of
type 'ASP.masterims_master' to type 'MasterIms'.
Source Error:
Line 22: protected void Page_Load(object sender, EventArgs e)
Line 23: {
Line 24: MasterIms master = (MasterIms)this.Master;
Line 25: master.LeftBarPlayerVisibility = false;
Line 26: master.LeftBarSearchVisibility = true;
Source File: c:\Documents and Settings\liors\Desktop\LocalIms\Sm.aspx.cs
Line: 24
Stack Trace:
[InvalidCastException: Unable to cast object of type 'ASP.masterims_master'
to type 'MasterIms'.]
Sm.Page_Load(Object sender, EventArgs e) in c:\Documents and
Settings\liors\Desktop\LocalIms\Sm.aspx.cs:24
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o,
Object t, EventArgs e) +13
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Obje ct sender,
EventArgs e) +45
System.Web.UI.Control.OnLoad(EventArgs e) +80
System.Web.UI.Control.LoadRecursive() +49
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3745
------------------------------------------------------------ --------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42