<?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>Neatly Sliced &#187; ASP.NET</title>
	<atom:link href="http://blog.neatlysliced.com/category/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.neatlysliced.com</link>
	<description>Bread was overrated.</description>
	<lastBuildDate>Thu, 30 Apr 2009 17:53:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Register ASP.NET Controls in Web.config</title>
		<link>http://blog.neatlysliced.com/2009/04/register-aspnet-controls-in-webconfig/</link>
		<comments>http://blog.neatlysliced.com/2009/04/register-aspnet-controls-in-webconfig/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 03:15:50 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://blog.neatlysliced.com/?p=282</guid>
		<description><![CDATA[User Controls in ASP.NET are a great tool - they allow you to consolidate sections of code into a reusable piece that you can use anywhere on your site - or even copy the control to a different site. 
The only issue I had with user controls was that you had to register the code [...]]]></description>
			<content:encoded><![CDATA[<p>User Controls in ASP.NET are a great tool - they allow you to consolidate sections of code into a reusable piece that you can use anywhere on your site - or even copy the control to a different site. </p>
<p>The only issue I had with user controls was that you had to register the code on <em>every.single.page</em> that you wanted to use it on before you could use it. So, that meant something like this at the top of <em>every.single.page</em>:</p>
<div class="igBar"><span id="lvb-3"><a href="#" onclick="javascript:showPlainTxt('vb-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-3">
<div class="vb">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#525050;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;%@ Register assembly=<span style="color: #ff0000;">"Ektron.Cms.Controls"</span> namespace=<span style="color: #ff0000;">"Ektron.Cms.Controls"</span> tagprefix=<span style="color: #ff0000;">"CMS"</span> %&gt;</div>
</li>
<li style="font-weight: bold;background-color:#DFDFDF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;%@ Register src=<span style="color: #ff0000;">"~/webassets/UserControls/WeatherWidget.ascx"</span> tagname=<span style="color: #ff0000;">"Weather"</span> tagprefix=<span style="color: #ff0000;">"NeatlySliced"</span> %&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#525050;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;%@ Register src=<span style="color: #ff0000;">"~/webassets/UserControls/Blog.ascx"</span> tagname=<span style="color: #ff0000;">"Blog"</span> tagprefix=<span style="color: #ff0000;">"NeatlySliced"</span> %&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Oi! The frustration! There has to be a better way!</p>
<p>Some googling resulted in finding the wondeful haacked.com, with the <a href="http://haacked.com/archive/2006/11/14/Register_Custom_Controls_In_Web.config.aspx">article listing my answer</a>. ASP.NET 2.0 allows for registering controls in web.config, thus making it available for all pages and eliminating a potential very long list of controls on every page. </p>
<p>The listings go inside the &lt;controls&gt; tag, within the &lt;pages&gt; section, such as follows:</p>
<div class="igBar"><span id="lxml-4"><a href="#" onclick="javascript:showPlainTxt('xml-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-4">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#525050;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;system</span>.web<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;background-color:#DFDFDF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;pages<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#525050;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;controls<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;background-color:#DFDFDF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;add</span> <span style="color: #000066;">tagPrefix</span>=<span style="color: #ff0000;">"CMS"</span> <span style="color: #000066;">namespace</span>=<span style="color: #ff0000;">"Ektron.Cms.Controls"</span> <span style="color: #000066;">assembly</span>=<span style="color: #ff0000;">"Ektron.Cms.Controls"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#525050;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;add</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"~/webassets/UserControls/WeatherWidget.ascx"</span> <span style="color: #000066;">tagName</span>=<span style="color: #ff0000;">"Weather"</span> <span style="color: #000066;">tagPrefix</span>=<span style="color: #ff0000;">"NeatlySliced"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;background-color:#DFDFDF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;add</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"~/webassets/UserControls/Blog.ascx"</span> <span style="color: #000066;">tagName</span>=<span style="color: #ff0000;">"Blog"</span> <span style="color: #000066;">tagPrefix</span>=<span style="color: #ff0000;">"NeatlySliced"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#525050;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/controls<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;background-color:#DFDFDF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/pages<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#525050;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/system</span>.web </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>You'll note I have Ektron listed in there as well. This is because I was tired of adding the Controls assembly to every page - so not only can you add your own user controls, but assemblies as well. What a life-saver! Your resulting code does not change at all, but you have just eliminated that page heading overhead.</p>
<p>Have you found another item to register in web.config? Leave a comment and share the wealth!</p>
<img src="http://blog.neatlysliced.com/?ak_action=api_record_view&id=282&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.neatlysliced.com/2009/04/register-aspnet-controls-in-webconfig/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CheckBoxList outputs a table by default</title>
		<link>http://blog.neatlysliced.com/2008/12/checkboxlist-outputs-a-table-by-default/</link>
		<comments>http://blog.neatlysliced.com/2008/12/checkboxlist-outputs-a-table-by-default/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 02:34:19 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://blog.neatlysliced.com/?p=250</guid>
		<description><![CDATA[Building an ASP.NET site, I needed to use a server-side CheckBoxList control. Much to my irritation, the server control output each &#60;input type="checkbox" /&#62; in a tr of a table containing the entire list. I thought, how awful!
Fortunately, I found a way for the server control to quickly output each input in spans rather than [...]]]></description>
			<content:encoded><![CDATA[<p>Building an ASP.NET site, I needed to use a server-side CheckBoxList control. Much to my irritation, the server control output each <code>&lt;input type="checkbox" /&gt;</code> in a <code>tr</code> of a <code>table</code> containing the entire list. I thought, how awful!</p>
<p>Fortunately, I found a way for the server control to quickly output each <code>input</code> in <code>span</code>s rather than table rows: <code>CheckBoxListId.RepeatLayout = RepeatLayout.Flow</code></p>
<p>The default value is <code>RepeatLayout.Table</code>. Now my checkboxes are cooler.</p>
<img src="http://blog.neatlysliced.com/?ak_action=api_record_view&id=250&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.neatlysliced.com/2008/12/checkboxlist-outputs-a-table-by-default/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
