<?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>CSS Friendly Control Adapters</title><link>http://forums.asp.net/1018.aspx</link><description>Discuss the CSS Friendly Control Adapters sample project, ask questions, post bugs, etc</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Serving suggestion</title><link>http://forums.asp.net/thread/1595520.aspx</link><pubDate>Mon, 26 Feb 2007 19:51:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1595520</guid><dc:creator>bdemarzo</dc:creator><author>bdemarzo</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1595520.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1595520</wfw:commentRss><description>&lt;p&gt;For those still interested in this, there's a few developments...&lt;/p&gt;&lt;ul&gt;&lt;li&gt;My web site is back up, so you can download the code and read brief instructions at &lt;a href="http://www.demarzo.net/articles/1056.aspx"&gt;http://www.demarzo.net/articles/1056.aspx&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;ScottGu replied to my inquiry and said there would be no problem posting this code on CodePlex, which I am in the process of doing right now. When I'm done the code will be available at &lt;a href="http://www.codeplex.com/cssfriendly"&gt;http://www.codeplex.com/cssfriendly&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;</description></item><item><title>Re: Serving suggestion</title><link>http://forums.asp.net/thread/1556010.aspx</link><pubDate>Tue, 30 Jan 2007 20:16:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1556010</guid><dc:creator>bdemarzo</dc:creator><author>bdemarzo</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1556010.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1556010</wfw:commentRss><description>&lt;p&gt;&lt;blockquote&gt;&lt;div&gt;&lt;img src="http://forums.asp.net/Themes/default/images/icon-quote.gif" /&gt; &lt;strong&gt;michiel1978:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Just realized you might not be allowed to post the source to Codeplex &lt;font size="2"&gt;because you altered it &lt;/font&gt;(&lt;font size="2"&gt;Microsoft Permissive License)&lt;/font&gt;&lt;font size="2"&gt;?&lt;/font&gt;&lt;span id="eulaContent"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Good point. ScottGu commented on my posting of the compiled adapters, which means he's familiar with what I did (and supportive of it). I'll ask him if he has suggestions.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Serving suggestion</title><link>http://forums.asp.net/thread/1555992.aspx</link><pubDate>Tue, 30 Jan 2007 20:08:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1555992</guid><dc:creator>michiel1978</dc:creator><author>michiel1978</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1555992.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1555992</wfw:commentRss><description>Just realized you might not be allowed to post the source to Codeplex &lt;font size="2"&gt;because you altered it &lt;/font&gt;(&lt;font size="2"&gt;Microsoft Permissive License)&lt;/font&gt;&lt;font size="2"&gt;?&lt;/font&gt;&lt;span id="eulaContent"&gt;&lt;/span&gt;</description></item><item><title>Re: Serving suggestion</title><link>http://forums.asp.net/thread/1553373.aspx</link><pubDate>Mon, 29 Jan 2007 15:15:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1553373</guid><dc:creator>bdemarzo</dc:creator><author>bdemarzo</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1553373.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1553373</wfw:commentRss><description>&lt;p&gt;My server crashed and I haven't had time to repair it. Should be back in a week or so.&lt;/p&gt;&lt;p&gt;I will look into adding it to CodePlex this week.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Serving suggestion</title><link>http://forums.asp.net/thread/1552948.aspx</link><pubDate>Mon, 29 Jan 2007 09:23:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1552948</guid><dc:creator>michiel1978</dc:creator><author>michiel1978</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1552948.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1552948</wfw:commentRss><description>&lt;p&gt;Hello bdemarzo,&lt;/p&gt;&lt;p&gt;your site is currently down, is this temporary? If not, would you consider moving the project to sourceforge or codeplex so we always have access and others can help with the maintenance?&lt;/p&gt;&lt;p&gt;Thanks!&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Serving suggestion</title><link>http://forums.asp.net/thread/1468329.aspx</link><pubDate>Fri, 17 Nov 2006 03:01:01 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1468329</guid><dc:creator>bdemarzo</dc:creator><author>bdemarzo</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1468329.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1468329</wfw:commentRss><description>&lt;p&gt;Thanks for the kind words -- I'm glad you (and hopefully many others!) find it as helpful as I do. I'll keep updating the compiled distribution to coincide with the latest changes from Microsoft until they do it for me. &lt;img src="http://forums.asp.net/emoticons/emotion-5.gif" alt="Wink" /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Serving suggestion</title><link>http://forums.asp.net/thread/1468188.aspx</link><pubDate>Fri, 17 Nov 2006 00:00:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1468188</guid><dc:creator>Thacker</dc:creator><author>Thacker</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1468188.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1468188</wfw:commentRss><description>&lt;p&gt;bdemarzo---&lt;/p&gt;&lt;p&gt;Your compiled dll and supplied files within your zip are excellent.&amp;nbsp; This will greatly ease deployment.&amp;nbsp; Re-compiling the dll for adjustments and later revisions to the adapters and associated files is going to be a breeze.&amp;nbsp; It keeps things simple and stupid.&amp;nbsp; It is great.&amp;nbsp; Thanks very much, ladies and gentlemen.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Serving suggestion</title><link>http://forums.asp.net/thread/1467480.aspx</link><pubDate>Thu, 16 Nov 2006 15:42:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1467480</guid><dc:creator>bdemarzo</dc:creator><author>bdemarzo</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1467480.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1467480</wfw:commentRss><description>Inspired by this topic, I wrote a compiled version of the beta 3.0 CSSAdapters. You can read about it and download it from my blog site at http://demarzo.net/archive/2006/11/16/1037.aspx.&lt;br /&gt;</description></item><item><title>Re: Serving suggestion</title><link>http://forums.asp.net/thread/1450018.aspx</link><pubDate>Thu, 02 Nov 2006 00:12:36 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1450018</guid><dc:creator>Padgett</dc:creator><author>Padgett</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1450018.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1450018</wfw:commentRss><description>&lt;strong&gt;HardyE - this sounds perfect, I will give it a go.&amp;nbsp; Cheers for the detailed response.&lt;/strong&gt;</description></item><item><title>Re: Serving suggestion</title><link>http://forums.asp.net/thread/1449740.aspx</link><pubDate>Wed, 01 Nov 2006 20:08:53 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1449740</guid><dc:creator>HardyE</dc:creator><author>HardyE</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1449740.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1449740</wfw:commentRss><description>&lt;p&gt;Hi!&lt;/p&gt;&lt;p&gt;For the release of the&amp;nbsp;&lt;a href="http://www.asp.net/sandbox/app_blinq.aspx?tabid=62"&gt;Blinq&lt;/a&gt; prototype I compiled the necessary adapter resources into a dll to keep the project files clear of unrelated adapter code so developers would be able to concentrate on the core Blinq files. The CSS Adapters were in an early stage at the time but the principle can just as well be applied to the current release.&lt;/p&gt;&lt;p&gt;The way to go about &amp;quot;pre-packaging&amp;quot; the adapters resources into a single dll is as follows:&lt;/p&gt;&lt;p&gt;1. Create a class-library project in Visual Studio. Name it &amp;quot;CSSAdapters&amp;quot;. This will hold the resources and code files which will eventually be turned into the dll.&lt;/p&gt;&lt;p&gt;2. Add a &amp;quot;CSS Friendly ASP.NET Control Adapters&amp;quot; web site to the solution in Visual Studio. &lt;/p&gt;&lt;p&gt;3. Reference the class library project from the Adapters project. This will ensure the output of the class library project will be copied to the Adapter project&amp;#39;s &amp;quot;bin&amp;quot; directory.&lt;/p&gt;&lt;p&gt;4. Move (don&amp;#39;t copy) the following folders and their contents from the Adapters project to the dll project: &lt;br /&gt;- App_Code/Adapters&lt;br /&gt;- CSS&lt;br /&gt;- JavaScript&lt;br /&gt;The .cs/.vb files can be moved to the root directory of the class library project, but I recommend leaving the .css and .js files in their respective folders. The steps below assume this is the case.&lt;/p&gt;&lt;p&gt;5. Open the file &amp;quot;AssemblyInfo.cs&amp;quot; of the class library project. You will need add to this file in the next step.&lt;/p&gt;&lt;p&gt;6. Turn the CSS and JavaScript files residing in the &amp;quot;CSS&amp;quot; and &amp;quot;JavaScript&amp;quot; directories of the class library project into embedded resources:&lt;br /&gt;a) Select a file in Solution Explorer.&lt;br /&gt;b) In the properties window set its build action to &amp;quot;Embedded Resource&amp;quot;.&lt;br /&gt;c) Add a WebRessourceAttribute decoration for the resource of step a to &amp;quot;AssemblyInfo.cs&amp;quot;. For JavaScript files this must look as follows:&lt;/p&gt;&lt;pre class="coloredcode"&gt;[assembly: WebResource(&lt;span class="st"&gt;&amp;quot;CssAdapters.JavaScript.AdapterUtils.js&amp;quot;&lt;/span&gt;, &lt;span class="st"&gt;&amp;quot;application/x-javascript&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;p&gt;For CSS files the format would be:&lt;/p&gt;&lt;pre class="coloredcode"&gt;[assembly: WebResource(&lt;span class="st"&gt;&amp;quot;CssAdapters.CSS.Menu.css&amp;quot;&lt;/span&gt;, &lt;span class="st"&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;The first parameter of the &lt;code&gt;WebResourceAttribute&lt;/code&gt; expects the following syntax: &lt;em&gt;ProjectNamespace.Foldername.Filename.FileExtension&lt;/em&gt;. Note that this is strictly case-sensitive, i.e. the casing of the resource files must match the parameter&amp;#39;s value exactly.&lt;br /&gt;d) Repeat steps a to c for each CSS and JavaScript file.&lt;/p&gt;&lt;p&gt;7. Now adjust the C#/VB code in the adapter classes to retrieve the resources from the assembly instead of the file system. The method you need here is &lt;/p&gt;&lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.getwebresourceurl.aspx" target="_blank"&gt;ClientScriptManager.GetWebResourceUrl&lt;/a&gt;&amp;nbsp;, which which you could use as follows:&lt;/p&gt;&lt;pre class="coloredcode"&gt;Page.ClientScript.GetWebResourceUrl(GetType(), &lt;span class="st"&gt;&amp;quot;CssAdapters.CSS.Menu.css&amp;quot;&lt;/span&gt;));&amp;nbsp;&amp;nbsp;&lt;/pre&gt;&lt;p&gt;Use this call to &lt;code&gt;GetWebResourceUrl()&lt;/code&gt; anywhere a file system path to the respective resource is required by the adapter class. &lt;/p&gt;&lt;p&gt;Following the above steps will package the CSS and JavaScript resources into a single dll along with the adapter classes. Please be aware that once the files are embedded in the dll you will have to recompile and upload the assembly to your web server each time you make a change to the CSS and JavaScript files. &lt;/p&gt;&lt;p&gt;Hint: the tricky part in making embedded resources work is to figure out the exact value for the first parameter of&amp;nbsp;&lt;code&gt;WebResourceAttribute&lt;/code&gt; . If you get the casing wrong, retrieval of the resource will fail silently. No exception will be thrown, the file is simply not served. A helpful method to figure out the correct string for the resource is to set the build action for all the resources to &amp;quot;Embedded Resource&amp;quot; as in step 6b and then compile the dll. Then open the dll you just compiled in ildasm.exe and double-click on the &amp;quot;MANIFEST&amp;quot; section. Somewhere you will find entries that look similarly to this:&lt;/p&gt;&lt;pre class="coloredcode"&gt;.mresource &lt;span class="kwd"&gt;public&lt;/span&gt; CSSAdapters.CSS.Menu.css
{
  &lt;span class="cmt"&gt;// Offset: 0x00000E50 Length: 0x000006F7&lt;/span&gt;
}&lt;/pre&gt;&lt;p&gt;The&amp;nbsp;value after &lt;code&gt;.mresource public&lt;/code&gt; is&amp;nbsp;the precise string you have to pass to the WebResourceAttribute in step 6c.&lt;/p&gt;&lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webresourceattribute.aspx"&gt;&lt;/a&gt;&lt;/p&gt;Hope this helps. &lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;Hardy Erlinger&lt;/p&gt;&lt;p&gt;Further reading on embedded resources in ASP.NET 2.0:&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.nikhilk.net/WebResourceAttribute.aspx"&gt;http://www.nikhilk.net/WebResourceAttribute.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webresourceattribute.aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.web.ui.webresourceattribute.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: Serving suggestion</title><link>http://forums.asp.net/thread/1449350.aspx</link><pubDate>Wed, 01 Nov 2006 15:25:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1449350</guid><dc:creator>Russ Helfand</dc:creator><author>Russ Helfand</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1449350.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1449350</wfw:commentRss><description>&lt;p&gt;This is a great idea. I know of a few people who have already implemented it.&amp;nbsp; I&amp;#39;ll contact one of them, Polita Paulus, who is part of the ASP.NET team, to see if she can post some notes on how exactly to do this packaging yourself.&lt;/p&gt;&lt;p&gt;I understand that you&amp;#39;d prefer for MS to do this DLL construction for you and merely distribute it in a future rev of the kit.&amp;nbsp; I&amp;#39;ll keep that in mind but Polita&amp;#39;s (or others&amp;#39;) recipe for how to do this can help you and others right now.&amp;nbsp; So, let&amp;#39;s try to get a detailed set of instructions posted here if we can.&lt;/p&gt;&lt;p&gt;Again, thanks for the insight on how you&amp;#39;d prefer the kit packaged.&amp;nbsp; It&amp;#39;s a good idea.&lt;/p&gt;</description></item><item><title>Serving suggestion</title><link>http://forums.asp.net/thread/1448692.aspx</link><pubDate>Wed, 01 Nov 2006 02:15:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1448692</guid><dc:creator>Padgett</dc:creator><author>Padgett</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1448692.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1448692</wfw:commentRss><description>&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Arial;"&gt;I&amp;rsquo;d like to make a suggestion in regards to how this project is packaged.&lt;span&gt;&amp;nbsp; &lt;/span&gt;This is aimed at those who want to add Css based controls to their existing project and are not concerned with how it all works.&lt;span&gt;&amp;nbsp; &lt;/span&gt;In addition to your source and example packages, I&amp;rsquo;d love to see a &amp;lsquo;redistributable&amp;rsquo; package.&lt;span&gt;&amp;nbsp; &lt;/span&gt;This would contain just the elements needed to override the rendering of the controls.&lt;span&gt;&amp;nbsp; &lt;/span&gt;I see this as being:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 54pt;text-indent:-18pt;tab-stops:list 54.0pt;"&gt;&lt;span style="font-size:10pt;font-family:Arial;"&gt;&lt;span&gt;a)&lt;span style="font:7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Arial;"&gt;A single dll with which to reference in our existing projects.&lt;span&gt;&amp;nbsp; &lt;/span&gt;This dll contains all the code and resources for the control adapters.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt 54pt;text-indent:-18pt;tab-stops:list 54.0pt;"&gt;&lt;span style="font-size:10pt;font-family:Arial;"&gt;&lt;span&gt;b)&lt;span style="font:7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Arial;"&gt;A .browser file that tells our projects to use the control adapters in the referenced assembly&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Arial;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Arial;"&gt;Is this do-able?&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Arial;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;"&gt;&lt;span style="font-size:10pt;font-family:Arial;"&gt;Overall this project is excellent.&lt;span&gt;&amp;nbsp; &lt;/span&gt;In my opinion this is how the asp.net controls should have been built in the first place.&lt;/span&gt;&lt;/p&gt;</description></item></channel></rss>