<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.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>Custom Server Controls</title><link>http://forums.asp.net/19.aspx</link><description>All about building ASP.NET server controls. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=12&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Problem with WebResourceAttribute and paths</title><link>http://forums.asp.net/thread/1677440.aspx</link><pubDate>Mon, 23 Apr 2007 08:22:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1677440</guid><dc:creator>andrewgarner</dc:creator><author>andrewgarner</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1677440.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=19&amp;PostID=1677440</wfw:commentRss><description>Thank you so much! I've just tried that and it works!</description></item><item><title>Re: Problem with WebResourceAttribute and paths</title><link>http://forums.asp.net/thread/1676480.aspx</link><pubDate>Sun, 22 Apr 2007 11:09:54 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1676480</guid><dc:creator>mosessaur</dc:creator><author>mosessaur</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1676480.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=19&amp;PostID=1676480</wfw:commentRss><description>&lt;p&gt;It seems that C# compiler and VB.Net Compiler treat resources in deferent manner. And Actually I didn't know that before now.&lt;br /&gt;In case you still didn't resolve your issue, try this:&lt;/p&gt;
&lt;p&gt;Keep you first code as it is&lt;br /&gt;&amp;lt;&lt;span class=kwd&gt;&lt;font color=#0000ff&gt;Assembly&lt;/font&gt;&lt;/span&gt;: WebResource(&lt;span class=st&gt;&lt;font color=#ff0000&gt;"Lighthouse.Software.Library.Core.Test.css"&lt;/font&gt;&lt;/span&gt;, &lt;span class=st&gt;&lt;font color=#ff0000&gt;"text/css"&lt;/font&gt;&lt;/span&gt;, PerformSubstitution:=&lt;span class=kwd&gt;&lt;font color=#0000ff&gt;True&lt;/font&gt;&lt;/span&gt;)&amp;gt; &lt;br /&gt;&amp;lt;&lt;span class=kwd&gt;&lt;font color=#0000ff&gt;Assembly&lt;/font&gt;&lt;/span&gt;: WebResource(&lt;span class=st&gt;&lt;font color=#ff0000&gt;"Lighthouse.Software.Library.Core.Test.png"&lt;/font&gt;&lt;/span&gt;, &lt;span class=st&gt;&lt;font color=#ff0000&gt;"image/png"&lt;/font&gt;&lt;/span&gt;)&amp;gt; &lt;/p&gt;
&lt;p&gt;At the same time put your resources in folder as you wished. In VB.NET it seems that you just need to reference the default namespace without subsequent directories.&lt;/p&gt;
&lt;p&gt;Hope this would resolve your issue&lt;/p&gt;</description></item><item><title>Problem with WebResourceAttribute and paths</title><link>http://forums.asp.net/thread/1675066.aspx</link><pubDate>Fri, 20 Apr 2007 16:09:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1675066</guid><dc:creator>andrewgarner</dc:creator><author>andrewgarner</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1675066.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=19&amp;PostID=1675066</wfw:commentRss><description>This problem has been puzzling me all day - I am attempting to embed resources within a class library, buy I can only get it to work when the files are within the root of the class library.&lt;br /&gt;&lt;br /&gt;My default namespace is &lt;b&gt;Lighthouse.Software.Library.Core&lt;/b&gt; - I have added &lt;b&gt;Test.css&lt;/b&gt; and &lt;b&gt;Test.png&lt;/b&gt; to the root of the class library, then within the class I have the following code:&amp;nbsp;&lt;pre class="coloredcode"&gt;&amp;lt;&lt;span class="kwd"&gt;Assembly&lt;/span&gt;: WebResource(&lt;span class="st"&gt;"Lighthouse.Software.Library.Core.Test.css"&lt;/span&gt;, &lt;span class="st"&gt;"text/css"&lt;/span&gt;, PerformSubstitution:=&lt;span class="kwd"&gt;True&lt;/span&gt;)&amp;gt; &lt;br /&gt;&amp;lt;&lt;span class="kwd"&gt;Assembly&lt;/span&gt;: WebResource(&lt;span class="st"&gt;"Lighthouse.Software.Library.Core.Test.png"&lt;/span&gt;, &lt;span class="st"&gt;"image/png"&lt;/span&gt;)&amp;gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="kwd"&gt;Protected Overrides Sub&lt;/span&gt; CreateChildControls()&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwd"&gt;Dim&lt;/span&gt; Stylesheet &lt;span class="kwd"&gt;As New&lt;/span&gt; HtmlLink&lt;br /&gt;    Stylesheet.Href = &lt;span class="kwd"&gt;Me&lt;/span&gt;.Page.ClientScript.GetWebResourceUrl(&lt;span class="kwd"&gt;GetType&lt;/span&gt;(MasterPage), &lt;span class="st"&gt;"Lighthouse.Software.Library.Core.Test.css"&lt;/span&gt;)&lt;br /&gt;    Stylesheet.Attributes.Add(&lt;span class="st"&gt;"type"&lt;/span&gt;, &lt;span class="st"&gt;"text/css"&lt;/span&gt;)&lt;br /&gt;    Stylesheet.Attributes.Add(&lt;span class="st"&gt;"rel"&lt;/span&gt;, &lt;span class="st"&gt;"stylesheet"&lt;/span&gt;)&lt;br /&gt;    Stylesheet.Attributes.Add(&lt;span class="st"&gt;"media"&lt;/span&gt;, &lt;span class="st"&gt;"screen"&lt;/span&gt;)&lt;br /&gt;    Stylesheet.Attributes.Add(&lt;span class="st"&gt;"title"&lt;/span&gt;, &lt;span class="st"&gt;"Lighthouse"&lt;/span&gt;)&lt;br /&gt;    &lt;span class="kwd"&gt;Me&lt;/span&gt;.Page.Header.Controls.Add(Stylesheet)&lt;br /&gt;&lt;br /&gt;&lt;span class="kwd"&gt;End Sub&lt;/span&gt;&lt;/pre&gt;This works correctly, however I wish to keep everything tidy by putting the resource files in sub-directories. I created a folder &lt;span style="font-weight:bold;"&gt;Resources &lt;/span&gt;containing folders &lt;span style="font-weight:bold;"&gt;Images &lt;/span&gt;and &lt;span style="font-weight:bold;"&gt;Styles &lt;/span&gt;and adjusted my code like so:&amp;nbsp;&lt;pre class="coloredcode"&gt;&amp;lt;&lt;span class="kwd"&gt;Assembly&lt;/span&gt;: WebResource(&lt;span class="st"&gt;"Lighthouse.Software.Library.Core.Resources.Styles.Test.css"&lt;/span&gt;, &lt;span class="st"&gt;"text/css"&lt;/span&gt;, PerformSubstitution:=&lt;span class="kwd"&gt;True&lt;/span&gt;)&amp;gt; &lt;br /&gt;&amp;lt;&lt;span class="kwd"&gt;Assembly&lt;/span&gt;: WebResource(&lt;span class="st"&gt;"Lighthouse.Software.Library.Core.Resources.Images.Test.png"&lt;/span&gt;, &lt;span class="st"&gt;"image/png"&lt;/span&gt;)&amp;gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="kwd"&gt;Protected Overrides Sub&lt;/span&gt; CreateChildControls()&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwd"&gt;Dim&lt;/span&gt; Stylesheet &lt;span class="kwd"&gt;As New&lt;/span&gt; HtmlLink&lt;br /&gt;    Stylesheet.Href = &lt;span class="kwd"&gt;Me&lt;/span&gt;.Page.ClientScript.GetWebResourceUrl(&lt;span class="kwd"&gt;GetType&lt;/span&gt;(MasterPage), &lt;span class="st"&gt;"Lighthouse.Software.Library.Core.Resources.Styles.Test.css"&lt;/span&gt;)&lt;br /&gt;    Stylesheet.Attributes.Add(&lt;span class="st"&gt;"type"&lt;/span&gt;, &lt;span class="st"&gt;"text/css"&lt;/span&gt;)&lt;br /&gt;    Stylesheet.Attributes.Add(&lt;span class="st"&gt;"rel"&lt;/span&gt;, &lt;span class="st"&gt;"stylesheet"&lt;/span&gt;)&lt;br /&gt;    Stylesheet.Attributes.Add(&lt;span class="st"&gt;"media"&lt;/span&gt;, &lt;span class="st"&gt;"screen"&lt;/span&gt;)&lt;br /&gt;    Stylesheet.Attributes.Add(&lt;span class="st"&gt;"title"&lt;/span&gt;, &lt;span class="st"&gt;"Lighthouse"&lt;/span&gt;)&lt;br /&gt;    &lt;span class="kwd"&gt;Me&lt;/span&gt;.Page.Header.Controls.Add(Stylesheet)&lt;br /&gt;&lt;br /&gt;&lt;span class="kwd"&gt;End Sub&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;Now it no longer works - I have read that it is &lt;a href="http://dotnetslackers.com/community/blogs/mosessaur/archive/2007/01/31/System.Web.UI.WebResourceAttribute-Issue.aspx"&gt;possible&lt;/a&gt;, but it won't work for me!&lt;/p&gt;&lt;p&gt;Any suggestions would be much appreciated!&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>