<?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>sides of march &#187; HTML &amp; CSS</title>
	<atom:link href="http://www.sidesofmarch.com/index.php/archive/tag/html-css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sidesofmarch.com</link>
	<description>Thoughts on life, liberty, and information technology</description>
	<lastBuildDate>Mon, 16 Jan 2012 02:43:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>An IE6-compatible solution for :hover</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/04/23/an-ie6-compatible-solution-for-hover/</link>
		<comments>http://www.sidesofmarch.com/index.php/archive/2007/04/23/an-ie6-compatible-solution-for-hover/#comments</comments>
		<pubDate>Mon, 23 Apr 2007 18:23:06 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[HTML & CSS]]></category>

		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/04/23/an-ie6-compatible-solution-for-hover/</guid>
		<description><![CDATA[<p>Something I like to incorporate on web sites with tables is automatic background highlighting of the row that the mouse is hovering over. This is easy to do with CSS:</p>


table.hover tr:hover
{
	background-color:#ffffcc;
}

<p>All you need to do is give your table tag the hover class, and your mouseover hover background color works!</p>
<p>In all browsers except IE6, of course. IE6 only supports the :hover pseudo-class on anchor (<a></a>) tags. (There&#8217;s <a href="http://blogs.msdn.com/ie/archive/2005/07/29/445242.aspx">lots of other things</a> that IE doesn&#8217;t support or supports wrong, but that&#8217;s a story for another day.)</p>
<p>How can we get IE6 to hover our table rows? By using a little JavaScript and the <a href="http://www.prototypejs.org">Prototype library</a>. Our solution requires two steps:</p>

Write some code to automatically detect mouseover and mouseout events on table rows, applying and removing a CSS class to the rows as the events occur.
Add the CSS class to our CSS file.

<p>First we&#8217;ll add a tr.hover declaration to our CSS.</p>


table.hover tr:hover, table.hover tr.hover
{
	background-color:#ffffcc;
}

<p>Notice that I kept the table.hover parent selector; this <span style="color:#777"> . . .<br /><br />&#8594; Read More: <a href="http://www.sidesofmarch.com/index.php/archive/2007/04/23/an-ie6-compatible-solution-for-hover/">An IE6-compatible solution for :hover</a></span>]]></description>
			<content:encoded><![CDATA[<p>Something I like to incorporate on web sites with tables is automatic background highlighting of the row that the mouse is hovering over. This is easy to do with CSS:</p>
<pre class="brush: css; ">

table.hover tr:hover
{
	background-color:#ffffcc;
}
</pre>
<p>All you need to do is give your <code>table</code> tag the hover class, and your mouseover hover background color works!</p>
<p>In all browsers except IE6, of course. IE6 only supports the <code>:hover</code> pseudo-class on anchor (<code><a></a></code>) tags. (There&#8217;s <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fblogs.msdn.com%2Fie%2Farchive%2F2005%2F07%2F29%2F445242.aspx&sref=rss">lots of other things</a> that IE doesn&#8217;t support or supports wrong, but that&#8217;s a story for another day.)</p>
<p>How can we get IE6 to hover our table rows? By using a little JavaScript and the <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.prototypejs.org&sref=rss">Prototype library</a>. Our solution requires two steps:</p>
<ol>
<li>Write some code to automatically detect mouseover and mouseout events on table rows, applying and removing a CSS class to the rows as the events occur.</li>
<li>Add the CSS class to our CSS file.</li>
</ol>
<p>First we&#8217;ll add a tr.hover declaration to our CSS.</p>
<pre class="brush: css; ">

table.hover tr:hover, table.hover tr.hover
{
	background-color:#ffffcc;
}
</pre>
<p>Notice that I kept the <code>table.hover</code> parent selector; this is important, as we&#8217;ll use that to ensure we only apply our hover code to table rows in tables that have the <code>hover</code> class.<sup><a href="#fn1">1</a></sup></p>
<p>To get the class added (and removed) from our table rows, we use Prototype to find all elements that match the CSS selector table.hover tr, and for each one, hook a function to the onmouseover and onmouseout properties.</p>
<pre class="brush: javascript; ">

		$$(&#039;table.hover tr&#039;).each( function(e) {
			e.onmouseover += function() {
				Element.addClassName(e, &#039;hover&#039;);
			};
			e.onmouseout += function() {
				Element.removeClassName(e, &#039;hover&#039;);
			}
		});
</pre>
<p><strong>Problem #1:</strong> The code above is applied to all browsers. We only need it applied to versions of IE prior to 6.0. <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fajaxian.com%2Farchives%2Fdetecting-ie7-in-javascript&sref=rss">A simple hack for this</a> was found at <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fajaxian.com%2F&sref=rss">Ajaxian</a>, and is added below.</p>
<pre class="brush: javascript; ">

	if (!window.XMLHttpRequest)
	{
		$$(&#039;table.hover tr&#039;).each( function(e) {
			e.onmouseover += function()
			{
				Element.addClassName(e, &#039;hover&#039;);
			};
			e.onmouseout += function()
			{
				Element.removeClassName(e, &#039;hover&#039;);
			}
		});
	}
</pre>
<p><strong>Problem #2:</strong> What if our event model already declared an event on the onmouseover or onmouseout properties? The script above would clear any existing event handlers. The solution is to use Prototype&#8217;s <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.prototypejs.org%2Fapi%2Fevent%2Fobserve&sref=rss">Event.observe</a> method to hook the functions.</p>
<pre class="brush: javascript; ">

	if (!window.XMLHttpRequest)
	{
		$$(&#039;table.hover tr&#039;).each( function(e) {
			Event.observe(e, &#039;mouseover&#039;, function() {
				Element.addClassName(e, &#039;hover&#039;);
			});
			Event.observe(e, &#039;mouseout&#039;, function() {
				Element.removeClassName(e, &#039;hover&#039;);
			});
		});
	}
</pre>
<p><strong>Problem #3:</strong> If the JavaScript runs before the page loads, it may not apply the event handlers to our table. This is also resolved by using Event.observe to run the above code only after the window loads.</p>
<pre class="brush: javascript; ">

if (!window.XMLHttpRequest)
{
	Event.observe(window, &#039;load&#039;, function() {
		$$(&#039;table.hover tr&#039;).each( function(e) {
			Event.observe(e, &#039;mouseover&#039;, function() {
				Element.addClassName(e, &#039;hover&#039;);
			});
			Event.observe(e, &#039;mouseout&#039;, function() {
				Element.removeClassName(e, &#039;hover&#039;);
			});
		)};
	)};
}
</pre>
<p>There you have it &#8212; a :hover hack for IE6 that doesn&#8217;t break IE7 or Firefox. It should work with all other modern browsers, though some old browsers may have issues with it. If you know of any browsers which break with this solution, let me know.</p>
<hr />
<p><a name="fn1"></a><strong>1</strong> The use of the class name hover caused a problem when including <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fdeveloper.yahoo.com%2Fyui%2Fbutton%2F&sref=rss">YUI&#8217;s Button</a> CSS code. In their CSS, they have a CSS selector for <code>.yuibutton.hover</code>. Apparently, IE6&#8242;s issue with these selectors caused my entire table to pick up the CSS from <code>.yuibutton.hover</code>. To fix this, I renamed YUI&#8217;s CSS selector to <code>.yuibutton.yuihover</code> and updated their JavaScript (just search/replace <code>'hover'</code> with <code>'yuihover'</code>).</p>
<img src="http://www.sidesofmarch.com/?ak_action=api_record_view&id=36&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.sidesofmarch.com/index.php/archive/2007/04/23/an-ie6-compatible-solution-for-hover/' addthis:title='An IE6-compatible solution for :hover ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.sidesofmarch.com/index.php/archive/2007/04/23/an-ie6-compatible-solution-for-hover/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Customizing TableKit to stripe column groups</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/04/18/customizing-tablekit-to-stripe-column-groups/</link>
		<comments>http://www.sidesofmarch.com/index.php/archive/2007/04/18/customizing-tablekit-to-stripe-column-groups/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 23:53:27 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[HTML & CSS]]></category>

		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/04/18/customizing-tablekit-to-stripe-column-groups/</guid>
		<description><![CDATA[<p>I&#8217;m a big fan of <a href="http://www.millstream.com.au/view/code/tablekit/">TableKit</a>, a JavaScript library (based on <a href="http://www.prototypejs.org">Prototype</a>) that provides client-side sorting, row striping, column resizing, and more. (<a href="http://www.millstream.com.au/upload/code/tablekit/">Check out their demo</a> to see more.) There&#8217;s one feature I needed on a recent project that was missing: the ability to stripe column groups (defined with the colgroup tag) with alternating background colors (as you would stripe rows of alternating colors).  It was easy to add this functionality to TableKit by adding the following JavaScript code to the TableKit library.</p>


TableKit.ColGroups = {
	stripe : function(table) {
		var colgroups = table.getElementsBySelector(&#039;colgroup&#039;);
		colgroups.each(function(cg,i) {
			TableKit.ColGroups.addStripeClass(table,cg,i);
		});
	},
	addStripeClass : function(t,cg,i) {
		t = t &#124;&#124; cg.up(&#039;table&#039;);
		var op = TableKit.option(&#039;colgroupEvenClass colgroupOddClass&#039;, t.id);
		$(cg).removeClassName(op[0]).removeClassName(op[1]).addClassName(
			((i+1)%2 === 0 ? op[0] : op[1]));
	},
	hide : function(colgroup) {
		Element.setStyle(colgroup,{visibility:&#039;collapse&#039;});
	}
};

<p>The code above expects two new TableKit options, named colgroupEvenClass and colgroupOddClass. To add those as available options to TableKit, find the section of code below and add the two lines named colgroupEvenClass and colgroupOddClass.</p>


	...
	options : {
		autoLoad : true,
		stripe : true,
		sortable : true,
		resizable : true,
		editable <span style="color:#777"> . . .<br /><br />&#8594; Read More: <a href="http://www.sidesofmarch.com/index.php/archive/2007/04/18/customizing-tablekit-to-stripe-column-groups/">Customizing TableKit to stripe column groups</a></span>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a big fan of <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.millstream.com.au%2Fview%2Fcode%2Ftablekit%2F&sref=rss">TableKit</a>, a JavaScript library (based on <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.prototypejs.org&sref=rss">Prototype</a>) that provides client-side sorting, row striping, column resizing, and more. (<a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.millstream.com.au%2Fupload%2Fcode%2Ftablekit%2F&sref=rss">Check out their demo</a> to see more.) There&#8217;s one feature I needed on a recent project that was missing: the ability to stripe column groups (defined with the colgroup tag) with alternating background colors (as you would stripe rows of alternating colors).  It was easy to add this functionality to TableKit by adding the following JavaScript code to the TableKit library.</p>
<pre class="brush: javascript; ">

TableKit.ColGroups = {
	stripe : function(table) {
		var colgroups = table.getElementsBySelector(&#039;colgroup&#039;);
		colgroups.each(function(cg,i) {
			TableKit.ColGroups.addStripeClass(table,cg,i);
		});
	},
	addStripeClass : function(t,cg,i) {
		t = t || cg.up(&#039;table&#039;);
		var op = TableKit.option(&#039;colgroupEvenClass colgroupOddClass&#039;, t.id);
		$(cg).removeClassName(op[0]).removeClassName(op[1]).addClassName(
			((i+1)%2 === 0 ? op[0] : op[1]));
	},
	hide : function(colgroup) {
		Element.setStyle(colgroup,{visibility:&#039;collapse&#039;});
	}
};
</pre>
<p>The code above expects two new TableKit options, named <code>colgroupEvenClass</code> and <code>colgroupOddClass</code>. To add those as available options to TableKit, find the section of code below and add the two lines named <code>colgroupEvenClass</code> and <code>colgroupOddClass</code>.</p>
<pre class="brush: javascript; ">

	...
	options : {
		autoLoad : true,
		stripe : true,
		sortable : true,
		resizable : true,
		editable : true,
		rowEvenClass : &#039;roweven&#039;,
		rowOddClass : &#039;rowodd&#039;,
		sortableSelector : [&#039;table.sortable&#039;],
		columnClass : &#039;sortcol&#039;,
		descendingClass : &#039;sortdesc&#039;,
		ascendingClass : &#039;sortasc&#039;,
		noSortClass : &#039;nosort&#039;,
		sortFirstAscendingClass : &#039;sortfirstasc&#039;,
		sortFirstDecendingClass : &#039;sortfirstdesc&#039;,
		resizableSelector : [&#039;table.resizable&#039;],
		minWidth : 10,
		showHandle : true,
		resizeOnHandleClass : &#039;resize-handle-active&#039;,
		editableSelector : [&#039;table.editable&#039;],
		formClassName : &#039;editable-cell-form&#039;,
		noEditClass : &#039;noedit&#039;,
		editAjaxURI : &#039;/&#039;,
		editAjaxOptions : {},
		colgroupEvenClass : &#039;colgroupeven&#039;,
		colgroupOddClass : &#039;colgroupodd&#039;
	},
	...
</pre>
<p>With that, you can now stripe your column groups by doing the following. The example below assumes a table whose id is mytable.</p>
<pre class="brush: javascript; ">

TableKit.ColGroups.stripe($(&#039;mytable&#039;));
</pre>
<p>That command will apply two classes to your colgroup tags &#8212; by default, colgroupEven and colgroupOdd. Most modern browsers will pass down the background color for a colgroup to its table cells, &quot;striping&quot; your column groups.</p>
<img src="http://www.sidesofmarch.com/?ak_action=api_record_view&id=33&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.sidesofmarch.com/index.php/archive/2007/04/18/customizing-tablekit-to-stripe-column-groups/' addthis:title='Customizing TableKit to stripe column groups ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.sidesofmarch.com/index.php/archive/2007/04/18/customizing-tablekit-to-stripe-column-groups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE7 reverses table rows during Insertion.After</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/03/20/ie7-reverses-table-rows-during-insertionafter/</link>
		<comments>http://www.sidesofmarch.com/index.php/archive/2007/03/20/ie7-reverses-table-rows-during-insertionafter/#comments</comments>
		<pubDate>Tue, 20 Mar 2007 14:43:13 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[HTML & CSS]]></category>

		<guid isPermaLink="false">http://site366.mysite4now.com/compsims/sidesofmarch/index.php/archive/2007/04/12/ie7-reverses-table-rows-during-insertionafter/</guid>
		<description><![CDATA[<p>I found yet another interesting bug in IE7, related to using <a href="http://www.prototypejs.org/">Prototype</a>&#8216;s <a href="http://www.prototypejs.org/api/insertion#method-after">Insertion.After</a> command to insert additional table rows into an existing table. Apparently, IE7 will reverse the order of the table rows being inserted. As a proof of concept, I&#8217;ve set up an <a href="http://www.sidesofmarch.com/wp-content/uploads/files/ie7tableinsertbug.htm">ie7 table insert bug test page</a> to prove my point.</p>
<p>Here&#8217;s how to duplicate this bug.</p>

Create a new web page (we&#8217;ll call it test.htm).
Create a &#60;table&#62; and add a few rows.
Give one row a specific id (such as id=&#34;insertAfterThis&#34;).
Create a separate web page (call it testdata.htm) with more table rows &#8212; just the &#60;tr&#62;...&#60;/tr&#62;, nothing else.
Add the following JavaScript to run after the window loads:
new Ajax.Request('testdata.htm', { method:'get', onSuccess:function(transport) { new Insertion.After('insertAfterThis', transport.responseText); } });
Load the test.htm page in Firefox, and see how the rows are inserted in the order they exist in the testdata.htm file.
Load the test.htm page in IE, and see how the order of the rows is reversed.

<p>It&#8217;s quite a frustrating bug, <span style="color:#777"> . . .<br /><br />&#8594; Read More: <a href="http://www.sidesofmarch.com/index.php/archive/2007/03/20/ie7-reverses-table-rows-during-insertionafter/">IE7 reverses table rows during Insertion.After</a></span>]]></description>
			<content:encoded><![CDATA[<p>I found yet another interesting bug in IE7, related to using <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.prototypejs.org%2F&sref=rss">Prototype</a>&#8216;s <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.prototypejs.org%2Fapi%2Finsertion%23method-after&sref=rss">Insertion.After</a> command to insert additional table rows into an existing table. Apparently, IE7 will reverse the order of the table rows being inserted. As a proof of concept, I&#8217;ve set up an <a href="http://www.sidesofmarch.com/wp-content/uploads/files/ie7tableinsertbug.htm">ie7 table insert bug test page</a> to prove my point.</p>
<p>Here&#8217;s how to duplicate this bug.</p>
<ol>
<li>Create a new web page (we&#8217;ll call it test.htm).</li>
<li>Create a <code>&lt;table&gt;</code> and add a few rows.</li>
<li>Give one row a specific id (such as <code>id=&quot;insertAfterThis&quot;</code>).</li>
<li>Create a separate web page (call it testdata.htm) with more table rows &#8212; just the <code>&lt;tr&gt;...&lt;/tr&gt;</code>, nothing else.</li>
<li>Add the following JavaScript to run after the window loads:<br />
<code>new Ajax.Request('testdata.htm', { method:'get', onSuccess:function(transport) { new Insertion.After('insertAfterThis', transport.responseText); } });</code></li>
<li>Load the test.htm page in Firefox, and see how the rows are inserted in the order they exist in the testdata.htm file.</li>
<li>Load the test.htm page in IE, and see how the order of the rows is reversed.</li>
</ol>
<p>It&#8217;s quite a frustrating bug, because there&#8217;s apparently only two ways to work around it:</p>
<ol>
<li>Figure out a way to add markup that forces IE to add the rows correctly.<br />
OR</li>
<li>Have IE receive the table rows from your Ajax call in reverse order (so it&#8217;ll reverse it again into the correct order).</li>
</ol>
<p>Considering we&#8217;re not even sure if #1 is possible, it&#8217;s a very frustrating bug. Some may say it&#8217;s a bug with the Prototype library, but I doubt it, since Prototype is simply inserting text &#8212; it has no idea there&#8217;s a table involved. IE7 reveals <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.gtalbot.org%2FBrowserBugsSection%2FMSIE7Bugs%2F&sref=rss">yet another illogical bug</a>.</p>
<img src="http://www.sidesofmarch.com/?ak_action=api_record_view&id=27&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.sidesofmarch.com/index.php/archive/2007/03/20/ie7-reverses-table-rows-during-insertionafter/' addthis:title='IE7 reverses table rows during Insertion.After ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.sidesofmarch.com/index.php/archive/2007/03/20/ie7-reverses-table-rows-during-insertionafter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft OKs community development of CSS Friendly Control Adapters</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/03/07/microsoft-oks-community-development-of-css-friendly-control-adapters/</link>
		<comments>http://www.sidesofmarch.com/index.php/archive/2007/03/07/microsoft-oks-community-development-of-css-friendly-control-adapters/#comments</comments>
		<pubDate>Wed, 07 Mar 2007 18:11:59 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/03/07/microsoft-oks-community-development-of-css-friendly-control-adapters/</guid>
		<description><![CDATA[<p>Back in late 2006, I modified Microsoft&#8217;s <a href="http://www.asp.net/cssadapters">CSS Friendly ASP.Net 2.0 Control Adapters</a> to be distributable as a single DLL. Since that time, the code I wrote was <a href="http://demarzo.net/articles/1056.aspx">downloaded from this web site</a>, and everything seemed good, at least until the server crashed. After being prodded by a few people in the ASP.Net community, I moved this little project over to <a href="http://www.codeplex.com/cssfriendly">CodePlex</a>. Before doing so, I checked to make sure this was OK with <a href="http://www.scottgu.com/">Scott Guthrie</a>, the grand poohbah of ASP.Net at Microsoft. (You&#8217;ve got to cover your basis!)</p>
<p>Anyway, today I read a post on the ASP.Net forums stating that <a href="http://forums.asp.net/thread/1609779.aspx">Microsoft OKs community development of the CSS Friendly Control Adapters</a>. In short, this is a good thing for the users of this product, for reasons that are explained in that thread, and it looks like I&#8217;ll be more involved with the ongoing development of these adapters in the future. It&#8217;s also nice to see your efforts <span style="color:#777"> . . .<br /><br />&#8594; Read More: <a href="http://www.sidesofmarch.com/index.php/archive/2007/03/07/microsoft-oks-community-development-of-css-friendly-control-adapters/">Microsoft OKs community development of CSS Friendly Control Adapters</a></span>]]></description>
			<content:encoded><![CDATA[<p>Back in late 2006, I modified Microsoft&#8217;s <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.asp.net%2Fcssadapters&sref=rss">CSS Friendly ASP.Net 2.0 Control Adapters</a> to be distributable as a single DLL. Since that time, the code I wrote was <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fdemarzo.net%2Farticles%2F1056.aspx&sref=rss">downloaded from this web site</a>, and everything seemed good, at least until the server crashed. After being prodded by a few people in the ASP.Net community, I moved this little project over to <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.codeplex.com%2Fcssfriendly&sref=rss">CodePlex</a>. Before doing so, I checked to make sure this was OK with <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.scottgu.com%2F&sref=rss">Scott Guthrie</a>, the grand poohbah of ASP.Net at Microsoft. (You&#8217;ve got to cover your basis!)</p>
<p>Anyway, today I read a post on the ASP.Net forums stating that <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fforums.asp.net%2Fthread%2F1609779.aspx&sref=rss">Microsoft OKs community development of the CSS Friendly Control Adapters</a>. In short, this is a good thing for the users of this product, for reasons that are explained in that thread, and it looks like I&#8217;ll be more involved with the ongoing development of these adapters in the future. It&#8217;s also nice to see your efforts noticed by the largest software development company in the world. <img src='http://www.sidesofmarch.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I will keep the pages on this site that mentioned these adapters, but I highly suggest everyone who used them to bookmark the <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.codeplex.com%2Fcssfriendly&sref=rss">CodePlex project &#8220;CSSFriendly&#8221;</a> and use that as their source of code and information going forward.</p>
<img src="http://www.sidesofmarch.com/?ak_action=api_record_view&id=38&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.sidesofmarch.com/index.php/archive/2007/03/07/microsoft-oks-community-development-of-css-friendly-control-adapters/' addthis:title='Microsoft OKs community development of CSS Friendly Control Adapters ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.sidesofmarch.com/index.php/archive/2007/03/07/microsoft-oks-community-development-of-css-friendly-control-adapters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple rounded corners</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2006/10/12/simple-rounded-corners/</link>
		<comments>http://www.sidesofmarch.com/index.php/archive/2006/10/12/simple-rounded-corners/#comments</comments>
		<pubDate>Thu, 12 Oct 2006 18:44:14 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>

		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2006/10/12/simple-rounded-corners/</guid>
		<description><![CDATA[<p>A friend of mine was trying to get a rounded corner bar at the top of some web content. He already had the rounded corner images but didn&#8217;t know the HTML and CSS markup. I sent him over the following snippet of code as an example:</p>


    &#60;div style=&#34;width:100%;background-color:blue;height:14px;margin:0px;padding:0px;font-size:5%;&#34;&#62;
        &#60;div style=&#34;float:left;background-image:url(&#039;left.gif&#039;);width:14px;height:14px;&#34;&#62;
        &#60;/div&#62;
        &#60;div style=&#34;float:right;background-image:url(&#039;right.gif&#039;);width:14px;height:14px;&#34;&#62;
        &#60;/div&#62;
    &#60;/div&#62;

<p>To understand, note the following:</p>

The width:100% should be set the width appropriate to your content.
The width and height (14px in the example above) should be replaced by the actual width and height of your rounded corner images.
What&#8217;s with the font-size:5%? Making the font size very small will ensure that any white space will not create a block larger than the desired height (in our case, 14px).

<p>The following bar was made using the above <span style="color:#777"> . . .<br /><br />&#8594; Read More: <a href="http://www.sidesofmarch.com/index.php/archive/2006/10/12/simple-rounded-corners/">Simple rounded corners</a></span>]]></description>
			<content:encoded><![CDATA[<p>A friend of mine was trying to get a rounded corner bar at the top of some web content. He already had the rounded corner images but didn&#8217;t know the HTML and CSS markup. I sent him over the following snippet of code as an example:</p>
<pre class="brush: html; ">

    &lt;div style=&quot;width:100%;background-color:blue;height:14px;margin:0px;padding:0px;font-size:5%;&quot;&gt;
        &lt;div style=&quot;float:left;background-image:url(&#039;left.gif&#039;);width:14px;height:14px;&quot;&gt;
        &lt;/div&gt;
        &lt;div style=&quot;float:right;background-image:url(&#039;right.gif&#039;);width:14px;height:14px;&quot;&gt;
        &lt;/div&gt;
    &lt;/div&gt;
</pre>
<p>To understand, note the following:</p>
<ul>
<li>The <code>width:100%</code> should be set the width appropriate to your content.</li>
<li>The width and height (<code>14px</code> in the example above) should be replaced by the actual width and height of your rounded corner images.</li>
<li>What&#8217;s with the <code>font-size:5%</code>? Making the font size very small will ensure that any white space will not create a block larger than the desired height (in our case, <code>14px</code>).</li>
</ul>
<p>The following bar was made using the above content, using images from this web site.</p>
<div style="width:100%;background-color:blue;height:10px;margin:0px;padding:0px;font-size:5%;">
<div style="float:left;background-image:url('http://www.sidesofmarch.com/wp-content/themes/giraffe2/skin/blue/right-top-corner.gif');width:11px;height:10px;">
  </div>
<div style="float:right;background-image:url('http://www.sidesofmarch.com/wp-content/themes/giraffe2/skin/blue/left-top-corner.gif');width:11px;height:10px;">
  </div>
</div>
<img src="http://www.sidesofmarch.com/?ak_action=api_record_view&id=56&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.sidesofmarch.com/index.php/archive/2006/10/12/simple-rounded-corners/' addthis:title='Simple rounded corners ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.sidesofmarch.com/index.php/archive/2006/10/12/simple-rounded-corners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Adapters for Membership Controls (working versions)</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2006/09/19/css-adapters-for-membership-controls-working-versions/</link>
		<comments>http://www.sidesofmarch.com/index.php/archive/2006/09/19/css-adapters-for-membership-controls-working-versions/#comments</comments>
		<pubDate>Tue, 19 Sep 2006 14:08:10 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[HTML & CSS]]></category>

		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2006/09/19/css-adapters-for-membership-controls-working-versions/</guid>
		<description><![CDATA[<p>On September 6, the guys at Microsoft released the <a href="http://www.asp.net/cssadapters/Default.aspx">second beta version of their CSS Friendly ASP.Net 2.0 Control Adapters</a>. In addition to bug fixes were CSS implementations of the membership controls &#8211; specifically, the Login, CreateUserWizard, PasswordRecovery, LoginStatus, and ChangePassword controls.</p>
<p>Unfortunately for the membership controls, it didn&#8217;t really work. This bothered me, because I&#8217;ve been using <a href="http://www.sidesofmarch.com/index.php/archive/2006/05/05/removing-the-table-from-aspnet-controls-a-fully-working-version/">a hacked version of these controls that strips out TABLE-related tags</a> for some time. The hacks work, but they&#8217;re hacks, and they have some quirky behavior.</p>
<p>I wrote <a href="http://forums.asp.net/thread/1399784.aspx">a post on the ASP.Net forums</a>, in which I described the problem.</p>
<blockquote><p>I was glad to see that membership controls were added to the latest beta release. However, I did notice that all of them (with one exception) still put a TABLE wrapper around the content when using a templated control. It happens on the Login and PasswordRecovery controls&#8230;</p>
<p>Ironically, the CreateUserWizard did not add a table wrapper around the CreateUserWizardStep &#8212; but it did add <span style="color:#777"> . . .<br /><br />&#8594; Read More: <a href="http://www.sidesofmarch.com/index.php/archive/2006/09/19/css-adapters-for-membership-controls-working-versions/">CSS Adapters for Membership Controls (working versions)</a></span>]]></description>
			<content:encoded><![CDATA[<p>On September 6, the guys at Microsoft released the <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.asp.net%2Fcssadapters%2FDefault.aspx&sref=rss">second beta version of their CSS Friendly ASP.Net 2.0 Control Adapters</a>. In addition to bug fixes were CSS implementations of the membership controls &#8211; specifically, the Login, CreateUserWizard, PasswordRecovery, LoginStatus, and ChangePassword controls.</p>
<p>Unfortunately for the membership controls, it didn&#8217;t really work. This bothered me, because I&#8217;ve been using <a href="http://www.sidesofmarch.com/index.php/archive/2006/05/05/removing-the-table-from-aspnet-controls-a-fully-working-version/">a hacked version of these controls that strips out TABLE-related tags</a> for some time. The hacks work, but they&#8217;re hacks, and they have some quirky behavior.</p>
<p>I wrote <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fforums.asp.net%2Fthread%2F1399784.aspx&sref=rss">a post on the ASP.Net forums</a>, in which I described the problem.</p>
<blockquote><p>I was glad to see that membership controls were added to the latest beta release. However, I did notice that all of them (with one exception) still put a TABLE wrapper around the content when using a templated control. It happens on the Login and PasswordRecovery controls&#8230;</p>
<p>Ironically, the CreateUserWizard did not add a table wrapper around the CreateUserWizardStep &#8212; but it did add it around the CompleteWizardStep.</p></blockquote>
<p>Russ Helfand (obviously one of the guys working on the CSS adapters) responded and gave some tips. After some trial and error, we figured out some implementation updates that fix the problem for the Login, CreateUserWizard, and PasswordRecovery controls &#8212; an approach that can likely be used to fix other &#8220;broken&#8221; CSS adapters, too. A snippet of the solution follows.</p>
<p>Russ Helfand suggested:</p>
<blockquote><p>Let&#8217;s look at the LoginAdapter as an example, <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.asp.net%2FCSSAdapters%2Fsrcviewer.aspx%3Finspect%3D%252fCSSAdapters%252fMembership%252fLogin.aspx&sref=rss">http://www.asp.net/CSSAdapters/srcviewer.aspx?inspect=%2fCSSAdapters%2fMembership%2fLogin.aspx</a>. In particular, I want you to look at line 125 where the template container is being rendered. I&#8217;m considering changing that from:</p>
<p><strong>container.RenderControl(writer);</strong></p>
<p>To:<br />
<strong><br />
foreach (Control c in container.Controls)<br />
{<br />
  c.RenderControl(writer);<br />
}</strong></p>
<p>It would be helpful if you could try that fix out locally and let me know if it works well for you. </p></blockquote>
<p>I tried it, and it worked!</p>
<p>I used a similar approach for other controls. Take the <strong>CreateUserWizard</strong> adapter as an example. Since this adapter only added the <code>table</code> in the Completed step, I made the following change in the <code>RenderContents()</code> method (around line 181):</p>
<pre class="brush: c-sharp; ">

        activeStep.RenderControl(writer);
</pre>
<p>&#8230; changes to: </p>
<pre class="brush: c-sharp; ">

        if (activeStep.StepType == WizardStepType.Complete)
            foreach (Control c in activeStep.Controls[0].Controls[0].Controls[0].Controls[0].Controls)
            {
                c.RenderControl(writer);
            }
            else
                activeStep.RenderControl(writer);
</pre>
<p>For the <strong>PasswordRecovery</strong> adapter, there&#8217;s three places to change &#8212; each instance of the <code>RenderControl()</code> method in the <code>RenderContents()</code> method should be commented out and replaced by the <code>foreach</code> loop.</p>
<pre class="brush: c-sharp; ">

    //passwordRecovery.UserNameTemplateContainer.RenderControl(writer);
    foreach (Control c in passwordRecovery.UserNameTemplateContainer.Controls)
        c.RenderControl(writer);

    ...

    //passwordRecovery.QuestionTemplateContainer.RenderControl(writer);
    foreach (Control c in passwordRecovery.QuestionTemplateContainer.Controls)
        c.RenderControl(writer);

    ...

    //passwordRecovery.SuccessTemplateContainer.RenderControl(writer);
    foreach (Control c in passwordRecovery.SuccessTemplateContainer.Controls)
        c.RenderControl(writer);
</pre>
<p>That&#8217;s some weird behavior, but it works, and it doesn&#8217;t seem to break any of the functionality. Be sure to check out <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fforums.asp.net%2Fthread%2F1399784.aspx&sref=rss">the complete thread on the ASP.Net forums</a> for details.</p>
<img src="http://www.sidesofmarch.com/?ak_action=api_record_view&id=63&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.sidesofmarch.com/index.php/archive/2006/09/19/css-adapters-for-membership-controls-working-versions/' addthis:title='CSS Adapters for Membership Controls (working versions) ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.sidesofmarch.com/index.php/archive/2006/09/19/css-adapters-for-membership-controls-working-versions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A wonderfully simple, wonderfully useful IE CSS hack</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2006/09/08/a-wonderfully-simple-wonderfully-useful-ie-css-hack/</link>
		<comments>http://www.sidesofmarch.com/index.php/archive/2006/09/08/a-wonderfully-simple-wonderfully-useful-ie-css-hack/#comments</comments>
		<pubDate>Fri, 08 Sep 2006 19:53:57 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[HTML & CSS]]></category>

		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2006/09/08/a-wonderfully-simple-wonderfully-useful-ie-css-hack/</guid>
		<description><![CDATA[<p>For the past few years, I&#8217;ve been doing a lot of web development. Part of my design mantra (at least from a code perspective) is table-less design using CSS that works in as many browsers as humanly possible.</p>
<p>Since <strong>Firefox</strong>&#8216;s support for CSS standards is superior to that of <strong>IE</strong>, I generally code everything so it looks good in Firefox, then apply hacks to get it to work in IE. (Most other browsers require minimal tweaking once something works well in Firefox and IE.) At times, the hack is to add some IE-specific CSS code, which is usually done using the asterisk hack:</p>


.myClass {
 background-color:white;
}
* html body .myclass {
 background-color:black;
}

<p>Only IE recognizes the second line, so in IE, the background color of any element with the myClass class will be black; for all other browsers, it will be white.</p>
<p>However, this hack can be replaced by one I found today, which is beautifully simple and elegant: add an underscore before the CSS property <span style="color:#777"> . . .<br /><br />&#8594; Read More: <a href="http://www.sidesofmarch.com/index.php/archive/2006/09/08/a-wonderfully-simple-wonderfully-useful-ie-css-hack/">A wonderfully simple, wonderfully useful IE CSS hack</a></span>]]></description>
			<content:encoded><![CDATA[<p>For the past few years, I&#8217;ve been doing a lot of web development. Part of my design mantra (at least from a code perspective) is table-less design using CSS that works in as many browsers as humanly possible.</p>
<p>Since <strong>Firefox</strong>&#8216;s support for CSS standards is superior to that of <strong>IE</strong>, I generally code everything so it looks good in Firefox, then apply hacks to get it to work in IE. (Most other browsers require minimal tweaking once something works well in Firefox and IE.) At times, the hack is to add some IE-specific CSS code, which is usually done using the asterisk hack:</p>
<pre class="brush: css; ">

.myClass {
 background-color:white;
}
* html body .myclass {
 background-color:black;
}
</pre>
<p>Only IE recognizes the second line, so in IE, the background color of any element with the <code>myClass</code> class will be black; for all other browsers, it will be white.</p>
<p>However, this hack can be replaced by one I found today, which is beautifully simple and elegant: add an underscore before the CSS property name.</p>
<pre class="brush: css; ">

body {
 background: green; /* show to Mozilla/Safari/Opera */
 _background: red; /* show to IE */
}
</pre>
<p>It works in IE Windows only, according to the guy who <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fnoscope.com%2Fjournal%2F2005%2F01%2Fshowing-css-to-ie-only-the-underscore-hack&sref=rss">wrote about it on his blog</a>, <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fnoscope.com%2Fcolophon%2F&sref=rss">Joen Asmussen</a>. Hats off to you, Joen &#8212; a great solution not only in its simplicity (one extra character) and in its readability (you can visualize the IE-only hack in the same content as your non-IE CSS).</p>
<p>For more on CSS hacking with IE, check out <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.maratz.com%2Fblog%2Farchives%2F2005%2F06%2F16%2Fessentials-of-css-hacking-for-internet-explorer%2F&sref=rss">Essentials of CSS Hacking For Internet Explorer</a> by Marko Dugonjic. For more info on CSS standards support in modern browsers, check out <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.webdevout.net%2Fbrowser_support.php&sref=rss">Web Browser Standards Support</a> by David Hammond.</p>
<img src="http://www.sidesofmarch.com/?ak_action=api_record_view&id=60&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.sidesofmarch.com/index.php/archive/2006/09/08/a-wonderfully-simple-wonderfully-useful-ie-css-hack/' addthis:title='A wonderfully simple, wonderfully useful IE CSS hack ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.sidesofmarch.com/index.php/archive/2006/09/08/a-wonderfully-simple-wonderfully-useful-ie-css-hack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Removing the TABLE from the CreateUserWizard control</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2006/04/18/removing-the-table-from-the-createuserwizard-control/</link>
		<comments>http://www.sidesofmarch.com/index.php/archive/2006/04/18/removing-the-table-from-the-createuserwizard-control/#comments</comments>
		<pubDate>Tue, 18 Apr 2006 23:05:39 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[HTML & CSS]]></category>

		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2006/04/18/removing-the-table-from-the-createuserwizard-control/</guid>
		<description><![CDATA[<p>About two months ago, I wrote a post about <a href="http://www.sidesofmarch.com/index.php/archive/2006/02/28/removing-tables-in-microsofts-aspnet-20-controls/">removing the TABLE from ASP.Net 2.0&#8242;s Login control</a>. The below code will let you do the same from the CreateUserWizard control. One important caveat: for this to work (in my limited testing), you must provide a custom template for the ContentTemplate and CustomNavigationTemplate of the CreateUserWizardStep, and for the ContentTemplate of the CompleteWizardStep.</p>


public class CssCreateUserWizard : System.Web.UI.WebControls.CreateUserWizard
{
    protected override void Render( HtmlTextWriter writer )
    {
        if ( CreateUserStep.ContentTemplate != null &#38;&#38; this.ActiveStep == this.CreateUserStep )
        {
            WebControl creatediv = new WebControl( HtmlTextWriterTag.Div );
            creatediv.CssClass = this.CssClass;
            CreateUserStep.ContentTemplate.InstantiateIn( creatediv );
          <span style="color:#777"> . . .<br /><br />&#8594; Read More: <a href="http://www.sidesofmarch.com/index.php/archive/2006/04/18/removing-the-table-from-the-createuserwizard-control/">Removing the TABLE from the CreateUserWizard control</a></span>]]></description>
			<content:encoded><![CDATA[<p>About two months ago, I wrote a post about <a href="http://www.sidesofmarch.com/index.php/archive/2006/02/28/removing-tables-in-microsofts-aspnet-20-controls/">removing the TABLE from ASP.Net 2.0&#8242;s Login control</a>. The below code will let you do the same from the <code>CreateUserWizard</code> control. One important caveat: for this to work (in my limited testing), you must provide a custom template for the <code>ContentTemplate</code> and <code>CustomNavigationTemplate</code> of the <code>CreateUserWizardStep</code>, and for the <code>ContentTemplate</code> of the <code>CompleteWizardStep</code>.</p>
<pre class="brush: c-sharp; ">

public class CssCreateUserWizard : System.Web.UI.WebControls.CreateUserWizard
{
    protected override void Render( HtmlTextWriter writer )
    {
        if ( CreateUserStep.ContentTemplate != null &amp;&amp; this.ActiveStep == this.CreateUserStep )
        {
            WebControl creatediv = new WebControl( HtmlTextWriterTag.Div );
            creatediv.CssClass = this.CssClass;
            CreateUserStep.ContentTemplate.InstantiateIn( creatediv );
            CreateUserStep.ContentTemplateContainer.Controls.Clear();
            CreateUserStep.ContentTemplateContainer.Controls.Add( creatediv );
            creatediv.RenderControl( writer );

            if ( CreateUserStep.CustomNavigationTemplate != null )
            {
                WebControl navdiv = new WebControl(HtmlTextWriterTag.Div);
                navdiv.CssClass = this.CssClass;
                CreateUserStep.CustomNavigationTemplate.InstantiateIn(navdiv);
                CreateUserStep.CustomNavigationTemplateContainer.Controls.Clear();
                CreateUserStep.CustomNavigationTemplateContainer.Controls.Add(navdiv);
                navdiv.RenderControl(writer);
            }
        }

        if ( CompleteStep.ContentTemplate != null &amp;&amp; this.ActiveStep == this.CompleteStep )
        {
            WebControl completediv = new WebControl( HtmlTextWriterTag.Div );
            completediv.CssClass = this.CssClass;
            CompleteStep.ContentTemplate.InstantiateIn( completediv );
            CompleteStep.ContentTemplateContainer.Controls.Clear();
            CompleteStep.ContentTemplateContainer.Controls.Add( completediv );
            completediv.RenderControl( writer );
        }
    }
}
</pre>
<img src="http://www.sidesofmarch.com/?ak_action=api_record_view&id=84&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.sidesofmarch.com/index.php/archive/2006/04/18/removing-the-table-from-the-createuserwizard-control/' addthis:title='Removing the TABLE from the CreateUserWizard control ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.sidesofmarch.com/index.php/archive/2006/04/18/removing-the-table-from-the-createuserwizard-control/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Removing tables in Microsoft&#8217;s ASP.Net 2.0 Controls</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2006/02/28/removing-tables-in-microsofts-aspnet-20-controls/</link>
		<comments>http://www.sidesofmarch.com/index.php/archive/2006/02/28/removing-tables-in-microsofts-aspnet-20-controls/#comments</comments>
		<pubDate>Tue, 28 Feb 2006 20:09:56 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[HTML & CSS]]></category>

		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2006/02/28/removing-tables-in-microsofts-aspnet-20-controls/</guid>
		<description><![CDATA[<p>Microsoft has been touting ASP.Net 2.0 as taking great strides towards XHTML compatibility and meeting common accessibility guidelines. However, some controls still add table tags around them, despite your best efforts to avoid using tables. The new Login control is one of those.</p>
<p>For me, the table wrapper around the Login control was causing rendering problems. I was using a <a href="http://www.quirksmode.org/css/forms.html">pure CSS layout with no tables</a> for the login form, and the presence of the table tag wrapped around the control was breaking my layout. A quick Google search (<a href="http://www.google.com/search?q=asp.net+2.0+login+control+table">q=asp.net+2.0+login+control+table</a>) found a <a href="http://blog.dreamprojections.com/archive/2005/04/08/783.aspx">blog post that outlined a solution</a>.</p>
<p>The fix was simple: create a new class, inherit from the existing System.Web.UI.WebControls.Login class, and override the Render method. A few lines of code, and the table wrapper was replaced with a div wrapper. There was one catch: the version posted on the aforementioned blog didn&#8217;t include the CssClass attribute on the new control. One extra line of code fixed that.</p>
<p>Below is <span style="color:#777"> . . .<br /><br />&#8594; Read More: <a href="http://www.sidesofmarch.com/index.php/archive/2006/02/28/removing-tables-in-microsofts-aspnet-20-controls/">Removing tables in Microsoft&#8217;s ASP.Net 2.0 Controls</a></span>]]></description>
			<content:encoded><![CDATA[<p>Microsoft has been touting ASP.Net 2.0 as taking great strides towards XHTML compatibility and meeting common accessibility guidelines. However, some controls still add <code>table</code> tags around them, despite your best efforts to avoid using tables. The new Login control is one of those.</p>
<p>For me, the table wrapper around the Login control was causing rendering problems. I was using a <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.quirksmode.org%2Fcss%2Fforms.html&sref=rss">pure CSS layout with no tables</a> for the login form, and the presence of the table tag wrapped around the control was breaking my layout. A quick Google search (<a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3Dasp.net%2B2.0%2Blogin%2Bcontrol%2Btable&sref=rss">q=asp.net+2.0+login+control+table</a>) found a <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fblog.dreamprojections.com%2Farchive%2F2005%2F04%2F08%2F783.aspx&sref=rss">blog post that outlined a solution</a>.</p>
<p>The fix was simple: create a new class, inherit from the existing <code>System.Web.UI.WebControls.Login</code> class, and override the Render method. A few lines of code, and the table wrapper was replaced with a div wrapper. There was one catch: the version posted on the aforementioned blog didn&#8217;t include the <code>CssClass</code> attribute on the new control. One extra line of code fixed that.</p>
<p>Below is the code, all but one line thanks to <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fblog.dreamprojections.com%2F&sref=rss">Alex Gorbatchev of dreamprojections.com</a>:</p>
<pre class="brush: c-sharp; ">

    public class CssLogin : System.Web.UI.WebControls.Login
    {
        protected override void Render( HtmlTextWriter writer )
        {
            WebControl div = new WebControl( HtmlTextWriterTag.Div );

            LayoutTemplate.InstantiateIn( div );

            Controls.Clear();
            Controls.Add( div );

            div.CopyBaseAttributes( this );
            div.CssClass = this.CssClass;
            div.RenderControl( writer );
        }
    }
</pre>
<img src="http://www.sidesofmarch.com/?ak_action=api_record_view&id=61&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.sidesofmarch.com/index.php/archive/2006/02/28/removing-tables-in-microsofts-aspnet-20-controls/' addthis:title='Removing tables in Microsoft&#8217;s ASP.Net 2.0 Controls ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.sidesofmarch.com/index.php/archive/2006/02/28/removing-tables-in-microsofts-aspnet-20-controls/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>New web developer magazine, &quot;Treehouse&quot;</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2005/10/11/new-web-developer-magazine-treehouse/</link>
		<comments>http://www.sidesofmarch.com/index.php/archive/2005/10/11/new-web-developer-magazine-treehouse/#comments</comments>
		<pubDate>Tue, 11 Oct 2005 18:06:27 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>

		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2005/10/11/new-web-developer-magazine-treehouse/</guid>
		<description><![CDATA[<p>The folks from Particletree have <a href="http://particletree.com/notebook/treehouse-now-available/">released the first issue of Treehouse</a>, a magazine dedicated to Web development. Get the first issue &#8211; it&#8217;s a <a href="http://store.particletree.com/">free PDF download</a> &#8211; and considering the reputation of those at <a href="http://particletree.com">Particletree</a>, it&#8217;s worth the cost.  </p>
<a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a <span style="color:#777"> . . .<br /><br />&#8594; Read More: <a href="http://www.sidesofmarch.com/index.php/archive/2005/10/11/new-web-developer-magazine-treehouse/">New web developer magazine, &#34;Treehouse&#34;</a></span>]]></description>
			<content:encoded><![CDATA[<p>The folks from Particletree have <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fparticletree.com%2Fnotebook%2Ftreehouse-now-available%2F&sref=rss">released the first issue of Treehouse</a>, a magazine dedicated to Web development. Get the first issue &#8211; it&#8217;s a <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fstore.particletree.com%2F&sref=rss">free PDF download</a> &#8211; and considering the reputation of those at <a href="http://redirectingat.com?id=17923X751173&xs=1&url=http%3A%2F%2Fparticletree.com&sref=rss">Particletree</a>, it&#8217;s worth the cost. <img src='http://www.sidesofmarch.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<img src="http://www.sidesofmarch.com/?ak_action=api_record_view&id=102&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.sidesofmarch.com/index.php/archive/2005/10/11/new-web-developer-magazine-treehouse/' addthis:title='New web developer magazine, &quot;Treehouse&quot; ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.sidesofmarch.com/index.php/archive/2005/10/11/new-web-developer-magazine-treehouse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

