<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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/" version="2.0">

<channel>
	<title>John</title>
	
	<link>http://john.rozeske.com</link>
	<description>the blog</description>
	<pubDate>Thu, 11 Dec 2008 01:07:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/johnrozeske" type="application/rss+xml" /><item>
		<title>SCOPE_IDENTITY across Linked Servers</title>
		<link>http://john.rozeske.com/2007/10/18/scope_identity-across-linked-servers/</link>
		<comments>http://john.rozeske.com/2007/10/18/scope_identity-across-linked-servers/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 01:12:26 +0000</pubDate>
		<dc:creator>John</dc:creator>
		
		<category><![CDATA[Work]]></category>

		<category><![CDATA[identity]]></category>

		<category><![CDATA[sql server]]></category>

		<category><![CDATA[stored procedure]]></category>

		<guid isPermaLink="false">http://john.rozeske.com/2007/10/18/scope_identity-across-linked-servers/</guid>
		<description><![CDATA[You see&#8230;there&#8217;s this thing called &#8220;scope&#8221; and it apparently only applies to the server you&#8217;re calling SCOPE_IDENTITY from.  Which does make sense in a &#8220;I just spent 3 hours fixing my code&#8221; kinda way.  Wrote a few new stored procedures on the linked server that returned the identity as an output parameter, easy. [...]]]></description>
			<content:encoded><![CDATA[<p>You see&#8230;there&#8217;s this thing called &#8220;scope&#8221; and it apparently only applies to the server you&#8217;re calling SCOPE_IDENTITY from.  Which does make sense in a &#8220;I just spent 3 hours fixing my code&#8221; kinda way.  Wrote a few new stored procedures on the linked server that returned the identity as an output parameter, easy.  Pain in the ass to figure out what was wrong to begin with.</p>
<p>Only thing it really teaches me: make sure to test the app the same way it&#8217;s going to be setup in the production environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://john.rozeske.com/2007/10/18/scope_identity-across-linked-servers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>10 Easy Arithmetic Tricks</title>
		<link>http://john.rozeske.com/2007/10/03/10-easy-arithmetic-tricks/</link>
		<comments>http://john.rozeske.com/2007/10/03/10-easy-arithmetic-tricks/#comments</comments>
		<pubDate>Thu, 04 Oct 2007 03:00:56 +0000</pubDate>
		<dc:creator>John</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<category><![CDATA[math]]></category>

		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://john.rozeske.com/2007/10/03/10-easy-arithmetic-tricks/</guid>
		<description><![CDATA[From The List Universe.  Where were these when I was in grade school!  The first is by far my favorite:
1. The 11 Times Trick
We all know the trick when multiplying by ten - add 0 to the end of the number, but did you know there is an equally easy trick for multiplying [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://listverse.com/science/10-easy-arithmetic-tricks/" target="_blank">From The List Universe</a>.  Where were these when I was in grade school!  The first is by far my favorite:</p>
<blockquote><p>1. The 11 Times Trick</p>
<p>We all know the trick when multiplying by ten - add 0 to the end of the number, but did you know there is an equally easy trick for multiplying a two digit number by 11? This is it:</p>
<p>Take the original number and imagine a space between the two digits (in this example we will use 52:</p>
<p>5_2</p>
<p>Now add the two numbers together and put them in the middle:</p>
<p>5_(5+2)_2</p>
<p>That is it - you have the answer: 572.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://john.rozeske.com/2007/10/03/10-easy-arithmetic-tricks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>.NET 1.1 browserCaps</title>
		<link>http://john.rozeske.com/2007/09/06/net-11-browsercaps/</link>
		<comments>http://john.rozeske.com/2007/09/06/net-11-browsercaps/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 22:40:47 +0000</pubDate>
		<dc:creator>John</dc:creator>
		
		<category><![CDATA[.Net]]></category>

		<category><![CDATA[Work]]></category>

		<category><![CDATA[browser]]></category>

		<category><![CDATA[browserCaps]]></category>

		<category><![CDATA[config]]></category>

		<guid isPermaLink="false">http://john.rozeske.com/2007/09/06/net-11-browsercaps/</guid>
		<description><![CDATA[I&#8217;ve been working with a series of Panel controls to hide and show various sections of a page.  Since I&#8217;m actively trying to validate the pages, fix errors, and make sure it looks the same between IE and Firefox I happened to notice that the Panel control rendered as a table in Firefox instead [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with a series of Panel controls to hide and show various sections of a page.  Since I&#8217;m actively trying to validate the pages, fix errors, and make sure it looks the same between IE and Firefox I happened to notice that the Panel control rendered as a table in Firefox instead of div, which it does in IE.  This, of course, pissed me off to no end.  So I had to find out why.</p>
<p>It is all because of the wonderful machine.config browserCaps section&#8230;which has never been updated since the 1.1 framework was released.  It controls if .Net uses the HtmlTextWriter (HTML 4.0) or the Html32TextWriter (HTML 3.2) based on the browsers user agent and some regex magic.  Of course Firefox, pretty much all Gecko based browsers, and Apple&#8217;s Safari (AppleWebKit) are not included in any of the definitions so by default it uses the Html32TextWriter.</p>
<p>Through a little web searching I&#8217;ve found a good section to add into the web.config that adds support for Firefox.</p>
<p>Big thanks to <a href="http://slingfive.com/pages/code/browserCaps/" target="_blank">Rob Eberhardt</a> and <a href="http://www.codeproject.com/aspnet/browsercaps.asp">Chris Maunder, Owen Brady and others</a></p>
<p>Code below just for my sanity.</p>

<div class="wp_syntax"><table><tr><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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
</pre></td><td class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;browsercaps<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #808080; font-style: italic;">&lt;!-- GECKO Based Browsers (Netscape 6+, Mozilla/Firefox, ...) //--&gt;</span>
	<span style="color: #808080; font-style: italic;">&lt;!-- Edited by Owen Brady:6-12-05 --&gt;</span>
	<span style="color: #808080; font-style: italic;">&lt;!-- Edited by Owen Brady:10-07-05 --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;(Gecko/[-d]+)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		browser=&quot;Mozilla&quot;
		cookies=&quot;true&quot;
		ecmascriptversion=&quot;0.0&quot;
		frames=&quot;true&quot;
		isColor=&quot;true&quot;
		javaapplets=&quot;true&quot;
		javascript=&quot;true&quot;
		majorversion=&quot;${major}&quot;
		maximumRenderedPageSize=&quot;20000&quot;
		minorversion=&quot;${minor}&quot;
		preferredImageMime=&quot;image/jpeg&quot;
		screenBitDepth=&quot;32&quot;
		supportsDivNoWrap=&quot;false&quot;
		supportsFileUpload=&quot;true&quot;
		tables=&quot;true&quot;
		type=&quot;desktop&quot;
		version=&quot;${version}&quot;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;Gecko/(?'Gecko'd+)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				BrowserBuild=${Gecko}
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;rv:(?'version'(?'major'd+)(?'minor'.[.|w]*))&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				majorversion=&quot;${major}&quot;
				minorversion=&quot;${minor}&quot;
				type=&quot;Mozilla${major}&quot;
				version=&quot;${version}&quot;
				ecmascriptversion=&quot;1.4&quot;
				maximumRenderedPageSize=&quot;300000&quot;
				preferredImageMime=&quot;image/gif&quot;
				supportsCallback=&quot;true&quot;
				supportsDivNoWrap=&quot;false&quot;
				tagwriter=&quot;System.Web.UI.HtmlTextWriter&quot;
				w3cdomversion=&quot;1.0&quot;
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">with</span>=<span style="color: #ff0000;">&quot;%{version}&quot;</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;^1.[4-9]&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						backgroundsounds=&quot;true&quot;
						css1=&quot;true&quot;
						css2=&quot;true&quot;
						javaapplets=&quot;true&quot;
						maximumRenderedPageSize=&quot;2000000&quot;
						preferredImageMime=&quot;image/jpeg&quot;
						screenBitDepth=&quot;32&quot;
						supportsMultilineTextBoxDisplay=&quot;true&quot;
						type=&quot;Mozilla${version}&quot;
						xml=&quot;true&quot;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;Gecko/d+ Firebird/(?'version'(?'major'd+)(?'minor'.d+))|Gecko/d+ Firefox/(?'version'(?'major'd+)(?'minor'.d+))&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						backgroundsounds=&quot;true&quot;
						css1=&quot;true&quot;
						css2=&quot;true&quot;
						javaapplets=&quot;true&quot;
						maximumRenderedPageSize=&quot;2000000&quot;
						preferredImageMime=&quot;image/jpeg&quot;
						screenBitDepth=&quot;32&quot;
						supportsMultilineTextBoxDisplay=&quot;true&quot;
						xml=&quot;true&quot;
						version=${version}
						majorversion=${major}
						minorversion=${minor}
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;m(?'version'd+))&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				version=0.${version}
				majorversion=0
				minorversion=${version}
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;^Mozilla/5.0 Galeon/(?'version'(?'major'd+).(?'minor'd+).(?'revision'd+))&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				browser=Galeon
				version=${version}
				majorversion=${major}
				minorversion=${minor}
				revisionversion=${revision}
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;(Gecko/[-d]+)(?'VendorProductToken' (?'browser'[^/d]*)([d]*)/(?'version'(?'major'd+)(?'minor'.d+)(?'revision'.d+)(?'letters'w*)))&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				browser=${browser}
				version=${version}
				majorversion=0${major}
				minorversion=0${minor}
				revisionversion=0${revision}
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;(Gecko/[-d]+)(?'VendorProductToken' (?'browser'[^/d]*)([d]*)/(?'version'(?'major'd+)(?'minor'.d+)(?'letters'w*)))&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				browser=${browser}
				version=${version}
				majorversion=0${major}
				minorversion=0${minor}
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;Phoenix&quot;</span> <span style="color: #000066;">with</span>=<span style="color: #ff0000;">&quot;%{browser}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				browser=&quot;Firefox&quot;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;Firebird&quot;</span> <span style="color: #000066;">with</span>=<span style="color: #ff0000;">&quot;%{browser}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				browser=&quot;Firefox&quot;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;Mozilla Firebird&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				browser=&quot;Firefox&quot;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;(No IDN) Firefox&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				browser=&quot;Firefox&quot;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;Netscape6&quot;</span> <span style="color: #000066;">with</span>=<span style="color: #ff0000;">&quot;%{browser}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				browser=&quot;Netscape&quot;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;case</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;CS 2000 7.0&quot;</span> <span style="color: #000066;">with</span>=<span style="color: #ff0000;">&quot;%{browser}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				browser=&quot;CS 2000 7.0&quot;
				version=7.0
				majorversion=7
				minorversion=0
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/case<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/browsercaps<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://john.rozeske.com/2007/09/06/net-11-browsercaps/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ASP.Net DataGrid Sort Indicator</title>
		<link>http://john.rozeske.com/2007/08/28/aspnet-datagrid-sort-indicator/</link>
		<comments>http://john.rozeske.com/2007/08/28/aspnet-datagrid-sort-indicator/#comments</comments>
		<pubDate>Tue, 28 Aug 2007 17:07:51 +0000</pubDate>
		<dc:creator>John</dc:creator>
		
		<category><![CDATA[C#]]></category>

		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://john.rozeske.com/2007/08/28/aspnet-datagrid-sort-indicator/</guid>
		<description><![CDATA[Talk about a pain.  You&#8217;d think this would be easier&#8230;.

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
33
34
35
36
37
38
private void Grid_SortCommand&#40;object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e&#41;
&#123;
	DataGrid grid = &#40;DataGrid&#41;source;
	grid.DataSource = CurrentView;
	bool isAsc;
	if &#40;&#40;&#40;DataView&#41;grid.DataSource&#41;.Sort != e.SortExpression&#41;
	&#123;
		&#40;&#40;DataView&#41;grid.DataSource&#41;.Sort = e.SortExpression;
		isAsc = true;
	&#125;
	else
	&#123;
		&#40;&#40;DataView&#41;grid.DataSource&#41;.Sort += &#34; DESC&#34;;
		isAsc = false;
	&#125;
&#160;
	//Loop columns to find sort
	foreach&#40;DataGridColumn col in grid.Columns&#41;
	&#123;
		//Clear header of previous images
		col.HeaderText = col.HeaderText.Replace&#40;&#34;&#60;img src=&#34;http://john.rozeske.com/wp-admin/Images/SortDsc.gif&#34; alt=&#34;Desc&#34; class=&#34;sort&#34; /&#62;&#34;,&#34;&#34;).Replace(&#34;&#60;img src=&#34;http://john.rozeske.com/wp-admin/Images/SortAsc.gif&#34; alt=&#34;Asc&#34; class=&#34;sort&#34; /&#62;&#34;,&#34;&#34;);
		// [...]]]></description>
			<content:encoded><![CDATA[<p>Talk about a pain.  You&#8217;d think this would be easier&#8230;.</p>

<div class="wp_syntax"><table><tr><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
33
34
35
36
37
38
</pre></td><td class="code"><pre class="csharp csharp" style="font-family:monospace;"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> Grid_SortCommand<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> source, <span style="color: #000000;">System.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>.<span style="color: #0000FF;">WebControls</span></span>.<span style="color: #0000FF;">DataGridSortCommandEventArgs</span> e<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	DataGrid grid <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>DataGrid<span style="color: #000000;">&#41;</span>source;
	grid.<span style="color: #0000FF;">DataSource</span> <span style="color: #008000;">=</span> CurrentView;
	<span style="color: #FF0000;">bool</span> isAsc;
	<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>DataView<span style="color: #000000;">&#41;</span>grid.<span style="color: #0000FF;">DataSource</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Sort</span> <span style="color: #008000;">!=</span> e.<span style="color: #0000FF;">SortExpression</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>DataView<span style="color: #000000;">&#41;</span>grid.<span style="color: #0000FF;">DataSource</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Sort</span> <span style="color: #008000;">=</span> e.<span style="color: #0000FF;">SortExpression</span>;
		isAsc <span style="color: #008000;">=</span> true;
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0600FF;">else</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>DataView<span style="color: #000000;">&#41;</span>grid.<span style="color: #0000FF;">DataSource</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Sort</span> <span style="color: #008000;">+=</span> <span style="color: #666666;">&quot; DESC&quot;</span>;
		isAsc <span style="color: #008000;">=</span> false;
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">//Loop columns to find sort</span>
	<span style="color: #0600FF;">foreach</span><span style="color: #000000;">&#40;</span>DataGridColumn col <span style="color: #0600FF;">in</span> grid.<span style="color: #0000FF;">Columns</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-style: italic;">//Clear header of previous images</span>
		col.<span style="color: #0000FF;">HeaderText</span> <span style="color: #008000;">=</span> col.<span style="color: #0000FF;">HeaderText</span>.<span style="color: #0000FF;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;&lt;img src=&quot;</span>http<span style="color: #008000;">:</span><span style="color: #008080; font-style: italic;">//john.rozeske.com/wp-admin/Images/SortDsc.gif&quot; alt=&quot;Desc&quot; class=&quot;sort&quot; /&gt;&quot;,&quot;&quot;).Replace(&quot;&lt;img src=&quot;http://john.rozeske.com/wp-admin/Images/SortAsc.gif&quot; alt=&quot;Asc&quot; class=&quot;sort&quot; /&gt;&quot;,&quot;&quot;);</span>
		<span style="color: #008080; font-style: italic;">// Find the right column</span>
		<span style="color: #0600FF;">if</span><span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">SortExpression</span>.<span style="color: #0000FF;">ToLower</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">CompareTo</span><span style="color: #000000;">&#40;</span>col.<span style="color: #0000FF;">SortExpression</span>.<span style="color: #0000FF;">ToLower</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">==</span> 0<span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0600FF;">if</span><span style="color: #000000;">&#40;</span>isAsc<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				col.<span style="color: #0000FF;">HeaderText</span> <span style="color: #008000;">=</span> col.<span style="color: #0000FF;">HeaderText</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;&lt;img src=&quot;</span>http<span style="color: #008000;">:</span><span style="color: #008080; font-style: italic;">//john.rozeske.com/wp-admin/Images/SortAsc.gif&quot; alt=&quot;Asc&quot; class=&quot;sort&quot; /&gt;&quot;;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0600FF;">else</span>
			<span style="color: #000000;">&#123;</span>
				col.<span style="color: #0000FF;">HeaderText</span> <span style="color: #008000;">=</span> col.<span style="color: #0000FF;">HeaderText</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;&lt;img src=&quot;</span>http<span style="color: #008000;">:</span><span style="color: #008080; font-style: italic;">//john.rozeske.com/wp-admin/Images/SortDsc.gif&quot; alt=&quot;Desc&quot; class=&quot;sort&quot; /&gt;&quot;;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">//Bind the grid data</span>
	grid.<span style="color: #0000FF;">DataBind</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://john.rozeske.com/2007/08/28/aspnet-datagrid-sort-indicator/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Jim Garlitz’s Water Chopper</title>
		<link>http://john.rozeske.com/2007/08/22/jim-garlitzs-water-chopper/</link>
		<comments>http://john.rozeske.com/2007/08/22/jim-garlitzs-water-chopper/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 15:55:14 +0000</pubDate>
		<dc:creator>John</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://john.rozeske.com/2007/08/22/jim-garlitzs-water-chopper/</guid>
		<description><![CDATA[
Just amazing!  Guy builds a water bike in his free time for under $1k.  Wonder how fast these will be mass produced!
]]></description>
			<content:encoded><![CDATA[<p><a href="hthttp://www.bookofjoe.com/2007/08/jim-garlitzs-wa.html" target="_blank"><img src="http://john.rozeske.com/wp-content/uploads/2007/08/waterbike6300707.jpg" alt="GarlitzWaterBike" height="243" width="426" /></a></p>
<p>Just amazing!  Guy builds a water bike in his free time for under $1k.  Wonder how fast these will be mass produced!</p>
]]></content:encoded>
			<wfw:commentRss>http://john.rozeske.com/2007/08/22/jim-garlitzs-water-chopper/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Suicide Bananas!</title>
		<link>http://john.rozeske.com/2007/08/09/suicide-bananas/</link>
		<comments>http://john.rozeske.com/2007/08/09/suicide-bananas/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 15:36:18 +0000</pubDate>
		<dc:creator>John</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://john.rozeske.com/2007/08/09/suicide-bananas/</guid>
		<description><![CDATA[
All credit to kdsglass flickr stream
]]></description>
			<content:encoded><![CDATA[<p><a href="http://john.rozeske.com/2007/08/09/suicide-bananas/suicide-bananas/" rel="attachment wp-att-5" title="Suicide Bananas"><img src="http://john.rozeske.com/wp-content/uploads/2007/08/suicidebananas.jpg" alt="Suicide Bananas" /></a></p>
<p>All credit to <a href="http://www.flickr.com/photos/kdsglass/">kdsglass flickr stream</a></p>
]]></content:encoded>
			<wfw:commentRss>http://john.rozeske.com/2007/08/09/suicide-bananas/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Digg &amp; Reddit: Create and Submit Your Content. It’s Necessary</title>
		<link>http://john.rozeske.com/2007/08/02/digg-reddit-create-and-submit-your-content-its-necessary/</link>
		<comments>http://john.rozeske.com/2007/08/02/digg-reddit-create-and-submit-your-content-its-necessary/#comments</comments>
		<pubDate>Thu, 02 Aug 2007 22:01:50 +0000</pubDate>
		<dc:creator>Digg</dc:creator>
		
		<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://john.rozeske.com/2007/08/02/digg-reddit-create-and-submit-your-content-its-necessary/</guid>
		<description><![CDATA[&#8220;I wrote recently about learning to differentiate between blogspam and self-submitted content on meritocracy-based sites like Digg and Reddit. My goal was to try and reverse the negative programming we all have towards reading self-submitted material. But this is not spamming.&#8221; dmiesler.com
A good counter point to self submitting articles.   I&#8217;ll still wait until [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;I wrote recently about learning to differentiate between blogspam and self-submitted content on meritocracy-based sites like Digg and Reddit. My goal was to try and reverse the negative programming we all have towards reading self-submitted material. But this is not spamming.&#8221; dmiesler.com</p></blockquote>
<p>A good counter point to self submitting articles.   I&#8217;ll still wait until I write something worthwhile before submitting it myself&#8230;or I&#8217;ll just ask a friend to do it.</p>
<p><a href="http://dmiessler.com/blogarchive/dear-readers-please-submit-your-own-content">read more</a> | <a href="http://digg.com/tech_news/Digg_Reddit_Create_and_Submit_Your_Content_It_s_Necessary">digg story</a></p>
]]></content:encoded>
			<wfw:commentRss>http://john.rozeske.com/2007/08/02/digg-reddit-create-and-submit-your-content-its-necessary/feed/</wfw:commentRss>
		</item>
		<item>
		<title>First post heading to Technorati!</title>
		<link>http://john.rozeske.com/2007/08/01/first-post-heading-to-technorati/</link>
		<comments>http://john.rozeske.com/2007/08/01/first-post-heading-to-technorati/#comments</comments>
		<pubDate>Wed, 01 Aug 2007 20:48:14 +0000</pubDate>
		<dc:creator>John</dc:creator>
		
		<category><![CDATA[Internet]]></category>

		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://john.rozeske.com/2007/08/01/first-post-heading-to-technorati/</guid>
		<description><![CDATA[Technorati Profile
]]></description>
			<content:encoded><![CDATA[<p><a href="http://technorati.com/claim/jxwuumw3g" rel="me">Technorati Profile</a></p>
]]></content:encoded>
			<wfw:commentRss>http://john.rozeske.com/2007/08/01/first-post-heading-to-technorati/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://john.rozeske.com/2007/07/13/hello-world/</link>
		<comments>http://john.rozeske.com/2007/07/13/hello-world/#comments</comments>
		<pubDate>Fri, 13 Jul 2007 16:57:02 +0000</pubDate>
		<dc:creator>John</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false" />
		<description><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
]]></description>
			<content:encoded><![CDATA[<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://john.rozeske.com/2007/07/13/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.671 seconds --><!-- Cached page generated by WP-Super-Cache on 2009-01-06 13:28:51 -->
