<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Head.SmackOnTable(); &#187; CSSAdapter</title>
	<atom:link href="http://www.unauthorised-access.com/tag/cssadapter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.unauthorised-access.com</link>
	<description>Contains Nuts.</description>
	<lastBuildDate>Fri, 06 Jan 2012 11:15:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Introduction to CSS Adapters &#8211; Label Control</title>
		<link>http://www.unauthorised-access.com/2008/11/introduction-to-css-adapters/</link>
		<comments>http://www.unauthorised-access.com/2008/11/introduction-to-css-adapters/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 12:53:00 +0000</pubDate>
		<dc:creator>Monty</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#.net]]></category>
		<category><![CDATA[CSSAdapter]]></category>
		<category><![CDATA[HtmlTextWriterTag]]></category>
		<category><![CDATA[RenderEndTag]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[WebControls]]></category>

		<guid isPermaLink="false">http://www.unauthorised-access.com/?p=52</guid>
		<description><![CDATA[CSS Adapters in .net are rarely used, even though they are really powerful and can fix things like xhtml validation errors. This very quick sample will show you how to replace the &#60;span&#62; tags with a &#60;div&#62; Create a class file, something like &#8220;LabelOverride.cs&#8221;, and put in the following: Create a folder in the web [...]]]></description>
			<content:encoded><![CDATA[<p>CSS Adapters in .net are rarely used, even though they are really powerful and can fix things like xhtml validation errors. This very quick sample will show you how to replace the &lt;span&gt; tags with a &lt;div&gt;</p>
<p>Create a class file, something like &#8220;LabelOverride.cs&#8221;, and put in the following:</p>
<pre class="brush: csharp; title: ; notranslate">

using System.Web.UI;

namespace CSSAdapterTest
{
public class LabelOverride : System.Web.UI.WebControls.Adapters.WebControlAdapter
{
protected override void RenderBeginTag(HtmlTextWriter writer)
{
writer.RenderBeginTag(HtmlTextWriterTag.Div);
}
protected override void RenderEndTag(HtmlTextWriter writer)
{
writer.RenderEndTag();
}
}
}
</pre>
<p>Create a folder in the web application called &#8220;App_Browsers&#8221;, and create a .browsers file called &#8220;CSSAdapter.browser&#8221;, and enter in the following:</p>
<pre class="brush: xml; title: ; notranslate">

&lt;browsers&gt;
&lt;browser refID=&quot;Default&quot;&gt;
&lt;controlAdapters&gt;
&lt;adapter controlType=&quot;System.Web.UI.WebControls.Label&quot;
adapterType=&quot;CSSAdapterTest.LabelOverride&quot; /&gt;
&lt;/controlAdapters&gt;
&lt;/browser&gt;
&lt;/browsers&gt;
</pre>
<p>This basically tells asp.net to override the controlType&#8217;s renderer with the one you have specified.</p>
<p>Once you have done this, and when you build your application, all &lt;span&gt;&#8217;s will disappear and be replaced with &lt;div&gt;&#8217;s!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unauthorised-access.com/2008/11/introduction-to-css-adapters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

