<?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>NateElston.com &#187; Programming</title>
	<atom:link href="http://www.nateelston.com/wordpress/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nateelston.com/wordpress</link>
	<description>man. food. blog. adventures.</description>
	<lastBuildDate>Fri, 23 Jul 2010 20:55:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<div id='fb-root'></div>
				<script>
					window.fbAsyncInit = function()
					{
						FB.init({appId: null, status: true, cookie: true, xfbml: true});
					};
					(function()
					{
						var e = document.createElement('script'); e.async = true;
						e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
						document.getElementById('fb-root').appendChild(e);
					}());
				</script>	
					<item>
		<title>Home Hard Drive Data Rescue</title>
		<link>http://www.nateelston.com/wordpress/2010/02/home-hard-drive-data-rescue/</link>
		<comments>http://www.nateelston.com/wordpress/2010/02/home-hard-drive-data-rescue/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 01:44:30 +0000</pubDate>
		<dc:creator>kozmo</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[data rescue]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[hard drive]]></category>
		<category><![CDATA[ipad cookbook]]></category>

		<guid isPermaLink="false">http://www.nateelston.com/wordpress/?p=316</guid>
		<description><![CDATA[DISCLAIMER: This will void your warranty.  You will probably lose all the data on your drive.  You might die, who knows.  Don&#8217;t try this at home.  If you do decide to do this be sure to wear latex gloves as to not mark your platters. With that out of the way, lets get down to [...]]]></description>
			<content:encoded><![CDATA[<p>DISCLAIMER: This will void your warranty.  You will probably lose all the data on your drive.  You might die, who knows.  Don&#8217;t try this at home.  If you do decide to do this be sure to wear latex gloves as to not mark your platters.</p>
<p>With that out of the way, lets get down to it, rarely do I write about anything other than food and in a strange far out way this will be related to food.  For quite sometime now my passion for technology and food have collided and I have been working on building out my Digital Cook book and working on and iPad app to accommodate it.  Recently while I was out of town the server on which the majority of this application resided bit the dust or at least the drive with the data one did.  As a person who should know better I have no excuse, but, none the less the data was not backed up.  There was one copy of the database and the data in it.  Fail.  With options running out and not wanting to pay to have the data professionally recovered I took a last ditch effort to recover the data myself.  Much to my surprise it worked.</p>
<p>Thankfully when I built the machine I used identical drives I had laying around.  Because of this I could swap the platters from one drive to the other and that is what I did.  I took the platter (the CD looking thing that lives inside a hard drive and holds all the data) and installed it in the working drive, after removing its platter.  I then tore into my network attached storage chassis, removed the drive in there and plugged in my Fraken-drive.  Bam, disk spun up and Windows recognized it.  Pulled my data off and let out a squeal of delight.  All of my hard work has been saved.  As a by product I have some pictures and videos of the process someone is bound to appreciate.</p>
<p style="text-align: center;"><a href="http://www.nateelston.com/wordpress/wp-content/uploads/2010/02/IMG_2547.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter size-large wp-image-317" style="border: 0pt none;" title="Hard Drive Platters Exposed" src="http://www.nateelston.com/wordpress/wp-content/uploads/2010/02/IMG_2547-1024x768.jpg" alt="Hard Drive Platters Exposed" width="491" height="369" /></a></p>
<p style="text-align: center;"><a href="http://www.nateelston.com/wordpress/wp-content/uploads/2010/02/IMG_2548.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter size-large wp-image-318" style="border: 0pt none;" title="Hard Drive Platters Exposed" src="http://www.nateelston.com/wordpress/wp-content/uploads/2010/02/IMG_2548-1024x768.jpg" alt="Hard Drive Platters Exposed" width="491" height="369" /></a></p>
<p style="text-align: center;"><object style="width: 425px; height: 344px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/W9LzVH6Grgo&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999" /><embed style="width: 425px; height: 344px;" type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/W9LzVH6Grgo&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999"></embed></object></p>
<p style="text-align: center;"><object style="width: 425px; height: 344px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/aas5e6nkniI&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999" /><embed style="width: 425px; height: 344px;" type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/aas5e6nkniI&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999"></embed></object></p>
<p>Moral of the story is BACK UP YOUR DATA.  I will be doing that first and foremost on my new server configuration to avoid the sense of panic upon realizing you have to start over.</p>
<div class='wpfblike'><fb:like href='http%3A%2F%2Fwww.nateelston.com%2Fwordpress%2F2010%2F02%2Fhome-hard-drive-data-rescue%2F' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nateelston.com/wordpress/2010/02/home-hard-drive-data-rescue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The iPad as a Cookbook?</title>
		<link>http://www.nateelston.com/wordpress/2010/01/the-ipad-as-a-cookbook/</link>
		<comments>http://www.nateelston.com/wordpress/2010/01/the-ipad-as-a-cookbook/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 22:15:27 +0000</pubDate>
		<dc:creator>kozmo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[cookbook]]></category>
		<category><![CDATA[electronic cookbook]]></category>
		<category><![CDATA[ipad]]></category>

		<guid isPermaLink="false">http://www.nateelston.com/wordpress/?p=279</guid>
		<description><![CDATA[If you haven&#8217;t heard the iPad is a new device from Apple due out in March that is like a giant iPhone or iPod touch, on steroids.  Its like a laptop with no keyboard or mouse, just a touch screen.  You can look at it here. The iPad looks great, in fact, I want one [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t heard the iPad is a new device from Apple due out in March that is like a giant iPhone or iPod touch, on steroids.  Its like a laptop with no keyboard or mouse, just a touch screen.  You can look at it <a title="iPad on Apple.com" href="http://www.apple.com/ipad/" target="_blank">here</a>.</p>
<p>The iPad looks great, in fact, I want one and will be buying one as soon as it is feasible.  In the mean time I am left to wonder, as a foodie-geek or geek-foodie or food nerd or whatever I am, how will this work as a cookbook?  Will the screen stand up to some abuse?  Can I wipe it off with a rag when I get oil, grease and juices on it?</p>
<p>Starting at $499 it is a rather expensive toy and an even more expensive cookbook but it holds promise if it will stand up to the abuse of living in a kitchen.  In the mean time I have downloaded the SDK and hope to begin plugging away shortly to hook the iPad into my existing recipe database.</p>
<p>Time will tell whether or not the iPad will catch on but with Apple&#8217;s cult following surely they will sell millions of these devices in its first year of availability, however, with a  built in stand by battery time of a month it seems that Apple has already counted on these devices not being used daily.  Perhaps CraigsList will end up flooded the used iPads for cheap.</p>
<div class='wpfblike'><fb:like href='http%3A%2F%2Fwww.nateelston.com%2Fwordpress%2F2010%2F01%2Fthe-ipad-as-a-cookbook%2F' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nateelston.com/wordpress/2010/01/the-ipad-as-a-cookbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# .NET 3.5 GridView Blunders, how to validate and replace a value</title>
		<link>http://www.nateelston.com/wordpress/2009/12/c-net-3-5-gridview-blunders-how-to-validate-and-replace-a-value/</link>
		<comments>http://www.nateelston.com/wordpress/2009/12/c-net-3-5-gridview-blunders-how-to-validate-and-replace-a-value/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 04:05:02 +0000</pubDate>
		<dc:creator>kozmo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net 3.5]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[datagridview]]></category>

		<guid isPermaLink="false">http://www.nateelston.com/wordpress/?p=223</guid>
		<description><![CDATA[Some days I wonder to myself, really Microsoft what were you thinking?  Or is the problem I am not thinking either way I ran into an issue this evening that just frustrated me like no other, so I thought I had best share what my solution was. I am working on an application to organize [...]]]></description>
			<content:encoded><![CDATA[<p>Some days I wonder to myself, really Microsoft what were you thinking?  Or is the problem I am not thinking either way I ran into an issue this evening that just frustrated me like no other, so I thought I had best share what my solution was.</p>
<p>I am working on an application to organize my recipe collection and publish it online, no shock, I even code in food.  Anyhow, in order to put measurements into the application I am using a DataGridView and put the measurements in like 1 3/4 or 2/3, the idea was that on save those numbers would then be converted to decimals and saved in the database.  This is where my problem began when I bound my DataGridView to my data from my Stored Procedure, pandamoniam.  The DataGridView then expected that all the input would be in decimal format, so I decided to capture the validating event for that cell which ended up looking like this:</p>

<div class="wp_codebox"><table><tr id="p2233"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p223code3"><pre class="csharp" style="font-family:monospace;">        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> dgvIngredients_CellValidating<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, DataGridViewCellValidatingEventArgs e<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">//this is the amount column</span>
            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>e<span style="color: #008000;">.</span><span style="color: #0000FF;">ColumnIndex</span> <span style="color: #008000;">==</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                dgvIngredients<span style="color: #008000;">.</span><span style="color: #0000FF;">CancelEdit</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                dgvIngredients<span style="color: #008000;">&#91;</span>e<span style="color: #008000;">.</span><span style="color: #0000FF;">ColumnIndex</span>, e<span style="color: #008000;">.</span><span style="color: #0000FF;">RowIndex</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> parseFraction<span style="color: #008000;">&#40;</span>e<span style="color: #008000;">.</span><span style="color: #0000FF;">FormattedValue</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Trim</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>   
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Now this worked awesome for the first row in the DataGridView however, subsequent new rows in the DataGridView resulted in blanks when the validation completed, most frustrating.  So after hours of threatening my computer with harm. I arrived at a solution although not as graceful as I had hoped, I needed to intervene on one more event, the RowsAdded event as follows:</p>

<div class="wp_codebox"><table><tr id="p2234"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p223code4"><pre class="csharp" style="font-family:monospace;">        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> dgvIngredients_RowsAdded<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, DataGridViewRowsAddedEventArgs e<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            dgvIngredients<span style="color: #008000;">.</span><span style="color: #0000FF;">CommitEdit</span><span style="color: #008000;">&#40;</span>DataGridViewDataErrorContexts<span style="color: #008000;">.</span><span style="color: #0000FF;">Commit</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>And BAM it works.  Not exactly what I had in mind but better then converting fractions to decimals by hand.</p>
<div class='wpfblike'><fb:like href='http%3A%2F%2Fwww.nateelston.com%2Fwordpress%2F2009%2F12%2Fc-net-3-5-gridview-blunders-how-to-validate-and-replace-a-value%2F' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nateelston.com/wordpress/2009/12/c-net-3-5-gridview-blunders-how-to-validate-and-replace-a-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net Menu Control Open in New Window</title>
		<link>http://www.nateelston.com/wordpress/2009/06/aspnet-menu-control-open-in-new-window/</link>
		<comments>http://www.nateelston.com/wordpress/2009/06/aspnet-menu-control-open-in-new-window/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 19:42:32 +0000</pubDate>
		<dc:creator>kozmo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[ASP:Menu]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Sitemap]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://www.nateelston.com/wordpress/?p=50</guid>
		<description><![CDATA[Today I was presented with a problem that seemed simple enough, how do we make an ASP.Net Menu control open in a new window.  Sounds easy right, well that is what I thought.  But before I go too far, lets back up a minute and review what I am working with. Using ASP .Net 3.5 [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was presented with a problem that seemed simple enough, how do we make an ASP.Net Menu control open in a new window.  Sounds easy right, well that is what I thought.  But before I go too far, lets back up a minute and review what I am working with.</p>
<p>Using ASP .Net 3.5 with VB.Net (C# would be preferred but someone started the app, besides it translates easy enough).</p>
<p>I have a .Net XML sitemap file:</p>

<div class="wp_codebox"><table><tr id="p5010"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code" id="p50code10"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;siteMap</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/AspNet/SiteMap-File-1.0&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;siteMapNode</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;Default.aspx&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Home&quot;</span>  <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;siteMapNode</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Membership&quot;</span></span>
<span style="color: #009900;">					 <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;~/Membership.aspx&quot;</span></span>
<span style="color: #009900;">					 <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Membership Management&quot;</span></span>
<span style="color: #009900;">					 <span style="color: #000066;">roles</span>=<span style="color: #ff0000;">&quot;Admins&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;siteMapNode</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;CustomerSearch.aspx&quot;</span></span>
<span style="color: #009900;">					 <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Customer Search&quot;</span></span>
<span style="color: #009900;">					 <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Customer Search&quot;</span></span>
<span style="color: #009900;">					 <span style="color: #000066;">roles</span>=<span style="color: #ff0000;">&quot;Admins&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;siteMapNode</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;User&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Display/Search for user&quot;</span> <span style="color: #000066;">roles</span>=<span style="color: #ff0000;">&quot;IT&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;siteMapNode</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;User Search&quot;</span></span>
<span style="color: #009900;">						 <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;~/userLookup.aspx&quot;</span></span>
<span style="color: #009900;">						 <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Search for Users&quot;</span></span>
<span style="color: #009900;">						 <span style="color: #000066;">roles</span>=<span style="color: #ff0000;">&quot;Admins&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;siteMapNode</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Create User&quot;</span></span>
<span style="color: #009900;">						 <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;http://external/createUser.asp?window=new&quot;</span></span>
<span style="color: #009900;">						 <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Create a new user&quot;</span></span>
<span style="color: #009900;">						 <span style="color: #000066;">roles</span>=<span style="color: #ff0000;">&quot;Admins&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/siteMapNode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;siteMapNode</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Logout&quot;</span></span>
<span style="color: #009900;">					 <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;~/Logout.aspx&quot;</span></span>
<span style="color: #009900;">					 <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Logout&quot;</span></span>
<span style="color: #009900;">					 <span style="color: #000066;">roles</span>=<span style="color: #ff0000;">&quot;Admins&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/siteMapNode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/siteMap<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>And an ASP.Net Menu control:</p>

<div class="wp_codebox"><table><tr id="p5011"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p50code11"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span>asp<span style="color: #006600; font-weight: bold;">:</span>Menu ID<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;Menu1&quot;</span> runat<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;server&quot;</span> DataSourceID<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;SiteMapDataSource1&quot;</span> 
                            Orientation<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;Horizontal&quot;</span> BackColor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#E9E1EA&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
                        <span style="color: #006600; font-weight: bold;">&lt;</span>LevelMenuItemStyles<span style="color: #006600; font-weight: bold;">&gt;</span>
                            <span style="color: #006600; font-weight: bold;">&lt;</span>asp<span style="color: #006600; font-weight: bold;">:</span>MenuItemStyle CssClass<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;topMenuItem&quot;</span> Font-Bold<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;True&quot;</span> 
                                Font-Underline<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;False&quot;</span> ItemSpacing<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;25px&quot;</span> VerticalPadding<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;4px&quot;</span><span style="color: #006600; font-weight: bold;">/&gt;</span>
                        <span style="color: #006600; font-weight: bold;">&lt;/</span>LevelMenuItemStyles<span style="color: #006600; font-weight: bold;">&gt;</span>
                        <span style="color: #006600; font-weight: bold;">&lt;</span>DynamicHoverStyle BackColor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#E9E1EA&quot;</span> <span style="color: #006600; font-weight: bold;">/&gt;</span>
                    <span style="color: #006600; font-weight: bold;">&lt;/</span>asp<span style="color: #006600; font-weight: bold;">:</span>Menu<span style="color: #006600; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>This is what I was given from here, it was pretty simple once my brain started to function again, I fired an event as the menu item&#8217;s were bound, checked for a parameter in the url passed in from the site map and if it was present I added the target of   <em>&#8216;_blank&#8217; </em>to that menu item. And BOOM it worked, simple and a little more ghetto than I usually strive for but ultimatly an acceptable solution.  So here is what is looks like in code.</p>
<p>First thing you will notice is in my XML two of the menu item urls contain <em>&#8216;window=new&#8217;</em>, well this is the url parameter that my method is looking for, here is the XML in question:</p>

<div class="wp_codebox"><table><tr id="p5012"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p50code12"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;siteMapNode</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;User Search&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;~/userLookup.aspx&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Search for Users&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">roles</span>=<span style="color: #ff0000;">&quot;Admins&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;siteMapNode</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Create User&quot;</span></span>
<span style="color: #009900;">		 <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;http://external/createUser.asp?window=new&quot;</span></span>
<span style="color: #009900;">		 <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Create a new user&quot;</span></span>
<span style="color: #009900;">		 <span style="color: #000066;">roles</span>=<span style="color: #ff0000;">&quot;Admins&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

<p>Once I got that figured out I added the event action to the ASP:</p>

<div class="wp_codebox"><table><tr id="p5013"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p50code13"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span>asp<span style="color: #006600; font-weight: bold;">:</span>Menu ID<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;Menu1&quot;</span> runat<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;server&quot;</span> DataSourceID<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;SiteMapDataSource1&quot;</span> 
                            Orientation<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;Horizontal&quot;</span> BackColor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#E9E1EA&quot;</span> OnMenuItemDataBound<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;topMenu_menuItemDataBound&quot;</span> <span style="color: #006600; font-weight: bold;">&gt;</span>
                        <span style="color: #006600; font-weight: bold;">&lt;</span>LevelMenuItemStyles<span style="color: #006600; font-weight: bold;">&gt;</span>
                            <span style="color: #006600; font-weight: bold;">&lt;</span>asp<span style="color: #006600; font-weight: bold;">:</span>MenuItemStyle CssClass<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;topMenuItem&quot;</span> Font-Bold<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;True&quot;</span> 
                                Font-Underline<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;False&quot;</span> ItemSpacing<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;25px&quot;</span> VerticalPadding<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;4px&quot;</span><span style="color: #006600; font-weight: bold;">/&gt;</span>
                        <span style="color: #006600; font-weight: bold;">&lt;/</span>LevelMenuItemStyles<span style="color: #006600; font-weight: bold;">&gt;</span>
                        <span style="color: #006600; font-weight: bold;">&lt;</span>DynamicHoverStyle BackColor<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;#E9E1EA&quot;</span> <span style="color: #006600; font-weight: bold;">/&gt;</span>
                    <span style="color: #006600; font-weight: bold;">&lt;/</span>asp<span style="color: #006600; font-weight: bold;">:</span>Menu<span style="color: #006600; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>Once that was ready to go I wrote up the VB that lives behind the scenes, its pretty simple really:</p>

<div class="wp_codebox"><table><tr id="p5014"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p50code14"><pre class="vb" style="font-family:monospace;">Protected <span style="color: #000080;">Sub</span> topMenu_menuItemDataBound(<span style="color: #000080;">ByVal</span> sender <span style="color: #000080;">As</span> <span style="color: #000080;">Object</span>, <span style="color: #000080;">ByVal</span> e <span style="color: #000080;">As</span> MenuEventArgs) Handles Menu1.MenuItemDataBound
    <span style="color: #000080;">If</span> (e.Item.NavigateUrl.Contains(<span style="color: #800000;">&quot;window=new&quot;</span>)) <span style="color: #000080;">Then</span>
        e.Item.Target = <span style="color: #800000;">&quot;_blank&quot;</span>
    <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
<span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span></pre></td></tr></table></div>

<p>There is probably a more elegant way to do this but for the time period I had and the need it was perfect, if we ever need to expand this I would probably just create my own sitemap that had target as an attribute and then build an alternative menu builder to take into account target.</p>
<div class='wpfblike'><fb:like href='http%3A%2F%2Fwww.nateelston.com%2Fwordpress%2F2009%2F06%2Faspnet-menu-control-open-in-new-window%2F' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nateelston.com/wordpress/2009/06/aspnet-menu-control-open-in-new-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
