Ich habe eine Website, die mithilfe von asp.net erstellt wird.Kann Objekt des Typs 'ASP.MyControlName_ascx' nicht umwandeln, um 'MyControlName' einzugeben
In meinem lokalen PC funktioniert das gut. Aber nachdem ich diese auf dem Server bereitstellen hätte folgend ich Fehler msg, wenn ich auf eine Seite zu gehen versuchen
--Data--System.Collections.ListDictionaryInternal--Base Exception--System.InvalidCastException: Unable to cast object of type 'ASP.uc_eventmanagment_skill_skillbind_ascx' to type 'HRMS.uc.Skill.SkillBind'.
at HRMS.Task.LoadAdminPanels(String page)
at HRMS.Task.Page_Load(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)--Inner Exception--System.InvalidCastException: Unable to cast object of type 'ASP.uc_eventmanagment_skill_skillbind_ascx' to type 'HRMS.uc.Skill.SkillBind'.
at HRMS.Task.LoadAdminPanels(String page)
at HRMS.Task.Page_Load(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)--Source--System.Web--StackTrace-- at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
auf die ASCX-Datei zu laden ich diesen Code verwenden
SkillBind SkillBind = (SkillBind)LoadControl("/uc/EventManagment/Skill/SkillBind.ascx");
SkillBind.ID = "SkillBind";
pHolderContainer.Controls.Add(SkillBind);
Was ist falsch?
Haben Sie 'Page.LoadControl' mit' skillbind' ASCX Steuerung zu laden? Weitere Details anzeigen, einschließlich ASCX & ASPX-Seitenmarkierungen mit Code dahinter. –
@TetsuyaYamamoto Hallo Freund aktualisiert die Frage –