<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>dotnetting</title>
	<atom:link href="http://dotnetting.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dotnetting.wordpress.com</link>
	<description>.NET tips, tricks, discussion</description>
	<lastBuildDate>Sun, 13 May 2007 14:37:42 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='dotnetting.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/35e6acca8342dfb4d08c5c237d13bcfa?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>dotnetting</title>
		<link>http://dotnetting.wordpress.com</link>
	</image>
			<item>
		<title>Installing SubSonic Starter Kit 2.0.1</title>
		<link>http://dotnetting.wordpress.com/2007/05/13/installing-subsonic-starter-kit-201/</link>
		<comments>http://dotnetting.wordpress.com/2007/05/13/installing-subsonic-starter-kit-201/#comments</comments>
		<pubDate>Sun, 13 May 2007 14:37:42 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[installation]]></category>
		<category><![CDATA[subsonic]]></category>

		<guid isPermaLink="false">http://dotnetting.wordpress.com/2007/05/13/installing-subsonic-starter-kit-201/</guid>
		<description><![CDATA[Here I will record the steps I took to get the fantastic SubSonic Starter Kit up and running on my PC.

Install  ASP.NET AJAX on your machine.
Create a new web site in Visual Studio 2005
Download the latest version of the SubSonic Starter Kit
Copy the contents of the archive to the root directory of the web [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=19&subd=dotnetting&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here I will record the steps I took to get the fantastic SubSonic Starter Kit up and running on my PC.</p>
<ol>
<li>Install  <a href="http://ajax.asp.net/downloads/">ASP.NET AJAX</a> on your machine.</li>
<li>Create a new web site in Visual Studio 2005</li>
<li>Download the latest version of the <a href="http://www.codeplex.com/actionpack">SubSonic Starter Kit</a></li>
<li>Copy the contents of the archive to the root directory of the web site you created in step 2</li>
<li>Select Build &gt; Rebuild Website from the menu</li>
<li>Hit F5</li>
</ol>
<p>That&#8217;s it. Piece of cake.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetting.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetting.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetting.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetting.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetting.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetting.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetting.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetting.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetting.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetting.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetting.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetting.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=19&subd=dotnetting&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dotnetting.wordpress.com/2007/05/13/installing-subsonic-starter-kit-201/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16606879e4666108d9fab602f431054f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">rowlando</media:title>
		</media:content>
	</item>
		<item>
		<title>Find Controls in Controls recursively using Generics</title>
		<link>http://dotnetting.wordpress.com/2007/03/24/find-controls-in-controls-recursively-using-generics/</link>
		<comments>http://dotnetting.wordpress.com/2007/03/24/find-controls-in-controls-recursively-using-generics/#comments</comments>
		<pubDate>Sat, 24 Mar 2007 10:21:34 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[controls]]></category>

		<guid isPermaLink="false">http://dotnetting.wordpress.com/2007/03/24/find-controls-in-controls-recursively-using-generics/</guid>
		<description><![CDATA[The two methods below recursively search for a control within a control. The first searches for a Textbox and the second searches for a DropDownList. The methods also accept the position of the control, e.g. 0 for the first TextBox, 1 for the second Textbox. I was using these methods to find controls within a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=17&subd=dotnetting&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The two methods below recursively search for a control within a control. The first searches for a <code>Textbox</code> and the second searches for a <code>DropDownList</code>. The methods also accept the position of the control, e.g. 0 for the first <code>TextBox</code>, 1 for the second <code>Textbox</code>. I was using these methods to find controls within a <code>WizardStep</code> before I discovered generics (see below for better, more generic solution).</p>
<pre><code>private TextBox FindTextBox(Control c, int positionOfControl)</code></pre>
<pre><code>{</code></pre>
<pre><code>   _positionOfControl = positionOfControl;
   if (c == null) return null;</code></pre>
<pre><code>   if (typeof(TextBox) == c.GetType())</code></pre>
<pre><code>   {
      if (_positionOfControl == 0)</code></pre>
<pre><code>      {</code></pre>
<pre><code>         return c as TextBox;</code></pre>
<pre><code>      }</code></pre>
<pre><code>      else</code></pre>
<pre><code>      {</code></pre>
<pre><code>         _positionOfControl--;</code></pre>
<pre><code>      }</code></pre>
<pre><code>   }

   Control results;</code></pre>
<pre><code>   foreach (Control child in c.Controls)</code></pre>
<pre><code>   {</code></pre>
<pre><code>      results = FindTextBox(child, _positionOfControl);</code></pre>
<pre><code>      if (results != null &amp;&amp; typeof(TextBox) == results.GetType())</code></pre>
<pre><code>   </code><code>   </code><code>{</code></pre>
<pre><code>   </code><code>   </code><code>   </code><code>return results as TextBox;</code></pre>
<pre><code>   </code><code>   </code><code>}</code></pre>
<pre><code>   </code><code>}</code></pre>
<pre><code>   </code><code>return null;}</code></pre>
<p>and</p>
<pre><code>private DropDownList FindDropDownList(Control c, int positionOfControl)</code></pre>
<pre><code>{</code></pre>
<pre><code>   </code><code>_positionOfControl = positionOfControl;</code></pre>
<pre><code>   </code><code>if (c == null) return null;</code></pre>
<pre><code>   </code><code>if (typeof(DropDownList) == c.GetType())</code></pre>
<pre><code>   </code><code>{</code></pre>
<pre><code>   </code><code>   </code><code>if (_positionOfControl == 0)</code></pre>
<pre><code>   </code><code>   </code><code>{</code></pre>
<pre><code>   </code><code>   </code><code>   </code><code>return c as DropDownList;</code></pre>
<pre><code>   </code><code>   </code><code>}</code></pre>
<pre><code>   </code><code>   </code><code>else</code></pre>
<pre><code>   </code><code>   </code><code>{</code></pre>
<pre><code>   </code><code>   </code><code>   </code><code>_positionOfControl--;</code></pre>
<pre><code>   </code><code>   </code><code>}</code></pre>
<pre><code>   </code><code>}

   Control results;</code></pre>
<pre><code>   </code><code>foreach (Control child in c.Controls)</code></pre>
<pre><code>   </code><code>{</code></pre>
<pre><code>   </code><code>   </code><code>results = FindDropDownList(child, _positionOfControl);</code></pre>
<pre><code>   </code><code>   </code><code>if (results != null &amp;&amp; typeof(DropDownList) == results.GetType())</code></pre>
<pre><code>   </code><code>   </code><code>{</code></pre>
<pre><code>   </code><code>   </code><code>   </code><code>return results as DropDownList;</code></pre>
<pre><code>   </code><code>   </code><code>}</code></pre>
<pre><code>   </code><code></code><code>}

   return null;}</code></pre>
<p>To find the first <code>TextBox</code> in a WizardStep I&#8217;d write the following code:</p>
<pre><code>TextBox textbox = FindTextBox(Wizard1.WizardStep[1], 0);</code></pre>
<p>This works fine but leads to code bloat if you need to search for different type of controls. Enter <a href="http://www.knowdotnet.com/articles/generics101.html">Generics</a>.</p>
<h3>Generics Solution</h3>
<p>It&#8217;s all in the name and the code below demonstrates a perfect use for generics. The code is verbose enough to not require explaination.</p>
<pre><code>private T FindControl&lt;Control&gt;(Control c, int positionOfControl) Where T:Control</code></pre>
<pre><code>{</code></pre>
<pre><code>   </code><code>_positionOfControl = positionOfControl;</code></pre>
<pre><code>   </code><code>if (c == null) return null;</code></pre>
<pre><code>   </code><code>if (typeof(T) == c.GetType())</code></pre>
<pre><code>   </code><code>{</code></pre>
<pre><code>   </code><code>   </code><code>if (_positionOfControl == 0)</code></pre>
<pre><code>   </code><code>   </code><code>{</code></pre>
<pre><code>   </code><code>   </code><code>   </code><code>return c as T;</code></pre>
<pre><code>   </code><code>   </code><code>}</code></pre>
<pre><code>   </code><code>   </code><code>else</code></pre>
<pre><code>   </code><code>   </code><code>{</code></pre>
<pre><code>   </code><code>   </code><code>   </code><code>_positionOfControl--;</code></pre>
<pre><code>   </code><code>   </code><code>}</code></pre>
<pre><code>   </code><code></code><code>}
   </code></pre>
<pre><code>   </code><code>Control results;</code></pre>
<pre><code>   </code><code>foreach (Control child in c.Controls)</code></pre>
<pre><code>   </code><code>{</code></pre>
<pre><code>   </code><code>   </code><code>results = FindControl(child, _positionOfControl);</code></pre>
<pre><code>   </code><code>   </code><code></code><code>if (results != null &amp;&amp; typeof(T) == results.GetType())</code></pre>
<pre><code>   </code><code>   </code><code>{</code></pre>
<pre><code>   </code><code>   </code><code>   </code><code>return results as T;</code></pre>
<pre><code>   </code><code>   </code><code>}</code></pre>
<pre><code>   </code><code>}

   return null;}</code></pre>
<p>To use this method just code:</p>
<pre><code>Textbox textBox = FindControl&lt;TextBox&gt;(Wizard1.WizardStep[1],0)</code></pre>
<p>or</p>
<pre><code>DropDownList dropDownList = FindControl&lt;DropDownList&gt;(Wizard1.WizardStep[1], 0)</code></pre>
<p><!-- technorati tags begin --></p>
<p style="font-size:10px;text-align:right;">Tags: <a href="http://technorati.com/tag/generics" rel="tag">generics</a>, <a href="http://technorati.com/tag/c%23" rel="tag">c#</a>, <a href="http://technorati.com/tag/asp.net" rel="tag">asp.net</a></p>
<p><!-- technorati tags end --></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetting.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetting.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetting.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetting.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetting.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetting.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetting.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetting.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetting.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetting.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetting.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetting.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=17&subd=dotnetting&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dotnetting.wordpress.com/2007/03/24/find-controls-in-controls-recursively-using-generics/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16606879e4666108d9fab602f431054f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">rowlando</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET Search Engine Friendly Paging</title>
		<link>http://dotnetting.wordpress.com/2007/03/17/aspnet-search-engine-friendly-paging/</link>
		<comments>http://dotnetting.wordpress.com/2007/03/17/aspnet-search-engine-friendly-paging/#comments</comments>
		<pubDate>Sat, 17 Mar 2007 17:58:03 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[accessibility]]></category>
		<category><![CDATA[controls]]></category>

		<guid isPermaLink="false">http://dotnetting.wordpress.com/2007/03/17/aspnet-search-engine-friendly-paging/</guid>
		<description><![CDATA[Out of the box, DataGrid and GridView provides paging support. I&#8217;d advise against using free paging because its inefficient. When switching between pages, the control queries the database for the entire resultset. If your table is only likely to have 100 or so rows in it, then fine. Otherwise, use the much more efficient method [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=15&subd=dotnetting&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Out of the box, DataGrid and GridView provides paging support. I&#8217;d advise against using free paging because its inefficient. When switching between pages, the control queries the database for the entire resultset. If your table is only likely to have 100 or so rows in it, then fine. Otherwise, use the much <a href="http://weblogs.asp.net/scottgu/archive/2006/01/07/434787.aspx" title="Efficient Data Paging with the ASP.NET 2.0 DataList Control and ObjectDataSource">more efficient method of paging at the database level</a>, only retrieving the records you need for a single page of results.</p>
<p>A side benefit of rolling your own paging control is that it will work with JavaScript switched off. Hooray! Remove those nasty anchors that have their <abbr title="hypertext reference"><code>href</code></abbr> set to call a JavaScript function, e.g. <code>&lt;a href="javascript:###"&gt;</code>. Now the page links are accessible to all, including search engines, and can be bookmarked. Hooray again!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetting.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetting.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetting.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetting.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetting.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetting.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetting.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetting.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetting.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetting.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetting.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetting.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=15&subd=dotnetting&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dotnetting.wordpress.com/2007/03/17/aspnet-search-engine-friendly-paging/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16606879e4666108d9fab602f431054f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">rowlando</media:title>
		</media:content>
	</item>
		<item>
		<title>How to format a date in a web control</title>
		<link>http://dotnetting.wordpress.com/2007/02/22/how-to-format-a-date-in-a-web-control/</link>
		<comments>http://dotnetting.wordpress.com/2007/02/22/how-to-format-a-date-in-a-web-control/#comments</comments>
		<pubDate>Thu, 22 Feb 2007 12:26:47 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[controls]]></category>
		<category><![CDATA[formatting]]></category>

		<guid isPermaLink="false">http://dotnetting.wordpress.com/2007/02/22/how-to-format-a-date-in-a-web-control/</guid>
		<description><![CDATA[One approach to formatting a date in DataList, DataGrid, Repeater, Gridview, etc&#8230; is to cast the object to a DateTime object and use its ToString method:

&#60;%# ((DateTime)DataBinder.Eval(Container.DataItem, "StartDate")).ToString("dd-MMM-yyyy") %&#62;
Genius.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=13&subd=dotnetting&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One approach to formatting a date in DataList, DataGrid, Repeater, Gridview, etc&#8230; is to cast the object to a DateTime object and use its ToString method:<br />
<code><br />
&lt;%# ((DateTime)DataBinder.Eval(Container.DataItem, "StartDate")).ToString("dd-MMM-yyyy") %&gt;</code></p>
<p>Genius.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetting.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetting.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetting.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetting.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetting.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetting.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetting.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetting.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetting.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetting.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetting.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetting.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=13&subd=dotnetting&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dotnetting.wordpress.com/2007/02/22/how-to-format-a-date-in-a-web-control/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16606879e4666108d9fab602f431054f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">rowlando</media:title>
		</media:content>
	</item>
		<item>
		<title>Moving Visual Studio 2003 projects to Team Foundation Server</title>
		<link>http://dotnetting.wordpress.com/2007/02/21/moving-visual-studio-2003-projects-to-team-foundation-server/</link>
		<comments>http://dotnetting.wordpress.com/2007/02/21/moving-visual-studio-2003-projects-to-team-foundation-server/#comments</comments>
		<pubDate>Wed, 21 Feb 2007 16:06:46 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[migration]]></category>

		<guid isPermaLink="false">http://dotnetting.wordpress.com/2007/02/21/moving-visual-studio-2003-projects-to-team-foundation-server/</guid>
		<description><![CDATA[If you wanting to move a Visual Studio 2003 project to Team Foundation server then Dave can help you out.
An approach moving VS2003/VSS projects to Team Foundation Server
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=12&subd=dotnetting&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you wanting to move a Visual Studio 2003 project to Team Foundation server then Dave can help you out.</p>
<p><a href="http://weblogs.asp.net/dmckinstry/archive/2006/05/08/445650.aspx">An approach moving VS2003/VSS projects to Team Foundation Server</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetting.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetting.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetting.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetting.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetting.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetting.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetting.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetting.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetting.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetting.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetting.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetting.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=12&subd=dotnetting&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dotnetting.wordpress.com/2007/02/21/moving-visual-studio-2003-projects-to-team-foundation-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16606879e4666108d9fab602f431054f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">rowlando</media:title>
		</media:content>
	</item>
		<item>
		<title>I understand DataSets. What is a TableAdapter for?</title>
		<link>http://dotnetting.wordpress.com/2007/02/04/i-understand-datasets-what-is-a-tableadapter-for/</link>
		<comments>http://dotnetting.wordpress.com/2007/02/04/i-understand-datasets-what-is-a-tableadapter-for/#comments</comments>
		<pubDate>Sun, 04 Feb 2007 17:10:20 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[classes]]></category>
		<category><![CDATA[introduction]]></category>

		<guid isPermaLink="false">http://dotnetting.wordpress.com/2007/02/04/i-understand-datasets-what-is-a-tableadapter-for/</guid>
		<description><![CDATA[In the last post I discovered the Strongly Typed DataSet. There&#8217;s little reason to not using typed DataSets because Visual Studio will generate the necessary code for you and it only takes a moment. Yes, really. The DataSet wizard will create SQL statements or stored procedures or use existing stored procedures. Writing the Data Access [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=9&subd=dotnetting&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In the last post I discovered the Strongly Typed <code>DataSet</code>. There&#8217;s little reason to not using typed <code>DataSet</code>s because Visual Studio will generate the necessary code for you and it only takes a moment. Yes, really. The <code>DataSet</code> wizard will create SQL statements or stored procedures or use existing stored procedures. Writing the Data Access Layer (DAL) of your application has never been such a painless task!</p>
<h3><code>TableAdapter</code> &#8211; the fifth class</h3>
<p>When you create a <code>DataSet</code> using Visual Studio 2005 it will create 5 classes. For example, say you point to the Customer table of your database (named StoreDB), you will end up with:</p>
<ul>
<li><code>StoreDBDataSet</code></li>
<li><code>CustomerDataTable</code></li>
<li><code>CustomerDataRow</code></li>
<li><code>CustomerRowChangeEvent</code></li>
<li><code>CustomerTableAdapter</code></li>
</ul>
<p>The four classes, i.e. each of the classes above except for the <code>DataSet</code> class, are repeated  for each table defined in the <code>DataSet</code>.</p>
<p>The <code>TableAdapter</code> is the strongly-typed equivalent of the <a href="http://msdn2.microsoft.com/en-us/library/system.data.common.dataadapter.aspx">standard</a> <a href="http://msdn2.microsoft.com/en-us/library/bh8kx08z.aspx"><code>DataAdapter</code></a>. Nice eh? I&#8217;m only just getting my head around this and it is making sense, slowly.</p>
<p>Here&#8217;s a quote from an <a href="http://www.theserverside.net/tt/articles/showarticle.tss?id=DataSetDesigner" title="Build a Data Access Layer with the Visual Studio 2005 DataSet Designer">article by Brian Noyes</a> that succintly describes what a <code>TableAdapter</code>&#8217;s purpose is:</p>
<blockquote cite="http://www.theserverside.net/tt/articles/showarticle.tss?id=DataSetDesigner"><p>Finally, and perhaps most importantly, when you create typed data sets in Visual Studio 2005 from a database, you also get a table adapter type created for each table that you add to the data set. A table adapter is a full fledged data access component that lets you retrieve and update data from the database. It encapsulates a connection, a data adapter, and a set of command objects that allow you to execute queries to the database. I’ll get into more detail on table adapters in a little bit.</p></blockquote>
<h3>Further Reading</h3>
<p>Jackie Goldstein has a <a href="http://weblogs.asp.net/jackieg/archive/2005/09/28/426139.aspx">good tutorial on the <code>TableAdapter</code></a>. It took me a couple of reads to understand what benefits the <code>TableAdapter</code> brings and how it saves me from writing lots of code, which is always worth the effort.</p>
<p><strong>Update:</strong> <a href="http://www.dotnetrocks.com/default.aspx?showID=133" title="TableAdapter explained in conversation">Listen to Jackie Goldstein speak about the TableAdapter</a> on DotNetRocks podcast. Skip to 44 minute 40 seconds in the audio file to get straight to the subject at hand.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetting.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetting.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetting.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetting.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetting.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetting.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetting.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetting.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetting.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetting.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetting.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetting.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=9&subd=dotnetting&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dotnetting.wordpress.com/2007/02/04/i-understand-datasets-what-is-a-tableadapter-for/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16606879e4666108d9fab602f431054f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">rowlando</media:title>
		</media:content>
	</item>
		<item>
		<title>What is a Strongly Typed DataSet?</title>
		<link>http://dotnetting.wordpress.com/2007/02/04/what-is-a-strongly-typed-dataset/</link>
		<comments>http://dotnetting.wordpress.com/2007/02/04/what-is-a-strongly-typed-dataset/#comments</comments>
		<pubDate>Sun, 04 Feb 2007 11:57:38 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[classes]]></category>
		<category><![CDATA[introduction]]></category>

		<guid isPermaLink="false">http://dotnetting.wordpress.com/2007/02/04/what-is-a-strongly-typed-dataset/</guid>
		<description><![CDATA[In my quest to learn ASP.NET I have stumbled across the DataSet object.
A DataSet is an in-memory cache of tables, obtained from a relational database or an XML document.
Unfortunately, IntelliSense does not work well with DataSet objects. You must remember the database table and column names. For example, working with untyped DataSet you would write:
string [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=8&subd=dotnetting&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In my quest to learn ASP.NET I have stumbled across the DataSet object.</p>
<p><q cite="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/BOAGag.asp">A DataSet is an in-memory cache of tables, obtained from a relational database or an XML document.</q></p>
<p>Unfortunately, IntelliSense does not work well with DataSet objects. You must remember the database table and column names. For example, working with untyped DataSet you would write:</p>
<p><code>string firstName = dS.Tables["Customers"].Rows[0]["FirstName"].ToString();</code></p>
<p>As well as remembering column names, you have to use methods such as ToString() to get the correct data type out.</p>
<p>This is where Strongly Typed DataSets come to the rescue. The line of code above can be rewritten when using a Strongly Typed DataSet:</p>
<p><code>string firstName = dS.Customers[0].FirstName;</code></p>
<p>Witness, there&#8217;s no conversion from one type to another and IntelliSense works. These two benefits alone are worth the trouble of using Strongly Typed DataSets because it will drastically reduce the number of typing errors one makes.</p>
<h3>Further Reading</h3>
<p>I thoroughly recommend reading <a href="http://msdn.microsoft.com/msdnmag/issues/04/12/DataPoints/">Efficient Coding With Strongly Typed DataSets</a> to get to grips with the benefits of using Strongly Typed DataSet objects.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetting.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetting.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetting.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetting.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetting.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetting.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetting.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetting.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetting.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetting.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetting.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetting.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=8&subd=dotnetting&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dotnetting.wordpress.com/2007/02/04/what-is-a-strongly-typed-dataset/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16606879e4666108d9fab602f431054f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">rowlando</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing ASP.NET Server Controls</title>
		<link>http://dotnetting.wordpress.com/2007/01/30/introducing-aspnet-server-controls/</link>
		<comments>http://dotnetting.wordpress.com/2007/01/30/introducing-aspnet-server-controls/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 22:55:06 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[controls]]></category>
		<category><![CDATA[introduction]]></category>

		<guid isPermaLink="false">http://dotnetting.wordpress.com/2007/01/30/introducing-aspnet-server-controls/</guid>
		<description><![CDATA[Today I&#8217;m learning about server controls. What, why and how? There&#8217;s two types, HTML Server Controls and Web Server Controls. Both types must be wrapped by a single &#60;form runat="server"&#62; tag.
Intrinsic HTML Server Controls
Intrinsic server controls are standard HTML tags containing a runat="server" attribute. For example:
&#60;input type="text" id="name" runat="server" /&#62;
This creates an HtmlInputText server control [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=7&subd=dotnetting&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today I&#8217;m learning about <strong>server controls</strong>. What, why and how? There&#8217;s two types, HTML Server Controls and Web Server Controls. Both types must be wrapped by a single <code>&lt;form runat="server"&gt;</code> tag.</p>
<h3>Intrinsic HTML Server Controls</h3>
<p>Intrinsic server controls are standard HTML tags containing a <code>runat="server"</code> attribute. For example:</p>
<p><code>&lt;input type="text" id="name" runat="server" /&gt;</code></p>
<p>This creates an <a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlinputtext.aspx">HtmlInputText</a> server control and is accessible in your code using <code>name.Value</code>.</p>
<h3>Web Server Controls</h3>
<p>ASP.NET offers a rich set of custom controls that generate HTML content for you.  Instead of the above HTML <code>&lt;input&gt;</code> element, the equivalent control is:</p>
<p><code>&lt;asp:TextBox id="name" runat="server" /&gt;</code></p>
<p>The web server controls come with a lot more power though. For example, we can customise the <code>TextBox</code> control:<br />
<code><br />
&lt;asp:TextBox id="name" runat="server" TextMode="Password" Columns="40" /&gt;</code></p>
<p>In this case, the <code>TextMode</code> property is set so it hides the text entered into the text field. The <code>Columns</code> property sets the <code>size</code> attribute of the HTML <code>input</code> tag that ASP.NET generates.</p>
<h4>More Advanced Controls</h4>
<p>Microsoft have a small <a href="http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/standard/default.aspx">tutorial on each web server control</a> ASP.NET offers. Included are list controls &#8211; <code>DropDownList</code>, <code>ListBox</code> and <code>RadioButtonList</code> &#8211; and more advanced controls such as <code>Calendar</code> and <code>Wizard</code>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetting.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetting.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetting.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetting.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetting.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetting.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetting.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetting.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetting.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetting.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetting.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetting.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=7&subd=dotnetting&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dotnetting.wordpress.com/2007/01/30/introducing-aspnet-server-controls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16606879e4666108d9fab602f431054f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">rowlando</media:title>
		</media:content>
	</item>
		<item>
		<title>Bloated JavaScript in ASP.NET Validation Controls</title>
		<link>http://dotnetting.wordpress.com/2007/01/30/bloated-javascript-in-aspnet-validation-controls/</link>
		<comments>http://dotnetting.wordpress.com/2007/01/30/bloated-javascript-in-aspnet-validation-controls/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 08:18:27 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://dotnetting.wordpress.com/2007/01/30/bloated-javascript-in-aspnet-validation-controls/</guid>
		<description><![CDATA[Over the past year I&#8217;ve been developing with a text browser. I manually typed XHTML, CSS and JavaScript code, observing best practices promoted by the web standards community. I wrote the server side code in a text editor too.
Teaching myself ASP.NET is making me wince. I thought outputting invalid non-semantic HTML was a bad enough [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=6&subd=dotnetting&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Over the past year I&#8217;ve been developing with a text browser. I manually typed XHTML, CSS and JavaScript code, observing best practices promoted by the web standards community. I wrote the server side code in a text editor too.</p>
<p>Teaching myself ASP.NET is making me wince. I thought <a href="http://dotnetting.wordpress.com/2007/01/30/aspnets-attempt-at-valid-xhtml/" title="Dodgy ASP.NET generated HTML">outputting invalid non-semantic HTML</a> was a bad enough crime. I am shocked and appalled to discover the bloated JavaScript code ASP.NET generates to check that a text box is not empty. The code below generates 23.8KB of JavaScript, all because of the <code>RequiredFieldValidation</code> control. The HTML document too has splashes of JavaScript code throughout the page.</p>
<p><code>&lt;form id="form1" runat="server"&gt;<br />
&lt;div&gt;<br />
&lt;p&gt;<br />
Username:&lt;br /&gt;<br />
&lt;asp:TextBox ID="usernameTextBox" runat="server" /&gt;</code><br />
<code>&lt;asp:RequiredFieldValidator ID="usernameReq" runat="server" ControlToValidate="usernameTextBox" ErrorMessage="Username is required!" SetFocusOnError="True" /&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;asp:Button ID="submitButton" runat="server" Text="Submit" /&gt;<br />
&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;/form&gt;</code></p>
<p>Remove the <code>RequiredFieldValidation</code> control and all traces of JavaScript disappear.</p>
<h3>Why so much JavaScript code?</h3>
<p>The JavaScript code generated is for every validator control in ASP.NET. Still, 23.8KB is a hefty download, even if it covers all validation controls. Why haven&#8217;t the Microsoft .NET development team at least compressed the JavaScript?</p>
<p>I&#8217;ve verified that the generated JavaScript files have the same across different web pages, which means the browser does not have to download the files on each new page load.</p>
<h3>The alternative</h3>
<p>In order to avoid bulky JavaScript code, there are two options.</p>
<p>Use HTML controls and write your own validation code. The downside is that you will also have to write server-side validation code in case JavaScript has been switched off in the browser.</p>
<p>Spin your own <a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.customvalidator(VS.80).aspx">CustomValidator</a>. You can use the ServerValidate event to handle serve-side validation and set the <a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.customvalidator.clientvalidationfunction(VS.80).aspx">ClientValidationFunction</a> property to the name of the client-side JavaScript validation function.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetting.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetting.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetting.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetting.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetting.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetting.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetting.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetting.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetting.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetting.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetting.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetting.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=6&subd=dotnetting&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dotnetting.wordpress.com/2007/01/30/bloated-javascript-in-aspnet-validation-controls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16606879e4666108d9fab602f431054f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">rowlando</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET&#8217;s attempt at valid XHTML</title>
		<link>http://dotnetting.wordpress.com/2007/01/30/aspnets-attempt-at-valid-xhtml/</link>
		<comments>http://dotnetting.wordpress.com/2007/01/30/aspnets-attempt-at-valid-xhtml/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 08:15:37 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://dotnetting.wordpress.com/2007/01/30/aspnets-attempt-at-valid-xhtml/</guid>
		<description><![CDATA[I&#8217;m a .NET newbie. I&#8217;m learning the basics from a book that is really a lengthy ASP.NET tutorial. So far, so good.
Putting my web developer&#8217;s hat on, I am disappointed by the mark-up produced by .NET controls. It doesn&#8217;t validate. Take the following code:
&#60;form runat="server"&#62;
&#60;asp:Button id="button" runat="server" OnClick="button_Click" Text="Click Me" /&#62;
&#60;asp:Label id="messageLabel" runat="server" /&#62;
&#60;/form&#62;
It produces [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=5&subd=dotnetting&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m a .NET newbie. I&#8217;m learning the basics from a <a href="http://www.assoc-amazon.co.uk/e/ir?t=nickinburgh-21&amp;l=as2&amp;o=2&amp;a=0975240285" title="An ASP.NET 2.0 tutorial by SitePoint">book</a> that is really a lengthy ASP.NET tutorial. So far, so good.</p>
<p>Putting my web developer&#8217;s hat on, I am disappointed by the mark-up produced by .NET controls. It doesn&#8217;t validate. Take the following code:</p>
<blockquote><p><code>&lt;form runat="server"&gt;<br />
&lt;asp:Button id="button" runat="server" OnClick="button_Click" Text="Click Me" /&gt;<br />
&lt;asp:Label id="messageLabel" runat="server" /&gt;<br />
&lt;/form&gt;</code></p></blockquote>
<p>It produces the following mark-up:<code><br />
</code></p>
<blockquote><p><code>&lt;form name="ctl00" method="post" action="ClickEvent.aspx" id="ctl00"&gt;<br />
&lt;div&gt;<br />
&lt;input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE4Nzk4Mzk1MzRkZAYY+czHhSGkOW9gO8GqxURPVBeZ" /&gt;<br />
&lt;/div&gt;<br />
&lt;input type="submit" name="button" value="Click Me" id="button" /&gt;<br />
&lt;span id="messageLabel"&gt;&lt;/span&gt;<br />
&lt;div&gt;<br />
&lt;input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgLVuv2KBwLz9r7ABPTBiD6bHah0G6B4fEICXl+rcO/V" /&gt;<br />
&lt;/div&gt;&lt;/form&gt;</code></p></blockquote>
<p>There are a number of issues:</p>
<ul>
<li>The <code>form </code>tag&#8217;s <code>name</code> attribute is deprecated in XHTML.</li>
<li>The ViewState value is encryped in a hidden <code>input</code> tag, which is wrapped in a <code>DIV</code> in order to make it validate. This extra HTML is plain nasty. It goes against what <a href="http://www.webstandards.org/" title="Read all about it... standards, standards">web standards</a>  promotes, i.e. clean, semantic mark-up.</li>
</ul>
<h3>Possible Solutions</h3>
<p>&#8220;Intercept the HTML code before it is sent to the web browser&#8221; &#8211; <a href="http://www.codeproject.com/aspnet/ASPNET2XHTML.asp" title="A C# class to make your ASP.NET pages XHTML valid">The Code Project</a>, Sep 2004.</p>
<p>I&#8217;m sure there&#8217;s a few more ways of getting ASP.NET to generate HTML but as I am humble beginner I&#8217;ll stop looking for now and post update when I&#8217;ve found them.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetting.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetting.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetting.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetting.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetting.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetting.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetting.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetting.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetting.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetting.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetting.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetting.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetting.wordpress.com&blog=691224&post=5&subd=dotnetting&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dotnetting.wordpress.com/2007/01/30/aspnets-attempt-at-valid-xhtml/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/16606879e4666108d9fab602f431054f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">rowlando</media:title>
		</media:content>
	</item>
	</channel>
</rss>