Error Creating User Control Could Not Load Type
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Failure to load type in ASP.NET? up vote 3 down vote favorite I've got two files in the same directory, an ascx file and an ascx.cs file with a C# class defined inside of it. This is the code in my .ascx file <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Test.ascx.cs" Inherits="SITE.UI.Controls.Test" %> And this is the code in Test.ascx.cs: using System; using System.Web.UI; namespace SITE.UI.Controls { public partial class Test : System.Web.UI.UserControl { } } However whenever I try and build the site I always get this error: Error 1 Could not load type 'SITE.UI.Controls.Test' I'm sure I must be doing something obviously wrong but after over an hour of thrashing I'm getting nowhere . . . c# asp.net code-behind share|improve this question asked Jul 10 '12 at 9:07 Sean Dunwoody 3,76552155 Already tried a rebuild of your solution? –Sllix Jul 10 '12 at 9:13 I've tried rebuilding it multiple times, everytime I get this same error –Sean Dunwoody Jul 10 '12 at 9:15 And a normal build? –Sllix Jul 10 '12 at 9:17 What happens if you add a new user control, the new user control works? –Jupaol Jul 10 '12 at 9:18 Yes, I get the same error. –Sean Dunwoody Jul 10 '12 at 9:18 | show 1 more comment 3 Answers 3 active oldest votes up vote 4 down vote accepted Go into the Web Project properties -> Build settings and change the Output Path to bin\ If that don't work, check this post. Here are a lot of solutions for this problem. Let me know it when it's fixed or not :) share|improve this answer answered Jul 10 '12 at 9:19 Sllix 492424 I editted my answer, try it or check the link. Let me know ;) –Sllix Jul 10 '12 at 9:22 Sorry it took a while for me to get back to you. The issue was that the designer file wasn't generating, I deleted the temp
Support, Site Synchronization, Deployment Options, Security, Scalability Experience Management Personalization, Email Marketing, Mobile, Social Media, Analytics System Integrations Integration Platform, Connector for Salesforce, Connector for Microsoft Dynamics CRM, Connector for Marketo, Connector for SharePoint Digital Commerce Product Catalogs, Multiple Storefronts, Targeted Offers, Payment Processing, Order Management Development Platform Custom Content Types, UI Framework, ASP.NET MVC Support, Visual Studio Support, http://stackoverflow.com/questions/11410021/failure-to-load-type-in-asp-net Comprehensive API Digital Experience Cloud Orchestrate marketing success – track, analyze and shape every step of the customer journey Customer Journey Database Behaviour Tracking, Data Integration, 360° Customer Profile Customer Journey Optimization Audience Segmentation, Predictive Analytics, Campaign Recommendations, Campaign Tracking Customer Journey Analysis Marketing Attribution, http://www.sitefinity.com/developer-network/forums/developing-with-sitefinity/why-my-ascx-custom-cotrol-could-not-load Conversion Tracking, Persona Profiling, Lead Scoring Customer Journey Personalization Predictive Personalization, Persona-Based Targeting Vision What's new? Features list Solutions By Industry Consumer Goods Financial Services Healthcare Associations By Application Sites Management Portals Ecommerce Get in touch with our Sitefinity experts +1-888-365-2779 Contact Us Schedule a demonstration Whitepapers Webinars Blogs Customers Editions Resources Partners DevNet About Your Account Search +1-888-365-2779 Try Now More in this section Forums / Developing with Sitefinity / Why my ASCX custom cotrol could not load? Why my ASCX custom cotrol could not load? Cancel The title field is required! 2 posts, 0 answered rent 104 posts Registered: 05 May 2008 05 Jun 2009 Link to this post Hello All!! I make my ASCX custom control. View of BirthdayList.ascx: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BirthdayList.ascx.cs" Inherits="BirthdayList" %> <%@ Register assembly="Telerik.Web.UI, namespace="Teleri
have created a SubMenu, http://world.episerver.com/Forum/Developer-forum/EPiServer-Relate/Thread-Container/2009/5/New-User-Control--Could-not-load-type-/ however I am getting the error belowServer Error in '/' Application.--------------------------------------------------------------------------------Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. error creating Parser Error Message: Could not load type 'EPiServer.Templates.RelatePlus.UserControls.SubMenu'.Source Error: Line 1: <%@ Control Language="C#" AutoEventWireup="false" CodeBehind="SubMenu.ascx.cs" Inherits="EPiServer.Templates.RelatePlus.UserControls.SubMenu" %>Line 2: Line 3: Source File: /Templates/RelatePlus/UserControls/SubMenu.ascx Line: 1 --------------------------------------------------------------------------------Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 By: Magnus Rahl May 27 2009, 7:41 error creating user It looks like your assembly does not contain your newly created class. Did you rebuild the project? By: Tom Stenius May 27 2009, 20:01 Hi Saar,I would first of all check the namespace of your class SubMenu.cs, the namespace you be EPiServer.Templates.RelatePlus.UserControls and then make sure you have compiled the project.Best regards,Tom By: Saar Paamoni May 27 2009, 21:21 I think the namespace is ok, the build was good too SubMenu.ascx<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="SubMenu.ascx.cs" Inherits="EPiServer.Templates.RelatePlus.UserControls.SubMenu" %>SubMenu.ascx.csnamespace EPiServer.Templates.RelatePlus.UserControls By: Tom Stenius June 1 2009, 16:23 Hi Saar,It's seems like you were using the wrong type of project; Web Site instead of Web Application. Hopefully it will do the trick to change this! //Tom First 1 Last © Episerver 2016 | About Episerver World