<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Referencing ASP.NET User Controls in Code-behind</title>
	<atom:link href="http://blog.aaziz.org/referencing-aspnet-user-controls-in-code-behind/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.aaziz.org/referencing-aspnet-user-controls-in-code-behind</link>
	<description>ramblings and opinions of a geek</description>
	<lastBuildDate>Thu, 17 Jun 2010 18:11:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anthony Aziz</title>
		<link>http://blog.aaziz.org/referencing-aspnet-user-controls-in-code-behind/comment-page-1#comment-347</link>
		<dc:creator>Anthony Aziz</dc:creator>
		<pubDate>Tue, 16 Feb 2010 16:59:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.aaziz.org/?p=108#comment-347</guid>
		<description>Waqar, are you referring to Crystal Reports 2008?

On the testing server, delete the Virtual Directory &quot;crystalreportviewers12&quot;. This can be found under:

~\aspnet_client\system_web\2_0_50727\

Then, copy the &quot;crystalreportviewers12&quot; folder from your install directory (something like &quot;C:\Program Files\Business Objects\Common\4.0&quot;) to that directory.

(Before doing this, make sure you install all patches for CR2008).

Let me know if that helps.</description>
		<content:encoded><![CDATA[<p>Waqar, are you referring to Crystal Reports 2008?</p>
<p>On the testing server, delete the Virtual Directory &#8220;crystalreportviewers12&#8243;. This can be found under:</p>
<p>~\aspnet_client\system_web\2_0_50727\</p>
<p>Then, copy the &#8220;crystalreportviewers12&#8243; folder from your install directory (something like &#8220;C:\Program Files\Business Objects\Common\4.0&#8243;) to that directory.</p>
<p>(Before doing this, make sure you install all patches for CR2008).</p>
<p>Let me know if that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: waqar</title>
		<link>http://blog.aaziz.org/referencing-aspnet-user-controls-in-code-behind/comment-page-1#comment-346</link>
		<dc:creator>waqar</dc:creator>
		<pubDate>Tue, 16 Feb 2010 16:39:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.aaziz.org/?p=108#comment-346</guid>
		<description>I have done all the above steps as you mentioned. and it works fine on my development machine.
But when I deploy it on my testing server. My report doesn&#039;t display record, until I goto second page and then back to 1st page or click on any group.

I tried so much but unable to find its solution do any one have face such an issue</description>
		<content:encoded><![CDATA[<p>I have done all the above steps as you mentioned. and it works fine on my development machine.<br />
But when I deploy it on my testing server. My report doesn&#8217;t display record, until I goto second page and then back to 1st page or click on any group.</p>
<p>I tried so much but unable to find its solution do any one have face such an issue</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony Aziz</title>
		<link>http://blog.aaziz.org/referencing-aspnet-user-controls-in-code-behind/comment-page-1#comment-341</link>
		<dc:creator>Anthony Aziz</dc:creator>
		<pubDate>Thu, 28 Jan 2010 00:09:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.aaziz.org/?p=108#comment-341</guid>
		<description>Yes, that might be the only way if you want to avoid the Reference tag in each page. Let me know how it turns out, and if it&#039;s easy to maintain.</description>
		<content:encoded><![CDATA[<p>Yes, that might be the only way if you want to avoid the Reference tag in each page. Let me know how it turns out, and if it&#8217;s easy to maintain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alison</title>
		<link>http://blog.aaziz.org/referencing-aspnet-user-controls-in-code-behind/comment-page-1#comment-340</link>
		<dc:creator>Alison</dc:creator>
		<pubDate>Wed, 27 Jan 2010 22:05:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.aaziz.org/?p=108#comment-340</guid>
		<description>I had previously tried the &quot;add&quot; tags in the web.config but still couldn&#039;t reference the control from the code behind. I might try your suggestion of making it into an assembly and see how that works out.</description>
		<content:encoded><![CDATA[<p>I had previously tried the &#8220;add&#8221; tags in the web.config but still couldn&#8217;t reference the control from the code behind. I might try your suggestion of making it into an assembly and see how that works out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony Aziz</title>
		<link>http://blog.aaziz.org/referencing-aspnet-user-controls-in-code-behind/comment-page-1#comment-339</link>
		<dc:creator>Anthony Aziz</dc:creator>
		<pubDate>Wed, 27 Jan 2010 18:51:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.aaziz.org/?p=108#comment-339</guid>
		<description>Hmm, actually you should be able to!

Check this out:

http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx

This site suggests you should be able to insert

&lt;code&gt;&lt;add tagPrefix=&quot;prefix&quot; src=&quot;~/path/to/Control.ascx&quot; tagName=&quot;TagName&quot;/&gt;&lt;/code&gt;

To your web.config controls node. More search results; http://www.google.ca/search?hl=en&amp;q=how%20to%20globally%20reference%20asp.net%20custom%20controls&amp;meta=</description>
		<content:encoded><![CDATA[<p>Hmm, actually you should be able to!</p>
<p>Check this out:</p>
<p><a href="http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx" rel="nofollow">http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx</a></p>
<p>This site suggests you should be able to insert</p>
<p><code>&lt;add tagPrefix="prefix" src="~/path/to/Control.ascx" tagName="TagName"/&gt;</code></p>
<p>To your web.config controls node. More search results; <a href="http://www.google.ca/search?hl=en&#038;q=how%20to%20globally%20reference%20asp.net%20custom%20controls&#038;meta=" rel="nofollow">http://www.google.ca/search?hl=en&#038;q=how%20to%20globally%20reference%20asp.net%20custom%20controls&#038;meta=</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony Aziz</title>
		<link>http://blog.aaziz.org/referencing-aspnet-user-controls-in-code-behind/comment-page-1#comment-338</link>
		<dc:creator>Anthony Aziz</dc:creator>
		<pubDate>Wed, 27 Jan 2010 18:48:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.aaziz.org/?p=108#comment-338</guid>
		<description>I think you do if you&#039;re just referencing it as a source file. I&#039;m not sure as I haven&#039;t tried this, but if you make it an assembly and add that to your web.config that may work. Check out these pages:

http://msdn.microsoft.com/en-us/library/cc294876.aspx
http://msdn.microsoft.com/en-us/library/cc295210.aspx
http://msdn.microsoft.com/en-us/library/c76dd5k1.aspx

Let me know if you come up with more information, as I&#039;d be interested in the solution. It would be great to have custom controls referenced in one placed and used throughout the application, without having to copy an assembly.</description>
		<content:encoded><![CDATA[<p>I think you do if you&#8217;re just referencing it as a source file. I&#8217;m not sure as I haven&#8217;t tried this, but if you make it an assembly and add that to your web.config that may work. Check out these pages:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/cc294876.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/cc294876.aspx</a><br />
<a href="http://msdn.microsoft.com/en-us/library/cc295210.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/cc295210.aspx</a><br />
<a href="http://msdn.microsoft.com/en-us/library/c76dd5k1.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/c76dd5k1.aspx</a></p>
<p>Let me know if you come up with more information, as I&#8217;d be interested in the solution. It would be great to have custom controls referenced in one placed and used throughout the application, without having to copy an assembly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alison</title>
		<link>http://blog.aaziz.org/referencing-aspnet-user-controls-in-code-behind/comment-page-1#comment-337</link>
		<dc:creator>Alison</dc:creator>
		<pubDate>Wed, 27 Jan 2010 18:23:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.aaziz.org/?p=108#comment-337</guid>
		<description>Does the aspx page who adds the user control from the code behind need the @Reference tag? I&#039;ve been reading that there are ways to register a user control in the web.config but have not been able to get this to work. 

Have you been able to find a way to centralize all of the user control references in the web.config so that they don&#039;t have to be repeated in each aspx file that loads and adds the controls programmatically?</description>
		<content:encoded><![CDATA[<p>Does the aspx page who adds the user control from the code behind need the @Reference tag? I&#8217;ve been reading that there are ways to register a user control in the web.config but have not been able to get this to work. </p>
<p>Have you been able to find a way to centralize all of the user control references in the web.config so that they don&#8217;t have to be repeated in each aspx file that loads and adds the controls programmatically?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aziz</title>
		<link>http://blog.aaziz.org/referencing-aspnet-user-controls-in-code-behind/comment-page-1#comment-220</link>
		<dc:creator>Aziz</dc:creator>
		<pubDate>Mon, 27 Jul 2009 12:43:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.aaziz.org/?p=108#comment-220</guid>
		<description>Interesting question. I&#039;m actually not sure if this is possible. Try importing the namespace &quot;ASP&quot; and see if the class is in there (if the UserControl has a ClassName tag in it&#039;s @Control directive, it will be that, otherwise it will be the name of the partial class).

I don&#039;t know if that will work because the ASP namespace only contained Referenced classes in the examples I dealt with, but I wasn&#039;t working with custom controls at all.

Your last resort would be to create an interface for each UserControl you want to use, specifying all the public properties/methods you want to call. Then have the UserControl reference that in an @Implements directive (if I remember correctly). You can then load that UserControl and reference it as that interface. Make sure you&#039;re using the LoadControl(string) method to initialize dynamic controls, and &lt;i&gt;NOT&lt;/i&gt; calling the constructor.

Let me know if you need more help or examples.</description>
		<content:encoded><![CDATA[<p>Interesting question. I&#8217;m actually not sure if this is possible. Try importing the namespace &#8220;ASP&#8221; and see if the class is in there (if the UserControl has a ClassName tag in it&#8217;s @Control directive, it will be that, otherwise it will be the name of the partial class).</p>
<p>I don&#8217;t know if that will work because the ASP namespace only contained Referenced classes in the examples I dealt with, but I wasn&#8217;t working with custom controls at all.</p>
<p>Your last resort would be to create an interface for each UserControl you want to use, specifying all the public properties/methods you want to call. Then have the UserControl reference that in an @Implements directive (if I remember correctly). You can then load that UserControl and reference it as that interface. Make sure you&#8217;re using the LoadControl(string) method to initialize dynamic controls, and <i>NOT</i> calling the constructor.</p>
<p>Let me know if you need more help or examples.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://blog.aaziz.org/referencing-aspnet-user-controls-in-code-behind/comment-page-1#comment-219</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Mon, 27 Jul 2009 07:57:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.aaziz.org/?p=108#comment-219</guid>
		<description>Hi Aziz,

this is interesting post that you have made. I have similiar but little different problem with referencing user control and I&#039;d like to ask you if you have encountered it and solved it. I have some user control and I&#039;d like to use it in custom control. Custom control is just C# code - no markup, so I can&#039;t use Reference tag as you did in your post. Is there any possibility to use user control in custom control? I am searching the web for the solution for quite a while now but without success. Thank you for reply in advance.</description>
		<content:encoded><![CDATA[<p>Hi Aziz,</p>
<p>this is interesting post that you have made. I have similiar but little different problem with referencing user control and I&#8217;d like to ask you if you have encountered it and solved it. I have some user control and I&#8217;d like to use it in custom control. Custom control is just C# code &#8211; no markup, so I can&#8217;t use Reference tag as you did in your post. Is there any possibility to use user control in custom control? I am searching the web for the solution for quite a while now but without success. Thank you for reply in advance.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
