<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx</link><description>This article applies to ASP.NET 2.0 and Visual Studio 2005. Background Since its early days, ASP.NET has always supported two different ways of authoring server controls: Custom Controls : these are controls written from scratch exclusively using code.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#487168</link><pubDate>Mon, 31 Oct 2005 10:28:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:487168</guid><dc:creator>Steinar Herland</dc:creator><description>Thanks for the nice article. K. Scott Allen wrote something similar at &lt;br&gt;&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://odetocode.com/Blogs/scott/archive/2005/10/06/2326.aspx"&gt;http://odetocode.com/Blogs/scott/archive/2005/10/06/2326.aspx&lt;/a&gt;  &lt;br&gt;&lt;br&gt;He also enhanced the msbuild-file to use ilmerge to merge all the dll's.&lt;br&gt;Maybe the tool released by the ASP.NET team will be even more powerful?</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#498033</link><pubDate>Wed, 30 Nov 2005 00:16:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:498033</guid><dc:creator>davidebb</dc:creator><description>Steinar, the tool I was referring to is actually available now in beta form, and is called &amp;quot;Visual Studio 2005 Web Deployment Projects&amp;quot;.  More specifically, it contains a tool named aspnet_merge.exe.  Here is the link:&lt;br&gt;&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx"&gt;http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;It's probably the same general idea as the link your comment points to.</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#522889</link><pubDate>Thu, 02 Feb 2006 09:57:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:522889</guid><dc:creator>Michel</dc:creator><description>Hi,&lt;br/&gt;&lt;br/&gt;Just made a UserControl with three objects (calendar, textbox, button),&lt;br/&gt;a public method and property. Nothing fancy; just a 'stupid' User&lt;br/&gt;Control. The control appears on my test aspx page.&lt;br/&gt;Compiled it in such a way that Visual Studio 2005 generates an assembly&lt;br/&gt;for the User Control, as described in your article.&lt;br/&gt;&lt;br/&gt;After that I added a reference to this assembly in another solution.&lt;br/&gt;There I can reference to my User Control without any problems.&lt;br/&gt;After running the page with this UserControl the control is not&lt;br/&gt;appearing. Method and property of the User Control work fine.&lt;br/&gt;However the values for the three child objects are null. For that&lt;br/&gt;reason of course I can't see the control.&lt;br/&gt;But why are these controls null?&lt;br/&gt;Any idea?&lt;br/&gt;&lt;br/&gt;Kind regards,&lt;br/&gt;&lt;br/&gt;Michel </description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#527484</link><pubDate>Wed, 08 Feb 2006 15:44:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:527484</guid><dc:creator>Maahee</dc:creator><description>Hi Michel,&lt;br /&gt;&lt;br /&gt;I am facing the same problem as u described.&lt;br /&gt;Did u find any work around? If yes then Please post here.&lt;br /&gt;&lt;br /&gt;Thanks and Regards,&lt;br /&gt;Maahee</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#527542</link><pubDate>Wed, 08 Feb 2006 17:08:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:527542</guid><dc:creator>Richard Cresswell</dc:creator><description>Having the same problem, please let me know if a fix is found!</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#527543</link><pubDate>Wed, 08 Feb 2006 17:08:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:527543</guid><dc:creator>Swati</dc:creator><description>I have created the same.&lt;br /&gt;Created a user control and generated its dll -the assembly after using Publish Web Site command.&lt;br /&gt;Then I am using this dll and its user control.&lt;br /&gt;I have used the register tag in My test project as given in this article but that gives me the error as User control not found inspite of adding reference of the dll .&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;Swati&lt;br /&gt;</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#537208</link><pubDate>Wed, 22 Feb 2006 23:16:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:537208</guid><dc:creator>Bryant</dc:creator><description>Hi David,&lt;br&gt;&lt;br&gt;I know you posted this a while back but I have just started playing with this (it solves a problem we have quite nicely).&lt;br&gt;&lt;br&gt;One issue that I have come across is that if you place the compiled UserControl into another UserControl (rather than onto a web page), when you view the web page (that contains the second, uncompiled, user control)at design-time, the UserControl is rendered with an error (&amp;quot;Object Reference not set to an instance of an object&amp;quot;).&lt;br&gt;&lt;br&gt;This doesn't affect the runtime behaviour (which renders/runs everything correctly) but it does look a little messy at design-time.&lt;br&gt;&lt;br&gt;This is nothing I can't live with (just means the uncompiled UserControl is basically rendered how it used to be - no UI) but I wondered if the team is planning on improving the design-time experience of a compiled usercontrol (both this as well as the fact that the compiled UserControl doesn't render it's UI when placed onto a page and you can't put a compiled usercontrol into the Toolbox)?</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#574961</link><pubDate>Wed, 12 Apr 2006 17:34:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:574961</guid><dc:creator>Orlin Georgiev</dc:creator><description>Hi! This post is specially for Michel, Maahee and Swati, in case they haven't figured their problem out meanwhile. I too created an user control with some basic server controls in it (a textbox, a label and a button) and it didn't show up. So I dissasembled the asembly of the custom controls to see what's wrong. As weird as it may sound but it seems that even in .NET 2.0 the inline code actually becomes a derived class of the code-behind (as was the case in 1.1) and NOT a single class comprised of two partial classes. So by registering the custom control with a &amp;lt;%@ Register TagPrefix=&amp;quot;Acme&amp;quot; Namespace=&amp;quot;Acme&amp;quot; Assembly=&amp;quot;App_Web_mytestuc.ascx.cdcab7d2&amp;quot; %&amp;gt; and a &amp;lt;Acme:MyTestUC id=&amp;quot;MyUC&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt; directive you actually invoke the base and not the derived class. To really invoke the rendering (derived) class ypu should. The solution is to use &amp;lt;%@ Register TagPrefix=&amp;quot;Acme&amp;quot; Namespace=&amp;quot;ASP&amp;quot; Assembly=&amp;quot;App_Web_mytestuc.ascx.cdcab7d2&amp;quot; %&amp;gt; and &amp;lt;Acme:mytestuc_ascx id=&amp;quot;MyUC&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt; or something like that, depending on the name of your UC. If you still don't get it, dissasemble the custom control and you'll see what I mean. &lt;br&gt;Kind regards,&lt;br&gt;Orlin</description></item><item><title>ASP.NET 2.0 - one month on</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#588641</link><pubDate>Tue, 02 May 2006 23:50:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:588641</guid><dc:creator>Ian Nelson</dc:creator><description>It's over a month now since Visual Studio 2005 officially RTM'd, and during that time I've been fortunate...</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#606071</link><pubDate>Wed, 24 May 2006 18:56:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:606071</guid><dc:creator>Anuj</dc:creator><description>Hi ! Thanks Orlin the soluation you told its working cool I have another question while I am compiling my program it is given me this error :&lt;br&gt;&lt;br&gt;: CS0115: 'ASP.default_aspx.GetTypeHashCode()': no suitable method found to override&lt;br&gt;&lt;br&gt;Source Error:&lt;br&gt;&lt;br&gt;[No Relevant source lines]&lt;br&gt;&lt;br&gt;DO u have any idea why it is so...&lt;br&gt;&lt;br&gt;Thanks &lt;br&gt;Anuj&lt;br&gt;</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#606089</link><pubDate>Wed, 24 May 2006 19:12:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:606089</guid><dc:creator>davidebb</dc:creator><description>Anuj,&lt;br&gt;&lt;br&gt;Have you tried following the steps exactly as outlines in the article? &amp;nbsp;Orlin's comment only applies if you are doing something different from the steps. &amp;nbsp;Specifically, make sure you are properly setting the classname attribute as explained in Step 1.&lt;br&gt;&lt;br&gt;thanks,&lt;br&gt;David</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#614202</link><pubDate>Fri, 02 Jun 2006 16:15:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:614202</guid><dc:creator>Phcyso</dc:creator><description>Hi David,&lt;br&gt;&lt;br&gt; &amp;nbsp; Thanks for this great article. I was facing the same problem as described by Michel. I made sure that I am properly setting the classname attribute as explained in Step 1, and everything worked fine, BUT ONLY IF I USE INLINE CODE.&lt;br&gt;&lt;br&gt; &amp;nbsp; I want to use code-behind model, but I am not able to get that to work. When I add the &amp;quot;ClassName&amp;quot; attribute, I get the following error; -&lt;br&gt;&lt;br&gt; &amp;nbsp;&amp;quot;Missing partial modifier on declaration of type 'Acme.MyTestUC'; another partial declaration of this type exists....c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ui\a00a88f8\c67bcb51\App_Web_nuzxcasf.0.cs	138&amp;quot;&lt;br&gt;&lt;br&gt; &amp;nbsp;Kindly help. I am stuck :(&lt;br&gt;&lt;br&gt;Thanks.&lt;br&gt;</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#615034</link><pubDate>Sat, 03 Jun 2006 00:54:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:615034</guid><dc:creator>davidebb</dc:creator><description>Phcyso,&lt;br&gt;&lt;br&gt;This hsould work fine with the code behind model. &amp;nbsp;Make sure your code behind ascx looks something like this:&lt;br&gt;&lt;br&gt;&amp;lt;%@ Control Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeFile=&amp;quot;CodeBesideControl.ascx.cs&amp;quot;&lt;br&gt;Inherits=&amp;quot;Acme.CodeBesideControl&amp;quot; ClassName=&amp;quot;Acme.MyCodeBesideControl&amp;quot; %&amp;gt;&lt;br&gt;&lt;br&gt;and that the ascx.cs defines the matching partial class in the same namespace.&lt;br&gt;&lt;br&gt;David</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#654701</link><pubDate>Mon, 03 Jul 2006 00:50:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:654701</guid><dc:creator>Dave</dc:creator><description>I've been trying this method. No success yet. Can you guys post a sample here?&lt;br&gt;&lt;br&gt;Thanks.</description></item><item><title>Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#666433</link><pubDate>Sat, 15 Jul 2006 08:48:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:666433</guid><dc:creator>Keyvan Nayyeri</dc:creator><description>David Ebbo has written an article about Turning an ascx user control into a redistributable custom control.The</description></item><item><title>Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#667127</link><pubDate>Sun, 16 Jul 2006 09:57:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:667127</guid><dc:creator>Keyvan Nayyeri</dc:creator><description>David Ebbo has written an article about Turning an ascx user control into a redistributable custom control.The</description></item><item><title>OK, Now how do you rename without breaking it.</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#670229</link><pubDate>Wed, 19 Jul 2006 01:11:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:670229</guid><dc:creator>Jared McGuire</dc:creator><description>I have a control: App_Web_simplecontrol.ascx.cdcab7d2.dll&lt;br&gt;&lt;br&gt;I like to distribute it as simplecontrol.dll. but simpley renaming and replacing App_Web_simplecontrol.ascx.cdcab7d2 with simplecontrol on code doesn't work.&lt;br&gt;&lt;br&gt;Any suggestions?</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#670241</link><pubDate>Wed, 19 Jul 2006 01:23:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:670241</guid><dc:creator>davidebb</dc:creator><description>Jared, I think you should be able to use ILMerge (available on MSDN) to do this. You could also use it to package multiple controls into one DLL.&lt;br&gt;&lt;br&gt;David</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#672743</link><pubDate>Thu, 20 Jul 2006 17:39:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:672743</guid><dc:creator>Jared McGuire</dc:creator><description>I got the web deployment project to do it for me. This also lets me have multiple asxc files.&lt;br&gt;&lt;br&gt;Now I have a new issue:&lt;br&gt;I can add the dll reference and manually add the register command and controls to the html. I would like to add this dll to the toolbox so that I can simply drag my controls to the form and have the reference, register, and html auto added, like other custom controls do. However the toolbox tells me that &amp;quot;there are no components that it can place in the toolbox&amp;quot;.&lt;br&gt;&lt;br&gt;Once this works then I will be golden!</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#742654</link><pubDate>Wed, 06 Sep 2006 15:56:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:742654</guid><dc:creator>Toni Bailon</dc:creator><description>Has anyone been able to drag and drop the created control from the toolbox?</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#742658</link><pubDate>Wed, 06 Sep 2006 16:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:742658</guid><dc:creator>Toni</dc:creator><description>It's very useful, but is it possible to see the control inserted in a form?&lt;br&gt;&lt;br&gt;Is it possible to see it at design time, like any other web control?</description></item><item><title>ASP.NET 2.0 - one month on</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1206284</link><pubDate>Mon, 04 Dec 2006 20:02:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1206284</guid><dc:creator>Ian Nelson</dc:creator><description>&lt;p&gt;It's over a month now since Visual Studio 2005 officially RTM'd, and during that time I've been fortunate&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1604079</link><pubDate>Mon, 05 Feb 2007 15:39:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1604079</guid><dc:creator>Ricardo Gomes</dc:creator><description>&lt;p&gt;Hi there, I'm having some problems. I've done a web user control with a textbox wich i'll want to access from a page.&lt;/p&gt;
&lt;p&gt;(Code .ascx)&lt;/p&gt;
&lt;p&gt;&amp;lt;%@ Control Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeFile=&amp;quot;MFComment.ascx.cs&amp;quot; Inherits=&amp;quot;MF.MFComment&amp;quot; %&amp;gt;&lt;/p&gt;
&lt;p&gt;...(my code)....&lt;/p&gt;
&lt;p&gt;(Code .ascx.cs)&lt;/p&gt;
&lt;p&gt;namespace MF&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public partial class MFComment : System.Web.UI.UserControl&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt;...(my code)...&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;- If I use the attribute ClassName inside the Control directive I get the following error:&lt;/p&gt;
&lt;p&gt;Missing partial modifier on declaration of type 'MF.MFComment'; another partial declaration of this type exists	c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\distributeascxcontrol\29b825f5\aaee677f\App_Web_wgindfuh.0.cs	138	&lt;/p&gt;
&lt;p&gt;When I publish the control (without the ClassName) everything goes well.&lt;/p&gt;
&lt;p&gt;The problem begins when I want to use the published assembly.&lt;/p&gt;
&lt;p&gt;I register the control and declare it on my page but i'm cannot see it when i run the page. I can access the control and it's properties from the page code behind but when I test my page the control does not appear.&lt;/p&gt;
&lt;p&gt;(Code Page .aspx)&lt;/p&gt;
&lt;p&gt;&amp;lt;%@ Register TagPrefix=&amp;quot;MF&amp;quot; Namespace=&amp;quot;MF&amp;quot; Assembly=&amp;quot;App_Web_mfcomment.ascx.cdcab7d2&amp;quot; %&amp;gt; &lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;&amp;lt;MF:MFComment ID=&amp;quot;myctl&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;Can anyone explain me what can be the problem and how to solve it?&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1628932</link><pubDate>Thu, 08 Feb 2007 21:48:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1628932</guid><dc:creator>Mark Kamoski</dc:creator><description>&lt;p&gt;This works great.&lt;/p&gt;
&lt;p&gt;I had some trouble getting the compile-and-deploy to work using the 2-file method (code-infront and code-behind). The problem was that the control was not showing up on the page at all. It might have been a issue with the namepaces, casing, or something like that. I switched to the 1-file method and it worked fine. GEFN. I will refactor later if necessary.&lt;/p&gt;
&lt;p&gt;Thank you VERY much.&lt;/p&gt;
&lt;p&gt;-- Mark Kamoski&lt;/p&gt;</description></item><item><title>Cannot dynamically created control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1678232</link><pubDate>Wed, 14 Feb 2007 23:12:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1678232</guid><dc:creator>sheirali</dc:creator><description>&lt;p&gt;Hello David,&lt;/p&gt;
&lt;p&gt;I followed the steps that were shown, and for the most part, it is working. &lt;/p&gt;
&lt;p&gt;In my usercontrol (example, NumericTextBoxControl) which wraps a normal TextBox web control, I exposed the embedded TextBox as a property (only Get).&lt;/p&gt;
&lt;p&gt;I am now able to use the dlls that the Publish website created within another web site project’s ascx files by registering the dll and using the control within the HTML of my ascx pages. &lt;/p&gt;
&lt;p&gt;However I want to create an instance of this control in a code-behind. &lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NumericTextBoxControl txtNum = new NumericTextBoxControl();&lt;/p&gt;
&lt;p&gt;But when I tried to reference the embedded TextBox via the exposed Get Property, the property is returning Null.&lt;/p&gt;
&lt;p&gt;If using the control in an html page (.aspx), it works and from the code-behind, I can access the Get Property to get to the embedded TextBox.&lt;/p&gt;
&lt;p&gt;How can I do a &amp;quot;new&amp;quot; in code-behind and have the Get Property not return Null???&lt;/p&gt;
&lt;p&gt;Do you have any advice? Or solution?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Sheir&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1678319</link><pubDate>Wed, 14 Feb 2007 23:38:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1678319</guid><dc:creator>David Ebbo</dc:creator><description>&lt;p&gt;Hi Sheir,&lt;/p&gt;
&lt;p&gt;Instead of directly instantiating your control, try calling page.LoadControl(typeof(YourControlType), null). &amp;nbsp;This should do the proper initialization that will make it work.&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1685338</link><pubDate>Thu, 15 Feb 2007 22:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1685338</guid><dc:creator>Mark Kamoski</dc:creator><description>&lt;p&gt;David -- Please help. I have been using this technique and it works just fine as long as the User Control is a 1-file control, with inline code. As soon as I try to use a 2-file control (with both code-infront and code-behind) it does not work-- the UI cannot be seen at all when the resulting server control is used on an ASPX page. I have tried stating both classname=&amp;quot;MyNamespace.MyClassName&amp;quot; and inherits=&amp;quot;MyNamespace.MyClassName&amp;quot; in the &amp;lt;@control directive (as you mentioned in a post above) but when I do that I get a compile-time-error of &amp;quot;Missing partial modifier on declaration of type 'MyNamespace.MyClassName'; another partial declaration of this type exists&amp;quot;. Can you give any more advice concerning how to make this work with the code-behind coding method in the User Control?&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1685393</link><pubDate>Thu, 15 Feb 2007 22:34:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1685393</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Hi Mark,&lt;/p&gt;
&lt;p&gt;You need to use a different class name for the inherits (which is the base class), and the classname attribute (which becomes a derived class). &amp;nbsp;Then make sure you always use the 'classname' class when you use it (just like in the inline mode).&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1689774</link><pubDate>Fri, 16 Feb 2007 20:20:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1689774</guid><dc:creator>Mark Kamoski</dc:creator><description>&lt;p&gt;David -- I appreciate the extra assistance regarding using the classname and inherits attributes of the @Control directive. Your advice works like a charm. BTW, I have been using this method to create stand alone Server Controls. After than, I create a wrapper around those Server Controls to make them into WebPart Controls for use in SharePoint 2007 and plain old ASP.NET sites. The whole process is now VERY simple and fast thanks to your great tip here. Thank you very much. -- Mark Kamoski&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1692018</link><pubDate>Sat, 17 Feb 2007 03:01:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1692018</guid><dc:creator>Jon A</dc:creator><description>&lt;p&gt;Anybody having problems with Namespace?&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1707777</link><pubDate>Sun, 18 Feb 2007 23:25:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1707777</guid><dc:creator>Jonathan Langley</dc:creator><description>&lt;p&gt;David -- Thanks for your post, the inheritance issues is blindingly obvious once you realise it. Great catch.&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1754350</link><pubDate>Sun, 25 Feb 2007 01:10:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1754350</guid><dc:creator>David Neely</dc:creator><description>&lt;p&gt;Has anyone been able to get these controls to be accessible from the toolbox? If we could do that this would be a 100% solution. Thanks much--&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1755707</link><pubDate>Sun, 25 Feb 2007 07:25:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1755707</guid><dc:creator>David Neely</dc:creator><description>&lt;p&gt;One more issue. When I reference the dll as a private assembly, intellisense works fine. However, if I register the assembly in the GAC and reference it from there, the code still works fine however I get no intellisense and I get compiler warnings for the control name (i.e. the red squiggly with a message saying that this is not a known element). Any thoughts?&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1763654</link><pubDate>Mon, 26 Feb 2007 18:37:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1763654</guid><dc:creator>Darryl</dc:creator><description>&lt;p&gt;I would like to use a custom control built with this method in another user control. No problem adding my custom control to a page. No problem adding my custom control to a new user control BUT when I add that new user control to a page I get &amp;quot;error rendering control - object not set to an instance of an object&amp;quot;. Anyone seen this? Any ideers how to resolve?&lt;/p&gt;
&lt;p&gt;tia&lt;/p&gt;
&lt;p&gt;Darryl&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1765611</link><pubDate>Tue, 27 Feb 2007 00:02:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1765611</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Hi Darryl,&lt;/p&gt;
&lt;p&gt;Is this an error that you see at design time in VS, or at runtime in the browser? &amp;nbsp;I would think that it should work fine at runtime, though there may be design time issues (some previous comments refer to this).&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1768169</link><pubDate>Tue, 27 Feb 2007 13:07:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1768169</guid><dc:creator>Anand</dc:creator><description>&lt;p&gt;Hi Darryl,&lt;/p&gt;
&lt;p&gt;I too got the error 'Object reference not set to an object&amp;quot;. I used 2 separate files for code and design. But when I remove the code inside Page_Load event of user control, it worked fine. If I put any code to access any control inside user control, I got the above error. &lt;/p&gt;
&lt;p&gt;Later I fixed the problem. As it was discussed by David, I need to specify a different name for our user control. But I do not have clear knowledge. David, Can you please explain us a bit on this? Thanks for an interesting and useful article.&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#1819642</link><pubDate>Tue, 06 Mar 2007 23:31:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1819642</guid><dc:creator>DarylR</dc:creator><description>&lt;p&gt;Can someone post a complete working sample USING CODE_BEHIND (source, VS solutions, test app, EVERYTHING!)? I'm trying various combinations (starting with instructions in the orginal post) and I am still getting NULL references exceptions for the child controls of the UserControl (.ascx) when I reference them in the Page_Load event of the UserControl. I'm missing something. Could the language have anything to do with it? I'm using VB iso C#. &lt;/p&gt;
&lt;p&gt;HELP!&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#2079948</link><pubDate>Wed, 11 Apr 2007 04:32:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2079948</guid><dc:creator>GaneshThennavan</dc:creator><description>&lt;p&gt;Hi david,&lt;/p&gt;
&lt;p&gt;Is there a way to put the usercontrol into the toolbox and make it developer world easy ??&lt;/p&gt;
&lt;p&gt;pls do let me know.&lt;/p&gt;
&lt;p&gt;and has anyone tried it refrencing it to toolbox????&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#2953526</link><pubDate>Tue, 29 May 2007 01:37:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2953526</guid><dc:creator>Song Yuan</dc:creator><description>&lt;p&gt;I think user option 1 + Web Deployment project is the best way&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#3052658</link><pubDate>Sun, 03 Jun 2007 04:24:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3052658</guid><dc:creator>NAIDU</dc:creator><description>&lt;p&gt;Is there any way to convert the usercontrol in a Web Application project into redistributable custom control&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#3072541</link><pubDate>Mon, 04 Jun 2007 07:43:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3072541</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Yes, it should work essentially the same way in a Web Application Project. &amp;nbsp;The only difference is that the app's DLL (the one VS puts in 'bin') will need to be included as well.&lt;/p&gt;
</description></item><item><title>Turning off render of a user control in design of the parent page</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#3267860</link><pubDate>Wed, 13 Jun 2007 15:19:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3267860</guid><dc:creator>Mike Jones</dc:creator><description>&lt;p&gt;Does anybody know how to turn of the render of a user control in the parent page. It is a pain when using lots of user controls and you are unsure what is on what page. &amp;nbsp;So in other words to make it like it was in VS 2003 with a little grey box.&lt;/p&gt;
</description></item><item><title>How to Register User Controls and Custom Controls in Web.config </title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#4158780</link><pubDate>Wed, 01 Aug 2007 05:35:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4158780</guid><dc:creator>WebServices</dc:creator><description>&lt;p&gt;Tip/Trick:HowtoRegisterUserControlsandCustomControlsinWeb.config I'vebeen&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#4595178</link><pubDate>Mon, 27 Aug 2007 21:01:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4595178</guid><dc:creator>Panchams</dc:creator><description>&lt;p&gt;Hi david,&lt;/p&gt;
&lt;p&gt;After converting the user control to custom control,is there any way to include this into toolbox?&lt;/p&gt;
&lt;p&gt;Any help will be appreciated.&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#4632441</link><pubDate>Wed, 29 Aug 2007 21:52:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4632441</guid><dc:creator>Panchams</dc:creator><description>&lt;p&gt;Is there any body who can help me in below.&lt;/p&gt;
&lt;p&gt;After converting the user control to custom control,is there any way to include this into toolbox and drag and drop on any asp.net page?&lt;/p&gt;
&lt;p&gt;Any help will be appreciated.&lt;/p&gt;
</description></item><item><title>re: Turning an ascx user control into a redistributable custom control</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#4722521</link><pubDate>Mon, 03 Sep 2007 14:51:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4722521</guid><dc:creator>Preethi</dc:creator><description>&lt;p&gt;Can anyone helpme,&lt;/p&gt;
&lt;p&gt;I tried this procedure for creating custom control.But while complation,i am getting the follwing error:&lt;/p&gt;
&lt;p&gt; Could not load file or assembly 'App_Web_webusercontrol.ascx.cdcab7d2.dll' or one of its dependencies. The system cannot find the file specified.	&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Preethi&lt;/p&gt;
</description></item><item><title>MCPD 70-547: Creando y seleccionando Controles</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#6246449</link><pubDate>Thu, 15 Nov 2007 10:10:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6246449</guid><dc:creator>SergioTarrillo's RichWeblog</dc:creator><description>&lt;p&gt;Damos inicio a la serie de post, basados en los temas de preparaci&amp;#243;n para el examen 70-547 . Si eres&lt;/p&gt;
</description></item><item><title>DotNetNuke modules with Vis. Web Devel. 2008 Express | keyongtech</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#9338417</link><pubDate>Sun, 18 Jan 2009 20:32:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9338417</guid><dc:creator>DotNetNuke modules with Vis. Web Devel. 2008 Express | keyongtech</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.keyongtech.com/554064-dotnetnuke-modules-with-vis-web"&gt;http://www.keyongtech.com/554064-dotnetnuke-modules-with-vis-web&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Tagz | &amp;quot;David Ebbo&amp;#39;s ASP.NET blog : Turning an ascx user control into a redistributable custom control&amp;quot; | Comments</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#9623323</link><pubDate>Sat, 16 May 2009 20:12:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9623323</guid><dc:creator> Tagz | &amp;quot;David Ebbo&amp;#39;s ASP.NET blog : Turning an ascx user control into a redistributable custom control&amp;quot; | Comments</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://tagz.in/posts/23f/comments/"&gt;http://tagz.in/posts/23f/comments/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Misfit Geek Podcast</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#9647054</link><pubDate>Thu, 28 May 2009 15:41:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9647054</guid><dc:creator>Misfit Geek</dc:creator><description>&lt;p&gt;Click to Play Download the Current Episode MP3 WMA WMA (LoRes) ACC Episode #1 - Scott Hunter on the future of ASP.NET Development with Web Forms Scott Hunter is a Senior Program Manager Lead on the ASP.NET Team and, along with his team drives much of&lt;/p&gt;
</description></item><item><title>Episode #1 - Scott Hunter on the Future of Web Forms</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#9647080</link><pubDate>Thu, 28 May 2009 15:51:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9647080</guid><dc:creator>Misfit Geek</dc:creator><description>&lt;p&gt;Click to Play Download the Current Episode MP3 WMA WMA (LoRes) ACC Episode #1 - Scott Hunter on the future of ASP.NET Development with Web Forms Scott Hunter is a Senior Program Manager Lead on the ASP.NET Team and, along with his team drives much of&lt;/p&gt;
</description></item><item><title> David Ebbo s blog Turning an ascx user control into a redistributable | Paid Surveys</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#9656833</link><pubDate>Fri, 29 May 2009 22:55:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9656833</guid><dc:creator> David Ebbo s blog Turning an ascx user control into a redistributable | Paid Surveys</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://paidsurveyshub.info/story.php?title=david-ebbo-s-blog-turning-an-ascx-user-control-into-a-redistributable"&gt;http://paidsurveyshub.info/story.php?title=david-ebbo-s-blog-turning-an-ascx-user-control-into-a-redistributable&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> David Ebbo s blog Turning an ascx user control into a redistributable | Cellulite Creams</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#9720640</link><pubDate>Wed, 10 Jun 2009 04:37:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9720640</guid><dc:creator> David Ebbo s blog Turning an ascx user control into a redistributable | Cellulite Creams</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://cellulitecreamsite.info/story.php?id=4239"&gt;http://cellulitecreamsite.info/story.php?id=4239&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> David Ebbo s blog Turning an ascx user control into a redistributable | debt solutions</title><link>http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx#9791174</link><pubDate>Fri, 19 Jun 2009 20:44:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9791174</guid><dc:creator> David Ebbo s blog Turning an ascx user control into a redistributable | debt solutions</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://debtsolutionsnow.info/story.php?id=13232"&gt;http://debtsolutionsnow.info/story.php?id=13232&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>