<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/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>Chris Moseley on Web Development</title><link>http://weblogs.asp.net/chrismoseley/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Shared assemblies, without the GAC</title><link>http://weblogs.asp.net/chrismoseley/archive/2008/10/28/shared-assemblies-without-the-gac.aspx</link><pubDate>Tue, 28 Oct 2008 22:08:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6708747</guid><dc:creator>cjmos</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/chrismoseley/rsscomments.aspx?PostID=6708747</wfw:commentRss><comments>http://weblogs.asp.net/chrismoseley/archive/2008/10/28/shared-assemblies-without-the-gac.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;One of the projects I've been working on recently required each of our web applications to have their own IIS websites and bespoke files (master pages, images, styles etc.) but also each have access to a shared code library which would reside in a central location on the server. Dealing with the shared UI layer (pages, controls etc) was easy, we could just set up a virtual directory in IIS 'SharedCode' and point it to the central location. Dealing with the assemblies generated from our shared code library (C#) projects and having them reside in a central location, outside of each application however, was not so straight forward.&lt;/P&gt;
&lt;P&gt;The usual way to achieve this would be to put these shared assemblies into the global assembly cache (GAC). However, for this particular project, the GAC wasn't such a viable option. There are many benefits in using the GAC (proper version control is an absolute must in some cases) but there are also a number of reasons why adding assemblies to the GAC may not be viable or sensible for your particular project, the main reasons that affected us were:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Some of the assemblies referenced other third-party, closed-source assemblies which were not signed with a strong name.&lt;/B&gt; - In order to add any assembly to the GAC, the assembly itself AND all assemblies it references must be signed. Unless you have access to the source of these third party assembly, there is no way to sign it.&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI value=1&gt;
&lt;P&gt;&lt;B&gt;The project and the shared code in your assemblies will be constantly being developed by a team of developers&lt;/B&gt; – It's advisable that your development platforms mirror the set-up of your live server. If you plan on putting your shared assemblies in the GAC on the live server, then ideally they will also be in the GAC on your development platforms. If you have a team of developers working on a shared code library, it would get extremely difficult and time consuming to make sure every developer has the correct version of the code in their GAC. In our case, the shared code library wouldn't be incremented in versions but rather always have a single current version.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;However, we still needed a way of centralising the assemblies and allowing each separate application to find and use them. We already had a shared directory that contained the common UI layer of my application, this had been set up as a virtual directory on each website. Ideally I needed to structure my web application like this:&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;WebRoot&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bin&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SharedCode&lt;BR&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bin&lt;/B&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Templates&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .. .&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Styles&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc..&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Luckily, there is a way to tell your application to look for it's assemblies in locations other the the 'bin' directory. &lt;/P&gt;
&lt;P&gt;If you put your assemblies in the root 'bin' directory of your web app, you don't need to tell the ASP.Net CLR to reference them or where to look for them, this is all done automatically. If you put your assemblies in the GAC, you don't need to tell ASP.Net where to look for them but you do need to register them. If you you put your assemblies anywhere else, you need to both register them and tell ASP.Net where to find them. Both of these tasks can be achieved in the web.config.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Registering the assemblies&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;You might already recognise this step. Whenever your reference an assembly in the GAC or one that's part of the CLR, you also use this method. However, in this case, since our shared assemblies aren't strongly named, we don't have to fully qualify our assembly reference (with a&lt;FONT color=#000000&gt;&lt;FONT face=Verdana&gt;&lt;FONT style="FONT-SIZE: 8pt" size=1&gt;&lt;SPAN style="FONT-STYLE: normal"&gt;&lt;SPAN&gt; text name, version, culture, and public key token&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;). To register the assemblies (tell the app to look for them), add this line for each assembly:&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#808080&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;lt;configuration&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#808080&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;system.web&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;compilation&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;assemblies&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="BACKGROUND: #ffff00"&gt; &amp;lt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;add&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;assembly&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;=&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;"S&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;hared.Assembly.Name&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;"&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;assemblies&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;compilation&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#a31515&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#808080&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;lt;/system.web&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#808080&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;lt;/configuration&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Telling ASP.Net where to look with a probing path&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;To tell ASP.Net where to look for these assemblies, you need to create a probing path in your web.config. ASP.Net will add this path to it's list of places to look for it's assemblies.&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#808080&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;lt;configuration&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;runtime&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;assemblyBinding&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;xmlns&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;=&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;"&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;urn:schemas-microsoft-com:asm.v1&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;"&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;probing&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;privatePath&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;=&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;"&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;SharedCode\Bin&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;"&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;assemblyBinding&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;B&gt;&lt;SPAN style="BACKGROUND: #ffff00"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;runtime&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#808080&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;lt;/configuration&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;STRONG&gt;*note: &lt;/STRONG&gt;if you need to add multiple probing paths, you can delimit them with a semicolon e.g. &amp;lt;probing privatePath="SharedCode\Bin;ThirdParty\Bin" /&amp;gt; &lt;BR&gt;&lt;BR&gt;
&lt;P&gt;&lt;B&gt;Creating a NTFS Junction Point for your shared code&lt;/B&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;As mentioned above, originally, all of our applications had access the the 'SharedCode' folder via a Virtual Directory set up in IIS. Unfortunately (but probably for good reason), you can't load assemblies from virtual directories. You also cannot tell a web application to look for assemblies outside of the scope of the application (e.g &amp;lt;probing privatePath=”C:\Bin”&amp;gt; will not work). To get around this problem I created an NTFS junction point in the root of the applications that pointed to the shared code directory. NTFS junction points are basically direct links to other directories on the local machine. For more information on NTFS junction points see:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.microsoft.com/kb/205524" mce_href="http://support.microsoft.com/kb/205524"&gt;http://support.microsoft.com/kb/205524&lt;/A&gt; &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Verdana&gt;&lt;FONT style="FONT-SIZE: 9pt" size=2&gt;&lt;SPAN style="FONT-STYLE: normal"&gt;&lt;B&gt;*Note: &lt;/B&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Verdana&gt;&lt;FONT style="FONT-SIZE: 9pt" size=2&gt;&lt;SPAN style="FONT-STYLE: normal"&gt;&lt;SPAN&gt;pay special attention to the section&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Verdana&gt;&lt;FONT style="FONT-SIZE: 9pt" size=2&gt;&lt;SPAN style="FONT-STYLE: normal"&gt;&lt;B&gt; 'Usage Recommendations&lt;/B&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;'. Using NTFS Junction points can be dangerous because what you do to the junction point will also affect the target directory&lt;FONT color=#000000&gt;&lt;FONT face=Verdana&gt;&lt;FONT style="FONT-SIZE: 8pt" size=1&gt;&lt;SPAN style="FONT-STYLE: normal"&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Verdana&gt;&lt;FONT style="FONT-SIZE: 8pt" size=1&gt;&lt;SPAN style="FONT-STYLE: normal"&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;B&gt;*Also note: &lt;/B&gt;&lt;SPAN&gt;F&lt;/SPAN&gt;or some reason Windows Server 2003 has problems recognising Junction points created by some third party applications. For this reason, it's easier to use linkd.exe which can be found in the &lt;A title="Windows Server 2003 Resource Kit Tools" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&amp;amp;displaylang=en" target=_blank mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&amp;amp;displaylang=en"&gt;Microsoft Windows Server 2003 Resource Kit&lt;/A&gt;. &lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6708747" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/chrismoseley/archive/tags/Shared+Assemblies/default.aspx">Shared Assemblies</category><category domain="http://weblogs.asp.net/chrismoseley/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/chrismoseley/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/chrismoseley/archive/tags/GAC/default.aspx">GAC</category></item><item><title>FileUpload controls don't do ajax!</title><link>http://weblogs.asp.net/chrismoseley/archive/2007/10/03/fileupload-controls-don-t-do-ajax.aspx</link><pubDate>Wed, 03 Oct 2007 19:23:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:4323884</guid><dc:creator>cjmos</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/chrismoseley/rsscomments.aspx?PostID=4323884</wfw:commentRss><comments>http://weblogs.asp.net/chrismoseley/archive/2007/10/03/fileupload-controls-don-t-do-ajax.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;A guy I work with mentioned this tip to me today so I thought I'd share it (not the ground-breaking first article I was hoping for but don't worry that's coming!):&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&lt;FONT size=2 face=Arial&gt;&lt;SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"&gt;FileUpload controls don't work&amp;nbsp;with ajax, so its probably best not using them with &lt;?xml:namespace prefix = st1 /&gt;&lt;st1:city w:st="on"&gt;&lt;st1:place w:st="on"&gt;ajax&lt;/st1:place&gt;&lt;/st1:city&gt;! &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=2 face=Arial&gt;&lt;SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2 face=Arial&gt;&lt;SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"&gt;If you feel you must then the way to do it is to make your file upload submit button a postback trigger, and set the UpdateMode of your update panel to conditional. This allows you to do your &lt;st1:city w:st="on"&gt;&lt;st1:place w:st="on"&gt;ajax&lt;/st1:place&gt;&lt;/st1:city&gt; stuff as usual, but when you come to do the file upload you will have a full page refresh: -&lt;/SPAN&gt;&lt;/FONT&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=3 face="Times New Roman"&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color=blue size=2 face=Arial&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;&amp;lt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;st1:city w:st="on"&gt;&lt;st1:place w:st="on"&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;asp&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;UpdatePanel&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black size=2&gt;&lt;SPAN style="COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;ID&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="AjaxUploader"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black size=2&gt;&lt;SPAN style="COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;runat&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="server" &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;UpdateMode&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="Conditional"&amp;gt;&lt;BR&gt;&amp;lt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;Triggers&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;asp&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;PostBackTrigger&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;ControlID&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="UploadButton"/&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;Triggers&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;ContentTemplate&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;asp&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;FileUpload&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;ID&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="FileUpload1"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;runat&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="server"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;EnableViewState&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="true"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;&amp;amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;&amp;lt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;asp&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;Button&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;ID&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="UploadButton"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;runat&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="server"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;Text&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="Upload File"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;OnClick&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="SomeFunction"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;/&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;ContentTemplate&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/SPAN&gt;&lt;/FONT&gt;&lt;st1:city w:st="on"&gt;&lt;st1:place w:st="on"&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;asp&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;UpdatePanel&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=2 face=Arial&gt;&lt;SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=2 face=Arial&gt;&lt;SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"&gt;One thing that really caught me out was a lovely little gotcha with asp:placeholders and their 'Visibility' property, I was toggling a form in and out of view and this caused the image upload to fail first time it was used, although it would then be fine after that. One quick solution is to use a div and play with it's style property instead: -&lt;/SPAN&gt;&lt;/FONT&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=3 face="Times New Roman"&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color=blue size=2 face=Arial&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;&amp;lt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;div&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black size=2&gt;&lt;SPAN style="COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;id&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="layerToToggle"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black size=2&gt;&lt;SPAN style="COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;runat&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="server"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black size=2&gt;&lt;SPAN style="COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red size=2&gt;&lt;SPAN style="COLOR: red; FONT-SIZE: 10pt"&gt;style&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;="display:none"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black size=2&gt;&lt;SPAN style="COLOR: black; FONT-SIZE: 10pt"&gt;&amp;lt;p&amp;gt;Content to toggle&amp;lt;/p&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;&lt;BR&gt;&amp;lt;/&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;SPAN style="COLOR: rgb(163,21,21); FONT-SIZE: 10pt"&gt;div&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue size=2&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;o:p&gt;&lt;/o:p&gt; &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Then in code behind:&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=2&gt;
&lt;P&gt;layerToToggle.Style.Add(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"display"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;); &lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// show&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;layerToToggle.Style.Add(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"display"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"none"&lt;/FONT&gt;&lt;FONT size=2&gt;); &lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// hide&lt;/P&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color=blue size=2 face=Arial&gt;&lt;SPAN style="COLOR: blue; FONT-SIZE: 10pt"&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4323884" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/chrismoseley/archive/tags/FileUpload/default.aspx">FileUpload</category><category domain="http://weblogs.asp.net/chrismoseley/archive/tags/Atlas/default.aspx">Atlas</category><category domain="http://weblogs.asp.net/chrismoseley/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://weblogs.asp.net/chrismoseley/archive/tags/ASP.NETUpdatePanel/default.aspx">ASP.NETUpdatePanel</category></item></channel></rss>
