<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4046651698016467102</id><updated>2012-02-01T13:36:01.651-08:00</updated><category term='dcshoecousa'/><category term='alienware'/><category term='udp'/><category term='sharepod'/><category term='encoding'/><category term='currys'/><category term='placeholder'/><category term='mouseX'/><category term='??'/><category term='ilan baroukh'/><category term='cd cover'/><category term='visual sourcesafe'/><category term='page_clientvalidate'/><category term='Canonicalization apache'/><category term='simon wallwork'/><category term='challenges'/><category term='hint'/><category term='popup'/><category term='css'/><category term='gacutil'/><category term='dragonforce'/><category term='port numbers'/><category term='function'/><category term='cage'/><category term='wrt54g'/><category term='borovets'/><category term='firmware'/><category term='css attributes'/><category term='price promise'/><category term='guitar'/><category term='xbox'/><category term='bonus'/><category term='liv flaherty'/><category term='nullable types'/><category term='xp'/><category term='windows live messenger'/><category term='laptop'/><category term='chris sidoli'/><category term='chm'/><category term='avatars'/><category term='xml'/><category term='Windows Vista'/><category term='static ip'/><category term='wizard'/><category term='error 26'/><category term='georgina wyld'/><category term='controls'/><category term='meta tag'/><category term='SQL Server 2005'/><category term='page language'/><category term='neil kilbride'/><category term='windows internet explorer'/><category term='postback'/><category term='game'/><category term='regular expression'/><category term='clientY'/><category term='fraser young'/><category term='state'/><category term='mvc'/><category term='tcp/ip'/><category term='mouseY'/><category term='episerver'/><category term='n1 vision'/><category term='pc world'/><category term='wireless gaming adapter'/><category term='asp:linkbutton'/><category term='software'/><category term='festival'/><category term='html'/><category term='aol broadband'/><category term='sainsburys'/><category term='form button'/><category term='asp.net'/><category term='rock god'/><category term='mtu'/><category term='rank'/><category term='10 trip'/><category term='tram'/><category term='1 on 1'/><category term='guitar hero 3'/><category term='validaterequest'/><category term='text-align'/><category term='pre'/><category term='itunes'/><category term='barracks'/><category term='hover'/><category term='c#.net'/><category term='scheduled task'/><category term='paypoint'/><category term='r2-d2'/><category term='client-side validation'/><category term='xbox live'/><category term='fare'/><category term='bulgaria'/><category term='error 28'/><category term='sctp'/><category term='page_isvalid'/><category term='net'/><category term='javascript'/><category term='home theater kit'/><category term='linkbutton'/><category term='window.open'/><category term='voucher codes'/><category term='apple'/><category term='sony'/><category term='map'/><category term='hosts'/><category term='serialization'/><category term='tag'/><category term='event'/><category term='prices'/><category term='template'/><category term='becky neal'/><category term='cheat'/><category term='capitalise'/><category term='aspstate'/><category term='form'/><category term='codes'/><category term='belkin'/><category term='download'/><category term='through the fire and flames'/><category term='plugin'/><category term='layers'/><category term='onclientclick'/><category term='Graphix Boa'/><category term='windows'/><category term='rainbow six vegas 2'/><category term='windows live mail'/><category term='public transport'/><category term='code'/><category term='httpwebrequest'/><category term='clientX'/><category term='hardware'/><category term='DC'/><category term='database'/><category term='snowboarding boots'/><category term='album artwork'/><category term='crash'/><category term='windows media player'/><category term='ross chambers'/><category term='watermark'/><category term='stored procedure'/><category term='onclick'/><category term='nano'/><category term='microsoft compiled html help files'/><category term='silverlight'/><category term='internet explorer'/><category term='aol'/><category term='aspnetdb'/><category term='call of duty 4'/><category term='comcast'/><category term='asp.net form'/><category term='asp.net-mvc iprincipal'/><category term='reset'/><category term='port forwarding'/><category term='disabled'/><category term='ghost button'/><category term='asp:placeholder'/><category term='asp:button'/><category term='clr20r3'/><category term='autocomplete'/><category term='littlewoods'/><category term='button'/><category term='sky broadband'/><category term='page type'/><category term='sql server'/><category term='nas'/><category term='linksys'/><category term='http status codes'/><category term='voucher'/><category term='textbox'/><category term='jquery'/><category term='columns'/><category term='hyperlink'/><category term='nottingham'/><category term='defaultbutton'/><category term='nat settings'/><category term='textmode'/><category term='sql'/><category term='ipod'/><category term='unix'/><category term='svilen hristov dokuzov'/><category term='eventtype'/><category term='stringwriter'/><category term='m9750'/><category term='forfiles'/><category term='luke ogelsby'/><category term='value types'/><category term='snowboarding'/><category term='viewstate'/><category term='password'/><title type='text'>Andrew Gunn's Blog</title><subtitle type='html'>Tales of a half pint...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default?start-index=101&amp;max-results=100'/><author><name>Andrew Gunn</name><uri>http://www.blogger.com/profile/07687301186540182546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>102</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-2637378629484375132</id><published>2009-08-05T05:24:00.000-07:00</published><updated>2009-08-10T01:15:42.668-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Canonicalization apache'/><title type='text'>Catch-all redirect in Apache</title><content type='html'>&lt;p&gt;Assume you have a website running on an Apache server and the URL is http://mydomain.com/. What if you want to dominate the UK market too!? You'd probably buy mydomain.co.uk and point it to the same server. This is bad! It causes something called &lt;strong&gt;&lt;a href="http://www.mattcutts.com/blog/seo-advice-url-canonicalization/" title="Canonicalization"&gt;Canonicalization&lt;/a&gt;&lt;/strong&gt; - web content that has more than one possible URL. This can lead to massive SEO penalties so my advice is avoid it at all costs.&lt;/p&gt;&lt;p&gt;Instead, have a single URL that serves the content and defer anything else. In this scenario, mycompany.com would be the master and the rest (e.g. mycompany.co.uk) would return a &lt;a href="http://andrewgunn.blogspot.com/2008/04/http-status-codes.html" title="HTTP Status Codes"&gt;301 redirect&lt;/a&gt; (not a 302). It's also worth mentioning that http://www.mycompany.com/ and http://mycompany.com/ are different (with and without the "www." prefix). If they both serve the same content, &lt;strong&gt;&lt;a href="http://www.mattcutts.com/blog/seo-advice-url-canonicalization/" title="Canonicalization"&gt;Canonicalization&lt;/a&gt;&lt;/strong&gt; will occur. Choose one and stick with it.&lt;/p&gt;&lt;p&gt;The following can be put inside the httpd.conf file to allow a single URL access to a website and redirect the others:&lt;/p&gt;&lt;pre class="brush: xml"&gt;&amp;lt;VirtualHost *:80&gt;&lt;br /&gt;    ServerName mydomain.com&lt;br /&gt;    DocumentRoot /var/www&lt;br /&gt;&amp;lt;/VirtualHost&gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;VirtualHost *:80&gt;&lt;br /&gt;    ServerName default&lt;br /&gt;    ServerAlias *&lt;br /&gt;    Redirect 301 / http://mydomain.com/&lt;br /&gt;&amp;lt;/VirtualHost&gt;&lt;/pre&gt;&lt;p&gt;I'll also do a follow-up post to show how to do the same in IIS.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-2637378629484375132?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/2637378629484375132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=2637378629484375132' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/2637378629484375132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/2637378629484375132'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/08/catch-all-redirect-in-apache.html' title='Catch-all redirect in Apache'/><author><name>Andrew Gunn</name><uri>http://www.blogger.com/profile/07687301186540182546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3814652158544956723</id><published>2009-07-22T04:05:00.001-07:00</published><updated>2009-07-22T04:06:37.270-07:00</updated><title type='text'>Agile Development</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_Mfr8m-ym99w/SmbytqRtZ3I/AAAAAAAAAAU/Dfcxtd8fL-s/s1600-h/Agile.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 124px;" src="http://4.bp.blogspot.com/_Mfr8m-ym99w/SmbytqRtZ3I/AAAAAAAAAAU/Dfcxtd8fL-s/s400/Agile.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5361239272687757170" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3814652158544956723?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3814652158544956723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3814652158544956723' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3814652158544956723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3814652158544956723'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/07/agile-development.html' title='Agile Development'/><author><name>Andrew Gunn</name><uri>http://www.blogger.com/profile/07687301186540182546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Mfr8m-ym99w/SmbytqRtZ3I/AAAAAAAAAAU/Dfcxtd8fL-s/s72-c/Agile.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5837347649865600971</id><published>2009-07-15T03:28:00.001-07:00</published><updated>2009-07-22T04:46:20.459-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><title type='text'>SQL - Dynamic Order By clause</title><content type='html'>&lt;p&gt;Have you ever wanted a stored procedure to order it's results dynamically? The ORDER BY clause is the place to start but normally relates to a series of columns that's hard-coded. If you want this clause to change depending on some input, you can adapt the following SQL. It contains a switch statement that compares the value of a parameter against pre-defined string column names. When a match is found, the respective clause is inserted. You can also specify the direction (ascending/descending) which doubles the amount of case options.&lt;/p&gt;&lt;pre class="brush: sql"&gt;declare @orderBy nvarchar(max)&lt;br /&gt;set @orderBy = 'columnName'&lt;br /&gt; &lt;br /&gt;-- 0 Descending&lt;br /&gt;-- 1 Acsending&lt;br /&gt;declare @orderByDirection int&lt;br /&gt;set @orderByDirection = 0&lt;br /&gt; &lt;br /&gt;select *&lt;br /&gt;from tableName&lt;br /&gt;order by&lt;br /&gt;    case when @orderBy = 'columnName' and @orderByDirection = 0&lt;br /&gt;        then columnName end desc,&lt;br /&gt;    case when @orderBy = 'columnName' and @orderByDirection = 1&lt;br /&gt;        then columnName end&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5837347649865600971?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5837347649865600971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5837347649865600971' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5837347649865600971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5837347649865600971'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/07/sql-dynamic-order-by-clause.html' title='SQL - Dynamic Order By clause'/><author><name>Andrew Gunn</name><uri>http://www.blogger.com/profile/07687301186540182546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-1761836850858091702</id><published>2009-07-13T09:19:00.000-07:00</published><updated>2009-07-22T04:54:12.655-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net-mvc iprincipal'/><title type='text'>ASP.NET MVC - UserControls and IPrincipal</title><content type='html'>&lt;p&gt;This is my first post on ASP.NET MVC so I'm gonna keep it short and sweet (I'm sure they'll be plenty more to come :-D).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;On a MVC View Page, you can access the user that has been previously authenticated with ease:&lt;/p&gt;&lt;pre class="brush: xml"&gt;&amp;lt;%= User.Identity.Name %&gt;&lt;/pre&gt;&lt;p&gt;Unfortunately, you can't do the same in an MVC View User Control because they don't have a property called &lt;span class="code"&gt;User&lt;/span&gt;. Instead, you have to use the ViewContext property which is available on any MVC View:&lt;/p&gt;&lt;pre class="brush: xml"&gt;&amp;lt;%= ViewContext.HttpContext.User.Identity.Name %&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-1761836850858091702?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/1761836850858091702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=1761836850858091702' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1761836850858091702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1761836850858091702'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/07/aspnet-mvc-usercontrols-and-iprincipal.html' title='ASP.NET MVC - UserControls and IPrincipal'/><author><name>Andrew Gunn</name><uri>http://www.blogger.com/profile/07687301186540182546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4306989925471856271</id><published>2009-02-20T01:06:00.000-08:00</published><updated>2009-07-22T04:49:32.424-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='serialization'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><title type='text'>To serialize, or not to serialize - that is the question</title><content type='html'>&lt;p&gt;When &lt;a href="http://andrewgunn.blogspot.com/2008/06/xml-serialization-in-cnet.html"&gt;serializing&lt;/a&gt; objects, you sometimes want to exclude properties that don't meet a certain criteria. This validation could be a simple check for default/null values or a more complicated scenario.&lt;/p&gt;&lt;p&gt;This example shows how to prevent a &lt;strong&gt;DateTime&lt;/strong&gt; property being &lt;a href="http://andrewgunn.blogspot.com/2008/06/xml-serialization-in-cnet.html"&gt;serialized&lt;/a&gt; if it hasn't been set, meaning it's value will be &lt;strong&gt;DateTime.MinValue&lt;/strong&gt;. You'll notice there is the property for date of birth and a method called ShouldSerializeDateOfBirth that has no parameters and returns a boolean value. If this returns true, serialize, and vice versa. How does it get called I hear you ask. I don't actually know exactly but the key to invoking is in the name - make sure it starts with "ShouldSerialize" followed by the name of the property (in this case, "DateOfBirth").&lt;/p&gt;&lt;pre class="brush: csharp"&gt;public bool ShouldSerializeDateOfBirth() { return DateOfBirth != DateTime.MinValue; }&lt;br /&gt; &lt;br /&gt;[XmlElement("dateofbirth")]&lt;br /&gt;public DateTime DateOfBirth { get; set; }&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4306989925471856271?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4306989925471856271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4306989925471856271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4306989925471856271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4306989925471856271'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/02/to-serialize-or-not-to-serialize-that.html' title='To serialize, or not to serialize - that is the question'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-2231437168915233257</id><published>2009-02-09T03:35:00.000-08:00</published><updated>2009-07-22T06:23:00.649-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='aspstate'/><title type='text'>How do I create the ASPState database?</title><content type='html'>&lt;p&gt;After installing the Microsoft .NET framework 2.0, launch a command window and run:&lt;/p&gt;&lt;pre class="brush: plain"&gt;aspnet_regsql.exe -ssadd -sstype p -S {Server} -U {Username} -P {Password}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-2231437168915233257?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/2231437168915233257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=2231437168915233257' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/2231437168915233257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/2231437168915233257'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/02/how-do-i-create-aspstate-database.html' title='How do I create the ASPState database?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-1505967900248030760</id><published>2009-01-30T07:08:00.000-08:00</published><updated>2009-07-22T06:28:00.734-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>CSS "or" separator</title><content type='html'>&lt;pre class="brush: xml"&gt;&amp;lt;div style="background-color: white; margin-left: -10px; margin-top: 40px; padding: 5px; position: absolute;"&gt;or&amp;lt;/div&gt;&lt;br /&gt;&amp;lt;div style="border-left: solid 1px #999; height: 8em; margin:auto; width: 1px;"&gt;&amp;lt;/div&gt;&lt;/pre&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;div style="margin-left: 10px; width: 1px;"&gt;&lt;div style="background-color: black; color: white; margin-left: -10px; margin-top: 40px; padding: 5px; position: absolute;"&gt;or&lt;/div&gt;&lt;div style="border-left: solid 1px #999; height: 8em; margin:auto; width: 1px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin-top: 10px"&gt;* Copied from &lt;a href="http://stackoverflow.com"&gt;Stack Overflow&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-1505967900248030760?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/1505967900248030760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=1505967900248030760' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1505967900248030760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1505967900248030760'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/01/css-or-separator.html' title='CSS &quot;or&quot; separator'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5285771216141916438</id><published>2009-01-26T11:39:00.000-08:00</published><updated>2009-01-26T11:42:56.207-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows live mail'/><category scheme='http://www.blogger.com/atom/ns#' term='windows live messenger'/><title type='text'>0x80048820</title><content type='html'>I recently kept getting an error after trying to sign into Windows Live Messenger or sync Windows Live Mail. My laptop had been unplugged at the mains for over a week and the date/time settings were scrambled. I noticed the time was wrong but I failed to spot the year was 2002. I simply changed it to 2009 and hey presto, problem solved.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5285771216141916438?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5285771216141916438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5285771216141916438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5285771216141916438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5285771216141916438'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/01/0x80048820.html' title='0x80048820'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4863571425004646875</id><published>2009-01-16T03:25:00.000-08:00</published><updated>2009-01-16T03:37:58.616-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='forfiles'/><title type='text'>How do I clean up my log files?</title><content type='html'>Create a scheduled task that will execute the following command:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;C:\WINDOWS\system32\forfiles.exe /p C:\logs /s /m *.log /d -7 /c "CMD /C del @FILE"&lt;/pre&gt;&lt;br /&gt;This example recursively deletes "*.log" files older than 7 days. If you simply wanted to move the files, change the comannd parameter - this provides a nice way to archive.&lt;br /&gt;&lt;br /&gt;For further information, see the &lt;a href="http://technet.microsoft.com/en-us/library/cc753551.aspx"&gt;Forfiles&lt;/a&gt; documentation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4863571425004646875?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4863571425004646875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4863571425004646875' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4863571425004646875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4863571425004646875'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/01/how-do-i-clean-up-my-log-files.html' title='How do I clean up my log files?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-511312136198680449</id><published>2009-01-09T07:09:00.001-08:00</published><updated>2009-01-16T00:59:32.012-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mvc'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Custom controls in ASP.NET MVC</title><content type='html'>Finally, my article on custom controls in ASP.NET MVC has been published on CodeProject so check it out:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/custom-controls/MVCCustomControls.aspx"&gt;http://www.codeproject.com/KB/custom-controls/MVCCustomControls.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-511312136198680449?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/511312136198680449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=511312136198680449' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/511312136198680449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/511312136198680449'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/01/custom-controls-in-aspnet-mvc.html' title='Custom controls in ASP.NET MVC'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-9210748800424761026</id><published>2009-01-08T01:34:00.000-08:00</published><updated>2009-06-22T02:04:07.792-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugin'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='watermark'/><title type='text'>jQuery watermark plugin</title><content type='html'>Here is a jQuery plugin for adding a watermark effect to elements (e.g. text box):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;(function($) {&lt;br /&gt;    // The element that has focus (or null when nothing has focus).&lt;br /&gt;    var inputFocus = null;&lt;br /&gt; &lt;br /&gt;    // This keeps track of the element that has focus.&lt;br /&gt;    $(":input").focus(function() {&lt;br /&gt;        inputFocus = this;&lt;br /&gt;    }).blur(function() {&lt;br /&gt;        inputFocus = null;&lt;br /&gt;    });&lt;br /&gt; &lt;br /&gt;    $.fn.hasFocus = function() {&lt;br /&gt;        return this.attr("id") == $(inputFocus).attr("id");&lt;br /&gt;    }&lt;br /&gt;})(jQuery);&lt;br /&gt; &lt;br /&gt;(function($) {&lt;br /&gt;    var watermarkDefaults = {&lt;br /&gt;        watermarkedClass: "input-watermarked",&lt;br /&gt;        watermarkedText: ""&lt;br /&gt;    };&lt;br /&gt; &lt;br /&gt;    $.fn.watermark = function(settings) {&lt;br /&gt;        settings = $.extend({}, watermarkDefaults, settings);&lt;br /&gt; &lt;br /&gt;        var self = this;&lt;br /&gt; &lt;br /&gt;        self.addWatermark(settings);&lt;br /&gt; &lt;br /&gt;        if (self.isWatermarked(settings)) {&lt;br /&gt;            settings.watermarkedText = self.val();&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        self.focus(function() {&lt;br /&gt;            self.removeWatermark(settings);&lt;br /&gt;        });&lt;br /&gt; &lt;br /&gt;        // This might be an expensive exeucution!?&lt;br /&gt;        // Added to prevent strange behaviour when the user&lt;br /&gt;        // sets the focus before everything has fully loaded.&lt;br /&gt;        self.keydown(function() {&lt;br /&gt;            self.removeWatermark(settings);&lt;br /&gt;        });&lt;br /&gt; &lt;br /&gt;        self.blur(function() {&lt;br /&gt;            self.addWatermark(settings);&lt;br /&gt;        });&lt;br /&gt; &lt;br /&gt;        // Clear the watermark text when the form is submitted.&lt;br /&gt;        self.parents("form:first").submit(function() {&lt;br /&gt;            self.removeWatermark(settings);&lt;br /&gt;        });&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    $.fn.addWatermark = function(settings) {&lt;br /&gt;        settings = $.extend({}, watermarkDefaults, settings);&lt;br /&gt; &lt;br /&gt;        if (!this.hasFocus() &amp;amp;&amp;amp; (this.val().length === 0  this.val() === settings.watermarkedText)) {&lt;br /&gt;            this.addClass(settings.watermarkedClass);&lt;br /&gt; &lt;br /&gt;            this.val(settings.watermarkedText);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    $.fn.isWatermarked = function(settings) {&lt;br /&gt;        settings = $.extend({}, watermarkDefaults, settings);&lt;br /&gt; &lt;br /&gt;        return this.hasClass(settings.watermarkedClass)/* &amp;amp;&amp;amp; this.val() === settings.watermarkedText*/;&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    $.fn.removeWatermark = function(settings) {&lt;br /&gt;        settings = $.extend({}, watermarkDefaults, settings);&lt;br /&gt; &lt;br /&gt;        if (this.isWatermarked(settings)) {&lt;br /&gt;            this.removeClass(settings.watermarkedClass);&lt;br /&gt; &lt;br /&gt;            this.val("");&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;})(jQuery);&lt;/pre&gt;&lt;br /&gt;Examples:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$(function(){&lt;br /&gt;    $("#id1").watermark({&lt;br /&gt;        watermarkedClass: "custom-input-watermarked",&lt;br /&gt;        watermarkedText: "Click here..."&lt;br /&gt;    });&lt;br /&gt;});&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;$(function(){&lt;br /&gt;    $("#id2").watermark({&lt;br /&gt;        watermarkedText: "Click here..."&lt;br /&gt;    });&lt;br /&gt;});&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-9210748800424761026?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/9210748800424761026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=9210748800424761026' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/9210748800424761026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/9210748800424761026'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/01/jquery-watermark-plugin.html' title='jQuery watermark plugin'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-7216024785782694507</id><published>2009-01-06T07:40:00.001-08:00</published><updated>2009-01-06T07:40:46.386-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='clr20r3'/><category scheme='http://www.blogger.com/atom/ns#' term='scheduled task'/><category scheme='http://www.blogger.com/atom/ns#' term='eventtype'/><title type='text'>EventType clr20r3</title><content type='html'>I was recently on call when I got alerted to a scheduled task that failed to run - the following error was added to the Event Viewer: &lt;br /&gt;&lt;br /&gt;EventType clr20r3, P1 MyApp.exe, P2 1.0.0.21357, P3 4935215a, P4 MyApp, P5 1.0.0.21357, P6 4935215a, P7 5, P8 1, P9 system.typeinitialization, P10 NIL&lt;br /&gt;&lt;br /&gt;The exe is executed on the first day of every month and we didn't have any problems the previous time. After doing some digging, I got the impression there wasn't a single cause as everyone had a different story. One possible explanation was unhandled exceptions but I knew the application hadn't been updated since it's last execution. What I failed to notice was a config file that had been updated - some required settings simply vanished. Running the exe through a command line interface returned the exception which highlighted the missing values.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-7216024785782694507?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/7216024785782694507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=7216024785782694507' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7216024785782694507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7216024785782694507'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/01/eventtype-clr20r3.html' title='EventType clr20r3'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3349473212623980050</id><published>2009-01-05T05:31:00.000-08:00</published><updated>2009-01-06T07:39:55.943-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>jQuery $(document).ready()</title><content type='html'>We all know that anything inside the $(document).ready() function will execute in between loading the DOM and content. Here is a syntax alternative for those who want to save a few characters:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$(function(){&lt;br /&gt;    // Do something.&lt;br /&gt;});&lt;/pre&gt;&lt;br /&gt;Vs&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$(document).ready(function() {&lt;br /&gt;    // Do something.&lt;br /&gt;});&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3349473212623980050?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3349473212623980050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3349473212623980050' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3349473212623980050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3349473212623980050'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2009/01/jquery-documentready.html' title='jQuery $(document).ready()'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3074190399520929964</id><published>2008-12-09T08:08:00.000-08:00</published><updated>2008-12-09T08:44:33.364-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xbox live'/><category scheme='http://www.blogger.com/atom/ns#' term='avatars'/><title type='text'>Xbox Live Avatars</title><content type='html'>The Xbox 360 dashboard was given a facelift back in November 2008 and one of the new features is Avatars - like a "Mii", only better! I've customised my avatar which you can see right here on my blog. Microsoft have a series of pulic URLs which allow you to download pictures of your avatar (simply replace {gamer-tag} with you know what):&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Full body:&lt;/strong&gt;&lt;br /&gt;http://avatar.xboxlive.com/avatar/{gamer-tag}/avatar-body.png&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Head shot:&lt;/strong&gt;&lt;br /&gt;http://avatar.xboxlive.com/avatar/{gamer-tag}/avatarpic-l.png&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Head shot (small&lt;/strong&gt;&lt;br /&gt;http://avatar.xboxlive.com/avatar/{gamer-tag}/avatarpic-s.png)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here are my pictures:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://avatar.xboxlive.com/avatar/deadlode/avatar-body.png" target="_new"&gt;Full body&lt;/a&gt;&lt;br /&gt;&lt;a href="http://avatar.xboxlive.com/avatar/deadlode/avatarpic-l.png" target="_new"&gt;Head shot&lt;/a&gt;&lt;br /&gt;&lt;a href="http://avatar.xboxlive.com/avatar/deadlode/avatarpic-s.png" target="_new"&gt;Head shot (small)&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3074190399520929964?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3074190399520929964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3074190399520929964' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3074190399520929964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3074190399520929964'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/12/xbox-live-avatars.html' title='Xbox Live Avatars'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-1444608620860321825</id><published>2008-11-03T02:07:00.000-08:00</published><updated>2008-12-08T01:15:16.561-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Equals, Equals Equals or Equals Equals Equals?</title><content type='html'>In JavaScript, you often see conditional statements with 3 equals signs (===). I always thought it was a typo but it turns out to have a significant advantage over the traditional 2 equals signs (==). This post shows how to use 1, 2 or 3 equals signs effectively.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Assign and evaluate&lt;/strong&gt;&lt;br /&gt;&lt;pre&gt; if ( x = y + z ) { alert( "true" ); }&lt;/pre&gt;&lt;br /&gt;Assigns x to the sum of y and z and evaluates the result.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Compare (irrespective of data type)&lt;/strong&gt;&lt;br /&gt;&lt;pre&gt; if ( x == y + z ) { alert( "true" ); }&lt;/pre&gt;&lt;br /&gt;The result of the sum of y and z is compared to x where both sides must have the same value. &lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;x = "5"&lt;br /&gt;y = 10&lt;br /&gt;z = -5&lt;br /&gt;&lt;br /&gt;y + z = 5&lt;br /&gt;&lt;br /&gt;Using the above values, the condition will be considered to be true because the sum of y and z is converted to a string prior to the comparison. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Compare and match data types&lt;/strong&gt;&lt;br /&gt;&lt;pre&gt; if ( x === y + z ) { alert( "true" ); }&lt;/pre&gt;&lt;br /&gt;The result of the sum of y and z is compared to x where both sides must have the same value and be of the same data type.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To summarise, always use === when doing conditional statements unless you want to compare values of different data types.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;* zero and an empty string are considered to be false and all other numbers and strings are considered to be true.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-1444608620860321825?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/1444608620860321825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=1444608620860321825' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1444608620860321825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1444608620860321825'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/11/equals-equals-equals-or-equals-equals.html' title='Equals, Equals Equals or Equals Equals Equals?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-7977441363590780006</id><published>2008-11-01T07:37:00.000-07:00</published><updated>2008-12-09T08:20:31.890-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>SQL Server compatability level</title><content type='html'>When you upgrade to SQL Server 2005, you may find that some SQL statements are no longer valid and produce errors. A typical example is when you have 2 tables under different databases with the same name (the schema is irrelevant).&lt;br /&gt;&lt;br /&gt;Assume that you have 2 databases, MyDatabase1 and MyDatabase2, each containing a table called MyTable. Both tables have a primary key called ID which are also foreign keys between Database1..MyTable and Database2..MyTable. The following SQL statement is valid under SQL Server 2000 but invalid under SQL Server 2005:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;use [MyDatabase1]&lt;br /&gt; &lt;br /&gt;select * from [MyTable]&lt;br /&gt;inner join [Database2]..[MyTable] on [MyTable].[ID] = [Database2]..[MyTable].[ID]&lt;/pre&gt;&lt;br /&gt;SQL Server 2005 is more strict and won't allow you to reference MyTable of MyDatabase1 in this way, even though you've specified the default database (use [MyDatabase1]). Instead you'd have to change the statement:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;select * from [Database1]..[MyTable]&lt;br /&gt;inner join [Database2]..[MyTable] on [Database1]..[MyTable].[ID] = [Database2]..[MyTable].[ID]&lt;/pre&gt;&lt;br /&gt;Alternatively, you can change the compatability level on the nececssary database(s). This is a quick fix and should only be done if you can't easily modify the SQL code.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Open Microsoft SQL Server Management Studio&lt;/li&gt;&lt;li&gt;Expand the 'Databases' node&lt;/li&gt;&lt;li&gt;Right click the database and choose 'Properties'&lt;/li&gt;&lt;li&gt;Go to 'Options' and change the 'Compatability level' accordingly&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;The 3 compatability levels are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SQL Server 7.0 (70)&lt;/li&gt;&lt;li&gt;SQL Server 2000 (80)&lt;/li&gt;&lt;li&gt;SQL Server 2005 (90)&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-7977441363590780006?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/7977441363590780006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=7977441363590780006' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7977441363590780006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7977441363590780006'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/07/sql-server-compatability-level.html' title='SQL Server compatability level'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3281755144718663240</id><published>2008-09-25T03:22:00.000-07:00</published><updated>2008-09-25T05:36:43.121-07:00</updated><title type='text'>iPhone ringtones</title><content type='html'>The following guide is for creating custom iPhone ringtones using iTunes. Some instructions might be specfic to Windows but the same principles apply to other operating systems.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create an AAC format copy of the original song (we'll call this x) - right click on the song and select "Create ACC version" (you might need to change your recording settings first)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Change the start/finish times of x but make sure it's length doesn't exceed 40 seconds - right click on the song and select "Get Info", then go to the "Options" tab&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create an AAC format copy of x - this version will be a lot smaller in size. (we'll call this y)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Navigate to y's physical location (e.g. "C:\Music\Song.m4a") - right click on the song and select "Show in Windows Explorer"&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Rename the file and change it's extension to m4r (e.g. "Song.m4r") - right click on the file and select "Rename"&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Drag the file (or import) into iTunes and it should go into the Ringtones section - if you can't see a Ringtones section, go to Edit &gt; Preferences &gt; General and make sure the check box is selected for "Ringtones"&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Finally, sync your iPhone but make sure it has been setup to sync ringtones - click on the your iPhone (under "Devices") and go to the "Ringtones" tab&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3281755144718663240?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3281755144718663240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3281755144718663240' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3281755144718663240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3281755144718663240'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/09/iphone-ringtones.html' title='iPhone ringtones'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-6575331127508603340</id><published>2008-09-07T03:45:00.001-07:00</published><updated>2008-09-25T05:50:39.540-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hyperlink'/><title type='text'>The hyperlink trailing slash</title><content type='html'>When creating hyperlinks to a folder resource, always trail with a forward a slash.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;http://andrewgunn.blogspot.com/test (slower)&lt;br /&gt; &lt;br /&gt;Vs&lt;br /&gt; &lt;br /&gt;http://andrewgunn.blogspot.com/test/ (faster)&lt;/pre&gt;&lt;br /&gt;Any reqeusts for the URL without a trailing slash will hit the server and a 301 redirect will be returned to the URL with a trailing slash. This is because the server thinks that "test" is a file and tries to locate it. After searching, it realises that the request was actually for a folder called "test"; therefore it's response informs the client of the correct URL (with a trailing slash).&lt;br /&gt;&lt;br /&gt;It makes sense to include the trailing slash to speed up your website and reduce the load on the server. It doesn't make that much difference for root domains but it's good practice anyway:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;http://andrewgunn.blogspot.com&lt;br /&gt; &lt;br /&gt;Vs&lt;br /&gt; &lt;br /&gt;http://andrewgunn.blogspot.com/&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-6575331127508603340?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/6575331127508603340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=6575331127508603340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6575331127508603340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6575331127508603340'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/09/hyperlink-trailing-slash.html' title='The hyperlink trailing slash'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5023895809687150646</id><published>2008-09-07T03:33:00.000-07:00</published><updated>2008-09-07T03:41:00.447-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='??'/><title type='text'>The C# ?? (null coalescing) operator</title><content type='html'>The ?? operator checks whether the value on the left side of the expression is null, and if so it returns an alternate value on the right side of the expression. If the value on the left side of the expression isn't null, it returns the original value.&lt;br /&gt;&lt;br /&gt;Example 1:&lt;br /&gt;&lt;pre&gt;string input = null;&lt;br /&gt;string output = input ?? "Input is null";&lt;br /&gt; &lt;br /&gt;// Outcome: ouput == "Input is null".&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;Example 2:&lt;br /&gt;&lt;pre&gt;string input = "Hello World";&lt;br /&gt;string output = input ?? "Input is null";&lt;br /&gt; &lt;br /&gt;// Outcome: ouput == "Hello World".&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5023895809687150646?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5023895809687150646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5023895809687150646' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5023895809687150646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5023895809687150646'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/09/c-null-coalescing-operator.html' title='The C# ?? (null coalescing) operator'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5324615980137500356</id><published>2008-09-03T06:03:00.000-07:00</published><updated>2008-09-25T05:53:57.499-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='popup'/><title type='text'>JavaScript - Anchor popups</title><content type='html'>If JavaScript is disabled, the user will be redirected to whatever is in the href attribute in a new frame. If JavaScript is enabled, a new window will open with the same content but the parent window will stay at it's current location.&lt;br /&gt;&lt;br /&gt;JavaScript:&lt;br /&gt;&lt;pre&gt;function Popup( url, height, width )&lt;br /&gt;{&lt;br /&gt;    var windowProperties = "toolbar = 0, scrollbars = 1, location = 0, statusbar = 0, menubar = 0, resizable = 1, width = " + width + ", height = " + height + ", left = 50, top = 50";&lt;br /&gt; &lt;br /&gt;    return window.open( url, "", windowProperties );&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;HTML:&lt;br /&gt;&lt;pre&gt;&amp;lt;a href="http://www.google.com/" onclick="javascript:Popup( 'http://www.google.com/', 600, 600 ); return false;" target="_blank"&gt;Test&amp;lt;/a&gt;&lt;/pre&gt;&lt;br /&gt;The morale of the story is always have a backup for users with JavaScript disabled.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5324615980137500356?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5324615980137500356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5324615980137500356' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5324615980137500356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5324615980137500356'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/09/javascript-anchor-popups.html' title='JavaScript - Anchor popups'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3719256448866519331</id><published>2008-08-30T08:43:00.000-07:00</published><updated>2008-08-30T09:07:36.254-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='linkbutton'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>ASP.NET LinkButton without JavaScript</title><content type='html'>If you use ASP.NET LinkButton controls, the client browser must have JavaScript enabled. If JavsScript is disabled, clicking on the link won't cause a postback. To avoid this scenario, use standard Button controls and style them to look like hyperlinks.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;pre&gt;&amp;lt;asp:Button runat="server" CssClass="HyperlinkButton" Text="Submit" /&gt;&lt;/pre&gt;&lt;br /&gt;CSS:&lt;br /&gt;&lt;pre&gt;.HyperlinkButton&lt;br /&gt;{&lt;br /&gt;    background: none;&lt;br /&gt;    border: none;&lt;br /&gt;    cursor: pointer;&lt;br /&gt;    text-align: left;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;.HyperlinkButton:hover&lt;br /&gt;{&lt;br /&gt;    text-decoration: underline;&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3719256448866519331?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3719256448866519331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3719256448866519331' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3719256448866519331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3719256448866519331'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/08/aspnet-linkbutton-without-javascript.html' title='ASP.NET LinkButton without JavaScript'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5256019302336957666</id><published>2008-08-22T05:51:00.001-07:00</published><updated>2008-08-22T05:51:36.719-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>How do I add a HTTP module in ASP.NET?</title><content type='html'>&lt;pre&gt;&amp;lt;?xml version="1.0"?&gt;&lt;br /&gt;&amp;lt;configuration&gt;&lt;br /&gt;    &amp;lt;system.web&gt;&lt;br /&gt;        &amp;lt;httpModules&gt;&lt;br /&gt;            &amp;lt;add name="ModuleName" type="ClassName, AssembleyName" /&gt;&lt;br /&gt;        &amp;lt;/httpModules&gt;&lt;br /&gt;    &amp;lt;/system.web&gt;&lt;br /&gt;&amp;lt;/configuration&gt;&lt;/pre&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;add name="URLRewriter" type="HTTPModules.URLRewriter, HTTPModules" /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5256019302336957666?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5256019302336957666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5256019302336957666' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5256019302336957666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5256019302336957666'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/08/how-do-i-add-http-module-in-aspnet.html' title='How do I add a HTTP module in ASP.NET?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4165831660624736483</id><published>2008-08-22T05:48:00.000-07:00</published><updated>2008-08-22T05:49:21.981-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>How do I create controls at runtime in ASP.NET</title><content type='html'>If you want to create controls at runtime and render them, the LoadControl method should be used instead of doing a normal object declaration. This is the only way that child controls (within the control you want to create) will be instantiated. The LoadControl method accepts the virtual path to the control as a string (e.g. *.ascx file) or the type of control and it's arguements as an object array (pass in null if no arguements need to be supplied). The second overload can be used if the control is part of a class library.&lt;br /&gt;&lt;br /&gt;Although you're creating an object of the control type, I wouldn't recommend doing the following because null reference exceptions will be thrown when any child control is referenced:&lt;br /&gt;&lt;pre&gt;MyControl myControl = new MyControl();&lt;/pre&gt;&lt;br /&gt;These examples show how dynamically create controls correctly:&lt;br /&gt;&lt;br /&gt;Example 1:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;MyControl myControl = LoadControl( "MyControl.ascx" ) as MyControl;&lt;br /&gt; &lt;br /&gt;if ( myControl != null )&lt;br /&gt;{&lt;br /&gt;    // Do something.&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Example 2:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;MyControl myControl = LoadControl( typeof( MyControl ), null ) as MyControl;&lt;br /&gt; &lt;br /&gt;if ( myControl != null )&lt;br /&gt;{&lt;br /&gt;    // Do something.&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;I normally have a PlaceHolder indicating the position where I want this dynamic content:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;phDynamicControls.Controls.Add( myControl );&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4165831660624736483?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4165831660624736483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4165831660624736483' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4165831660624736483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4165831660624736483'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/08/how-do-i-create-controls-at-runtime-in.html' title='How do I create controls at runtime in ASP.NET'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-6961325997893157846</id><published>2008-08-22T04:44:00.000-07:00</published><updated>2008-09-07T03:46:44.780-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>HTML labels</title><content type='html'>HTML labels can be placed next to form controls as an indication of what they represent so the user has an idea of their expecated value(s). They can also be linked to an individual control using the &lt;b&gt;for&lt;/b&gt; attribute. This means that when the user clicks on the label, the focus of the page will be set to the respective control.&lt;br /&gt;&lt;pre&gt;&amp;lt;label for="name"&gt;&lt;br /&gt;    Name&lt;br /&gt;&amp;lt;/label&gt;&lt;br /&gt;&amp;lt;input type="textbox" name="name" id="name" /&gt;&lt;/pre&gt;&lt;br /&gt;Clicking on the label will set the focus to the input box.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;label for="name"&gt;Name&lt;/label&gt; &lt;input type="textbox" name="name" id="name" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-6961325997893157846?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/6961325997893157846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=6961325997893157846' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6961325997893157846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6961325997893157846'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/08/html-labels.html' title='HTML labels'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-913923934831583837</id><published>2008-08-22T04:32:00.000-07:00</published><updated>2008-08-22T04:40:51.271-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>How do I include browser specific CSS files?</title><content type='html'>Internet Explorer 6 and 7 respectively:&lt;br /&gt;&lt;pre&gt;&amp;lt;!--[if lte IE 6]&gt;&amp;lt;link href="/css/IE6.css" rel="stylesheet" type="text/css" /&gt;&amp;lt;![endif]--&gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;!--[if lte IE 7]&gt;&amp;lt;link href="/css/IE7.css" rel="stylesheet" type="text/css" /&gt;&amp;lt;![endif]--&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-913923934831583837?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/913923934831583837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=913923934831583837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/913923934831583837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/913923934831583837'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/08/how-do-i-include-browser-specific-css.html' title='How do I include browser specific CSS files?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3585755443585753149</id><published>2008-07-31T08:38:00.000-07:00</published><updated>2008-09-07T03:46:29.794-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='r2-d2'/><title type='text'>R2-D2 console application</title><content type='html'>This is the best application I've ever made - but absolutely pointless!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;using System;&lt;br /&gt; &lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;    static void Main( string[] args )&lt;br /&gt;    {&lt;br /&gt;        Random random = new Random( DateTime.UtcNow.Millisecond  );&lt;br /&gt; &lt;br /&gt;        do&lt;br /&gt;        {&lt;br /&gt;            Console.Beep( random.Next( 37, 32767 ), 50 );&lt;br /&gt;        }&lt;br /&gt;        while ( !System.Console.KeyAvailable );&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3585755443585753149?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3585755443585753149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3585755443585753149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3585755443585753149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3585755443585753149'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/07/r2-d2-console-application.html' title='R2-D2 console application'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-1991702644434628714</id><published>2008-07-22T06:49:00.000-07:00</published><updated>2008-07-24T01:05:47.853-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><title type='text'>How do I have a public get and a private set for a property in C#.NET?</title><content type='html'>&lt;pre&gt;using System;&lt;br /&gt; &lt;br /&gt;public class Person&lt;br /&gt;{&lt;br /&gt;    private string name;&lt;br /&gt; &lt;br /&gt;    public string Name&lt;br /&gt;    {&lt;br /&gt;        get { return name; }&lt;br /&gt;        private set { name = value; }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public Person( string name )&lt;br /&gt;    {&lt;br /&gt;        Name = name;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;You're probably thinking that the constructor could simply access the private member variable but I prefer to use properties for any interaction. It also means that you don't have to use the 'this' keyword if members and parameters have the same name:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;this.name = name;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-1991702644434628714?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/1991702644434628714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=1991702644434628714' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1991702644434628714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1991702644434628714'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/07/how-do-i-have-public-get-and-private.html' title='How do I have a public get and a private set for a property in C#.NET?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-6748352702900020058</id><published>2008-07-17T01:14:00.000-07:00</published><updated>2008-09-07T03:47:07.562-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Vista'/><title type='text'>Windows Vista Areo theme stopped working!</title><content type='html'>Make sure the theme service is still running:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Start &gt; Run &gt; 'services.msc'&lt;/li&gt;&lt;li&gt;Scroll down the list and find 'Theme'&lt;/li&gt;&lt;li&gt;Restart it by clicking the link on the left&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;If this doesn't bring Aero back then you'll need to re-select the theme:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Right click on the desktop and choose 'Personalize'&lt;/li&gt;&lt;li&gt;Choose 'Theme'&lt;/li&gt;&lt;li&gt;From the drop down list, click 'Browse' and go to 'C:\Windows\Resources\Themes'&lt;/li&gt;&lt;li&gt;Choose 'aero.theme'&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;You should be back in business!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-6748352702900020058?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/6748352702900020058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=6748352702900020058' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6748352702900020058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6748352702900020058'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/07/windows-vista-areo-theme-stopped.html' title='Windows Vista Areo theme stopped working!'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3608161586802614346</id><published>2008-07-11T06:10:00.000-07:00</published><updated>2008-09-07T03:47:41.836-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='meta tag'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>Robots META tag</title><content type='html'>The Robots META tag can be used to control how robots function when they crawl specific pages. The most common reason for adding this tag would be to prevent robots indexing and/or following any links on the page.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"&gt;&lt;/pre&gt;&lt;br /&gt;The following values can be added the CONTENT attribute:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;INDEX&lt;/li&gt;&lt;li&gt;NOINDEX&lt;/li&gt;&lt;li&gt;FOLLOW&lt;/li&gt;&lt;li&gt;NOFOLLOW&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Multiple comma-separated values are allowed and the default is "INDEX, FOLLOW" (if no Robots META tag is supplied).&lt;br /&gt;&lt;br /&gt;Remaining combinations:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;META NAME="ROBOTS" CONTENT="INDEX, FOLLOW"&gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;META NAME="ROBOTS" CONTENT="INDEX, NOFOLLOW"&gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW"&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3608161586802614346?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3608161586802614346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3608161586802614346' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3608161586802614346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3608161586802614346'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/07/robots-meta-tag_11.html' title='Robots META tag'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-1663802836245554793</id><published>2008-07-11T06:08:00.002-07:00</published><updated>2008-09-07T03:48:03.500-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='meta tag'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>Refresh META tag</title><content type='html'>A Refresh META tells the browser to refresh or redirect after a certain interval.&lt;br /&gt;&lt;br /&gt;These examples show how to refresh the current content after 5 seconds, redirect to another URL after 5 seconds and redirect to another URL immediately respectively:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;META HTTP-EQUIV="REFRESH" CONTENT="5"&gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;META HTTP-EQUIV="REFRESH" CONTENT="5;url=http://andrewgunn.blogspot.com/"&gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;META HTTP-EQUIV="REFRESH" CONTENT="0;url=http://andrewgunn.blogspot.com/"&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-1663802836245554793?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/1663802836245554793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=1663802836245554793' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1663802836245554793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1663802836245554793'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/07/refresh-meta-tag.html' title='Refresh META tag'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5469743258154041052</id><published>2008-07-02T13:51:00.000-07:00</published><updated>2008-08-30T09:12:05.418-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='regular expression'/><title type='text'>How do I validate a string Guid in C#.NET?</title><content type='html'>&lt;pre&gt;using System;&lt;br /&gt;using System.Text.RegularExpressions;&lt;br /&gt; &lt;br /&gt;public static class GuidUtility&lt;br /&gt;{&lt;br /&gt;    public static bool IsGuid( string guid )&lt;br /&gt;    {&lt;br /&gt;        if ( !string.IsNullOrEmpty( guid ) )&lt;br /&gt;        {&lt;br /&gt;            Regex regex = new Regex( @"^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$" );&lt;br /&gt; &lt;br /&gt;            return regex.IsMatch( guid );&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5469743258154041052?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5469743258154041052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5469743258154041052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5469743258154041052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5469743258154041052'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/07/how-do-i-validate-string-guid-in-cnet.html' title='How do I validate a string Guid in C#.NET?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3477312144661903848</id><published>2008-07-01T13:32:00.001-07:00</published><updated>2008-08-18T03:35:03.034-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>How do I convert a Unix timestamp into a DateTime object in C#.NET?</title><content type='html'>Unix time, or POSIX time, is the number of seconds elapsed since midnight of January 1, 1970 (UTC).&lt;br /&gt;&lt;br /&gt;Here is a utility class that can be used to convert a Unix timestamp into a DateTime object and vice versa:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;using System;&lt;br /&gt; &lt;br /&gt;public static class DateTimeUtility&lt;br /&gt;{&lt;br /&gt;    public static DateTime UnixOrigin&lt;br /&gt;    {&lt;br /&gt;        get { return new DateTime( 1970, 1, 1, 0, 0, 0, 0 ); }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static DateTime ConvertFromUnixTimestamp( long timestamp )&lt;br /&gt;    {&lt;br /&gt;        return UnixOrigin.AddSeconds( (long)timestamp );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static long ConvertToUnixTimestamp( DateTime dateTime )&lt;br /&gt;    {&lt;br /&gt;        TimeSpan differnce = dateTime - UnixOrigin;&lt;br /&gt; &lt;br /&gt;        return (long)differnce.TotalSeconds;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3477312144661903848?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3477312144661903848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3477312144661903848' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3477312144661903848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3477312144661903848'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/07/how-do-i-convert-unix-timestamp-into.html' title='How do I convert a Unix timestamp into a DateTime object in C#.NET?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4010348140942932905</id><published>2008-06-30T05:56:00.000-07:00</published><updated>2008-09-07T03:48:41.059-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><title type='text'>The ternary prize</title><content type='html'>The ternary operator uses 2 symbols (? and :) to separate a conditional statement and 2 possible expressions. They can be used to represent a simple &lt;b&gt;If...Else...End If&lt;/b&gt; statement on a single line:&lt;br /&gt;&lt;pre&gt;condition ? expression1 : expression2&lt;/pre&gt;&lt;br /&gt;If the condition is true, expression 1 is evaluated. Alternatively, if the condition is false, expression 2 is evaluated.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Random random = new Random( DateTime.Now.Millisecond );&lt;br /&gt; &lt;br /&gt;string response = random.Next( 1, 9 ) &lt; 5 ? "the number is less than 5" : "the number is greater than or equal to 5";&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4010348140942932905?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4010348140942932905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4010348140942932905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4010348140942932905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4010348140942932905'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/ternary-prize.html' title='The ternary prize'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-1660112050511371601</id><published>2008-06-28T10:12:00.000-07:00</published><updated>2008-07-04T00:59:46.997-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><title type='text'>How do I calculate the maximum page index when paging in C#.NET?</title><content type='html'>&lt;pre&gt;using System;&lt;br /&gt; &lt;br /&gt;public static class PagingUtility&lt;br /&gt;{&lt;br /&gt;    /// &amp;lt;summary&gt;&lt;br /&gt;    /// Calculates the maximum page index&lt;br /&gt;    /// &amp;lt;/summary&gt;&lt;br /&gt;    /// &amp;lt;param name="itemCount"&gt;Number of items to be paged&amp;lt;/param&gt;&lt;br /&gt;    /// &amp;lt;param name="pageSize"&gt;Number of items on each page&amp;lt;/param&gt;&lt;br /&gt;    /// &amp;lt;returns&gt;Maximum page index (&gt;=1)&amp;lt;/returns&gt;&lt;br /&gt;    public static int MaximumPageIndex( int itemCount, int pageSize )&lt;br /&gt;    {&lt;br /&gt;        int returnValue = 1;&lt;br /&gt; &lt;br /&gt;        if ( itemCount &gt; 0 &amp;amp;&amp;amp; itemCount &gt; pageSize &amp;amp;&amp;amp; pageSize &gt; 0 )&lt;br /&gt;        {&lt;br /&gt;            returnValue = itemCount / pageSize;&lt;br /&gt; &lt;br /&gt;            int remainder = itemCount % pageSize;&lt;br /&gt; &lt;br /&gt;            if ( remainder &gt; 0 )&lt;br /&gt;            {&lt;br /&gt;                returnValue++;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        return returnValue;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-1660112050511371601?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/1660112050511371601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=1660112050511371601' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1660112050511371601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1660112050511371601'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/how-do-i-calculate-maximum-page-index.html' title='How do I calculate the maximum page index when paging in C#.NET?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5545921034236045974</id><published>2008-06-19T06:51:00.001-07:00</published><updated>2009-01-14T06:23:22.287-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='port numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='regular expression'/><title type='text'>How do I remove the port number from a URL in C#.NET?</title><content type='html'>Regular Expression:&lt;br /&gt;&lt;pre&gt;:{1}\d*&lt;/pre&gt;&lt;br /&gt;Using C#.NET, the above regular expression can be applied to a URL to strip the port number (along with ":"):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Regex regex = new Regex( @":{1}\d{1,}" );&lt;br /&gt;string url = regex.Replace( "http://andrewgunn.blogspot.com:81/", string.Empty );&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5545921034236045974?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5545921034236045974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5545921034236045974' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5545921034236045974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5545921034236045974'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/how-do-i-remove-port-number-from-url-in.html' title='How do I remove the port number from a URL in C#.NET?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-925560040952671384</id><published>2008-06-19T03:24:00.000-07:00</published><updated>2008-09-07T03:49:42.557-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='festival'/><category scheme='http://www.blogger.com/atom/ns#' term='download'/><title type='text'>Festival essentials</title><content type='html'>I went to the Download 2008 last weekend and wanted to share my list of things to remember for those festival newbies (and so I don't forget anything next time):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Antiseptic hand wash (no water requried)&lt;/li&gt;&lt;li&gt;Baby wipes&lt;/li&gt;&lt;li&gt;Beer&lt;/li&gt;&lt;li&gt;Ear plugs&lt;/li&gt;&lt;li&gt;Eye mask&lt;/li&gt;&lt;li&gt;Headache tablets (extra strong)&lt;/li&gt;&lt;li&gt;Sleeping bag&lt;/li&gt;&lt;li&gt;Sunglasses&lt;/li&gt;&lt;li&gt;Sun cream&lt;/li&gt;&lt;li&gt;Tent&lt;/li&gt;&lt;li&gt;Ticket&lt;/li&gt;&lt;li&gt;Toilet paper&lt;/li&gt;&lt;li&gt;Towel&lt;/li&gt;&lt;li&gt;Water&lt;/li&gt;&lt;/ul&gt;If you think of anything else, let me know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-925560040952671384?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/925560040952671384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=925560040952671384' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/925560040952671384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/925560040952671384'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/festival-essentials.html' title='Festival essentials'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3867427629928965354</id><published>2008-06-09T05:53:00.001-07:00</published><updated>2008-07-25T04:19:10.508-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='httpwebrequest'/><title type='text'>How do I submit web requests at runtime in C#.NET?</title><content type='html'>This utility class will make a web request programmatically and return the response as a string. I use it for calling ReST services that simply return custom XML which is then parsed using my &lt;a href="http://andrewgunn.blogspot.com/2008/05/xml-serialization-in-net-framework.html"&gt;serialization techniques&lt;/a&gt; mentioned in a previous post.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;using System;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Net;&lt;br /&gt;using System.Runtime.Serialization;&lt;br /&gt;using System.Text;&lt;br /&gt; &lt;br /&gt;public class WebRequestResult&lt;br /&gt;{&lt;br /&gt;    private HttpStatusCode outcome;&lt;br /&gt; &lt;br /&gt;    public HttpStatusCode Outcome&lt;br /&gt;    {&lt;br /&gt;        get { return outcome; }&lt;br /&gt;        set { outcome = value; }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    private string response;&lt;br /&gt; &lt;br /&gt;    public string Response&lt;br /&gt;    {&lt;br /&gt;        get { return response; }&lt;br /&gt;        set { response = value; }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;public enum HTTPMethod&lt;br /&gt;{&lt;br /&gt;    DELETE,&lt;br /&gt;    GET,&lt;br /&gt;    POST,&lt;br /&gt;    PUT&lt;br /&gt;};&lt;br /&gt; &lt;br /&gt;public static class WebRequestUtility&lt;br /&gt;{&lt;br /&gt;    private const string DEFAULT_CONTENT_TYPE = "text/plain";&lt;br /&gt;    private const string XML_CONTENT_TYPE = "text/xml";&lt;br /&gt; &lt;br /&gt;    #region No authentication&lt;br /&gt;    public static WebRequestResult Submit( string uri, HTTPMethod httpMethod, WebHeaderCollection headers )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, null, null, httpMethod, DEFAULT_CONTENT_TYPE, headers, null );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static WebRequestResult Submit( string uri, HTTPMethod httpMethod, string data )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, null, null, httpMethod, DEFAULT_CONTENT_TYPE, null, data );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static WebRequestResult Submit( string uri, HTTPMethod httpMethod, WebHeaderCollection headers, string data )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, null, null, httpMethod, DEFAULT_CONTENT_TYPE, headers, data );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static WebRequestResult Submit( string uri, HTTPMethod httpMethod, string contentType, WebHeaderCollection headers )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, null, null, httpMethod, contentType, headers, null );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static WebRequestResult Submit( string uri, HTTPMethod httpMethod, string contentType, string data )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, null, null, httpMethod, contentType, null, data );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static WebRequestResult Submit( string uri, HTTPMethod httpMethod, string contentType, WebHeaderCollection headers, string data )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, null, null, httpMethod, contentType, headers, data );&lt;br /&gt;    }&lt;br /&gt;    #endregion&lt;br /&gt; &lt;br /&gt;    #region Username/password authentication&lt;br /&gt;    public static WebRequestResult Submit( string uri, string username, string password, HTTPMethod httpMethod )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, username, password, httpMethod, DEFAULT_CONTENT_TYPE, null, null );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static WebRequestResult Submit( string uri, string username, string password, HTTPMethod httpMethod, WebHeaderCollection headers )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, username, password, httpMethod, DEFAULT_CONTENT_TYPE, headers, null );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static WebRequestResult Submit( string uri, string username, string password, HTTPMethod httpMethod, string data )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, username, password, httpMethod, DEFAULT_CONTENT_TYPE, null, data );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static WebRequestResult Submit( string uri, string username, string password, HTTPMethod httpMethod, string contentType, WebHeaderCollection headers )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, username, password, httpMethod, contentType, headers, null );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static WebRequestResult Submit( string uri, string username, string password, HTTPMethod httpMethod, string contentType, string data )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, username, password, httpMethod, contentType, null, data );&lt;br /&gt;    }&lt;br /&gt;    #endregion&lt;br /&gt; &lt;br /&gt;    public static WebRequestResult Submit( string uri, string username, string password, HTTPMethod httpMethod, string contentType, WebHeaderCollection headers, string data )&lt;br /&gt;    {&lt;br /&gt;        WebRequestResult result = new WebRequestResult();&lt;br /&gt; &lt;br /&gt;        StringBuilder response = new StringBuilder();&lt;br /&gt; &lt;br /&gt;        HttpWebRequest httpWebRequest = null;&lt;br /&gt;        HttpWebResponse httpWebResponse = null;&lt;br /&gt; &lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            httpWebRequest = ( HttpWebRequest )WebRequest.Create( uri );&lt;br /&gt; &lt;br /&gt;            if ( !string.IsNullOrEmpty( username ) &amp;&amp; !string.IsNullOrEmpty( password ) )&lt;br /&gt;            {&lt;br /&gt;                CredentialCache credentialCache = new CredentialCache();&lt;br /&gt;                credentialCache.Add( new Uri( uri ), "Basic", new NetworkCredential( username, password ) );&lt;br /&gt; &lt;br /&gt;                httpWebRequest.Credentials = credentialCache;&lt;br /&gt;            }&lt;br /&gt; &lt;br /&gt;            if ( headers != null )&lt;br /&gt;            {&lt;br /&gt;                foreach ( string key in headers.Keys )&lt;br /&gt;                {&lt;br /&gt;                    httpWebRequest.Headers.Add( key, headers[key] );&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt; &lt;br /&gt;            httpWebRequest.Method = httpMethod.ToString();&lt;br /&gt;            httpWebRequest.ContentType = contentType;&lt;br /&gt; &lt;br /&gt;            if ( !string.IsNullOrEmpty( data ) )&lt;br /&gt;            {&lt;br /&gt;                using ( StreamWriter streamWriter = new StreamWriter( httpWebRequest.GetRequestStream() ) )&lt;br /&gt;                {&lt;br /&gt;                    streamWriter.WriteLine( data );&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                httpWebRequest.ContentLength = 0;&lt;br /&gt;            }&lt;br /&gt; &lt;br /&gt;            httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();&lt;br /&gt; &lt;br /&gt;            if ( httpWebResponse != null )&lt;br /&gt;            {&lt;br /&gt;                result.Outcome = httpWebResponse.StatusCode;&lt;br /&gt; &lt;br /&gt;                using ( StreamReader streamReader = new StreamReader( httpWebResponse.GetResponseStream() ) )&lt;br /&gt;                {&lt;br /&gt;                    while ( streamReader.Peek() != -1 )&lt;br /&gt;                    {&lt;br /&gt;                        response.Append( streamReader.ReadLine() );&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        catch ( WebException exception )&lt;br /&gt;        {&lt;br /&gt;            httpWebResponse = exception.Response as HttpWebResponse;&lt;br /&gt; &lt;br /&gt;            if ( httpWebResponse != null )&lt;br /&gt;            {&lt;br /&gt;                result.Outcome = httpWebResponse.StatusCode;&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                result.Outcome = HttpStatusCode.InternalServerError;&lt;br /&gt;            }&lt;br /&gt; &lt;br /&gt;            response.Append( exception.Message );&lt;br /&gt;        }&lt;br /&gt;        catch ( Exception exception )&lt;br /&gt;        {&lt;br /&gt;            result.Outcome = HttpStatusCode.InternalServerError;&lt;br /&gt; &lt;br /&gt;            response.Append( exception.Message );&lt;br /&gt;        }&lt;br /&gt;        finally&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                if ( httpWebRequest != null )&lt;br /&gt;                {&lt;br /&gt;                    httpWebRequest.GetRequestStream().Close();&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch { }&lt;br /&gt; &lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                if ( httpWebResponse != null )&lt;br /&gt;                {&lt;br /&gt;                    httpWebResponse.GetResponseStream().Close();&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch { }&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        result.Response = response.ToString();&lt;br /&gt; &lt;br /&gt;        return result;&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    #region No authentication&lt;br /&gt;    public static WebRequestResult SubmitXML( string uri, HTTPMethod httpMethod, WebHeaderCollection headers, string xml )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, httpMethod, XML_CONTENT_TYPE, headers, xml );&lt;br /&gt;    }&lt;br /&gt;    #endregion&lt;br /&gt; &lt;br /&gt;    #region Username/password authentication&lt;br /&gt;    public static WebRequestResult SubmitXML( string uri, string username, string password, HTTPMethod httpMethod, string xml )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, username, password, httpMethod, XML_CONTENT_TYPE, xml );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static WebRequestResult SubmitXML( string uri, string username, string password, HTTPMethod httpMethod, WebHeaderCollection headers, string xml )&lt;br /&gt;    {&lt;br /&gt;        return Submit( uri, username, password, httpMethod, XML_CONTENT_TYPE, headers, xml );&lt;br /&gt;    }&lt;br /&gt;    #endregion&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3867427629928965354?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3867427629928965354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3867427629928965354' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3867427629928965354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3867427629928965354'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/how-do-i-submit-web-requests-at-runtime.html' title='How do I submit web requests at runtime in C#.NET?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-7332677860390655155</id><published>2008-06-09T05:14:00.001-07:00</published><updated>2008-07-03T05:19:54.855-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net form'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='autocomplete'/><category scheme='http://www.blogger.com/atom/ns#' term='textbox'/><title type='text'>How do I disable AutoComplete in ASP.NET?</title><content type='html'>Popular web browsers have a feature called AutoComplete which saves information that has previously been inputted. Web addresses, form data and username/passwords are usually recorded to make life easier in the future.&lt;br /&gt;&lt;br /&gt;As a developer, you may want to disable this feature for some types of input including credit card information. ASP.NET has the ability to override the user's choice with the &lt;b&gt;autocomplete&lt;/b&gt; attribute by setting it to &lt;b&gt;off&lt;/b&gt;. This can be added to a form tag or an individual TextBox control.&lt;br /&gt;&lt;br /&gt;Examples:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;form runat="server" autocomplete="off"&gt;&amp;lt;/form&gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;asp:TextBox ID="tbCreditCardNumber" runat="server" autocomplete="off" /&gt;&lt;br /&gt; &lt;br /&gt;(Runtime)&lt;br /&gt;tbCreditCardNumber.Attributes.Add( "autocomplete", "off" );&lt;/pre&gt;&lt;br /&gt;Alternatively, you can use the &lt;b&gt;AutoCompleteType&lt;/b&gt; attribute on an individual TextBox control and set it to &lt;b&gt;Disabled&lt;/b&gt; to achieve the same result.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;asp:TextBox ID="tbCreditCardNumber" runat="server" AutoCompleteType="Disabled" /&gt;&lt;br /&gt; &lt;br /&gt;(Runtime)&lt;br /&gt;tbCreditCardNumber.AutoCompleteType = AutoCompleteType.Disabled;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-7332677860390655155?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/7332677860390655155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=7332677860390655155' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7332677860390655155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7332677860390655155'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/how-do-i-disable-autocomplete-in-aspnet.html' title='How do I disable AutoComplete in ASP.NET?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3357466668680150643</id><published>2008-06-06T17:05:00.000-07:00</published><updated>2008-07-03T05:20:27.461-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='template'/><category scheme='http://www.blogger.com/atom/ns#' term='wizard'/><title type='text'>ASP.NET Wizard - How do I modify templated buttons at runtime?</title><content type='html'>Accessing a Wizard's templated buttons at runtime is quite tricky and not very elegant using this approach - any better ideas/solutions are more than welcome!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;asp:Wizard ID="MyWizard" runat="server"&gt;&lt;br /&gt;    &amp;lt;StartNavigationTemplate&gt;&lt;br /&gt;        &amp;lt;asp:Button ID="btnNext" runat="server" CommandName="MoveNext" Text="Next" /&gt;&lt;br /&gt;    &amp;lt;/StartNavigationTemplate&gt;&lt;br /&gt;&amp;lt;/asp:Wizard&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;Control startNavigationTemplate = MyWizard.FindControl( "StartNavigationTemplateContainerID" ) as Control;&lt;br /&gt; &lt;br /&gt;if ( startNavigationTemplate != null )&lt;br /&gt;{&lt;br /&gt;    Button nextButton = startNavigationTemplate.FindControl( "btnNext" ) as Button ;&lt;br /&gt; &lt;br /&gt;    if ( nextButton != null )&lt;br /&gt;    {&lt;br /&gt;        // Do something.&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;To manipulate buttons in the step and finish navigiation templates, use &lt;b&gt;StepNavigationTemplateContainerID&lt;/b&gt; and &lt;b&gt;FinishNavigationTemplateContainerID&lt;/b&gt; respectively.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3357466668680150643?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3357466668680150643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3357466668680150643' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3357466668680150643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3357466668680150643'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/aspnet-wizard-how-do-i-modify-templated.html' title='ASP.NET Wizard - How do I modify templated buttons at runtime?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-8355535513604845150</id><published>2008-06-06T16:55:00.000-07:00</published><updated>2008-09-07T03:51:04.942-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><category scheme='http://www.blogger.com/atom/ns#' term='stored procedure'/><title type='text'>Stored procedure parameters - Default values</title><content type='html'>SQL Server stored procedures are good for separating data logic - I like to keep all things SQL together in one resource. I don't like using inline code because it can easily become out-of-date and requries more effort if several applications connect to the database(s). The only problem I had with stored procedures is that I ended up with numerous variations of the same thing (mainly selects). Using default parameters, it is possible to have a single select stored procedure that will always return the same data but the criteria is dynamic.&lt;br /&gt;&lt;br /&gt;This example will use the following table:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;User ( ID uniqueidentifier, Username nvarchar( 50 ), Password nvarchar( 50 ) )&lt;/pre&gt;&lt;br /&gt;The stored procedure has 3 parameters; @ID, @Username and @Password mapping to the 3 columns (ID, Username and Password) respectively. The default value of null means that they are optional parameters meaning you can specify none or a combination. Any value(s) passed in will be used in WHERE clause of the SELECT statement. Values of NULL (default) have no effect on the criteria because of the ISNULL check.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;select * [User]&lt;br /&gt;where [ID] = isnull( @ID, [ID] )&lt;/pre&gt;&lt;br /&gt;If @ID is NULL, the value from the ID column will be used; basically checking if it's equal to itself and returning all of the data inside the table. When the value isn't NULL, only row(s) containing that ID will be returned.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Stored procedure:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;create procedure [SelectUser]&lt;br /&gt; &lt;br /&gt;@ID uniqueidentifier = null&lt;br /&gt;@Username nvarchar( 50 ) = null&lt;br /&gt;@Password nvarchar( 50 ) = null&lt;br /&gt; &lt;br /&gt;as&lt;br /&gt; &lt;br /&gt;select * from [User]&lt;br /&gt;where [ID] = isnull( @ID, [ID] ) and [Username] = isnull( @Username, [Username] ) and [Password] = isnull( @Password, [Password] )&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-8355535513604845150?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/8355535513604845150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=8355535513604845150' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/8355535513604845150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/8355535513604845150'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/stored-procedure-parameters-default.html' title='Stored procedure parameters - Default values'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4170218986789351382</id><published>2008-06-06T16:53:00.001-07:00</published><updated>2008-09-07T03:51:27.546-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><title type='text'>Split SQL statements in C#.NET</title><content type='html'>Have you ever wanted to split a series a SQL statements? Probably not, but here is a code sample anyway! It works by looping through the string and splits the statements on semi-colons (only if they aren't part of some text). I used this on a website that executed SQL code where I wanted to show feedback for each query. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://clkuk.tradedoubler.com/click?p=50662&amp;a=1471893&amp;g=16686336" target="_BLANK"&gt;&lt;img src="http://impgb.tradedoubler.com/imp?type(img)g(16686336)a(1471893)" border=0&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: Black; border: 1px solid #cccccc; color: #cccccc; height: 500px; overflow: auto; scrollbar-base-color: #cccccc; scrollbar-track-color: Black"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt; &lt;br /&gt;public class StringUtility&lt;br /&gt;{&lt;br /&gt;    public static string SplitSQLStatements( string sql )&lt;br /&gt;    {&lt;br /&gt;        List&amp;lt;string&gt; sqlStatements = new List&amp;lt;string&gt;();&lt;br /&gt; &lt;br /&gt;        char separator = ';';&lt;br /&gt; &lt;br /&gt;        bool isQuoted = false;&lt;br /&gt; &lt;br /&gt;        int substringStartIndex = 0;&lt;br /&gt; &lt;br /&gt;        if ( sql.Contains( ";" ) )&lt;br /&gt;        {&lt;br /&gt;            for ( int characterIndex = 0; characterIndex &lt; sql.Length; characterIndex++ )&lt;br /&gt;            {&lt;br /&gt;                if ( sql[characterIndex] == '\'' )&lt;br /&gt;                {&lt;br /&gt;                    isQuoted = !isQuoted;&lt;br /&gt;                }&lt;br /&gt;                else if ( sql[characterIndex] == separator &amp;&amp; !isQuoted )&lt;br /&gt;                {&lt;br /&gt;                    sqlStatements.Add( sql.Substring( substringStartIndex, characterIndex + 1 - substringStartIndex ).Trim() );&lt;br /&gt; &lt;br /&gt;                    substringStartIndex = characterIndex + 1;&lt;br /&gt; &lt;br /&gt;                    if ( sql.IndexOf( separator, substringStartIndex, sql.Length - substringStartIndex ) == -1 )&lt;br /&gt;                    {&lt;br /&gt;                        break;&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        if ( !sql.EndsWith( separator.ToString() ) )&lt;br /&gt;        {&lt;br /&gt;            sql = string.Format( "{0};", sql );&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        if ( substringStartIndex &lt; sql.Length - 1 )&lt;br /&gt;        {&lt;br /&gt;            sqlStatements.Add( sql.Substring( substringStartIndex, sql.Length - substringStartIndex ).Trim() );&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        return sqlStatements.ToArray();&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4170218986789351382?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4170218986789351382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4170218986789351382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4170218986789351382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4170218986789351382'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/split-sql-statements-in-cnet.html' title='Split SQL statements in C#.NET'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5537906905537471566</id><published>2008-06-06T16:52:00.001-07:00</published><updated>2008-09-07T03:52:08.826-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>Remove HTML from strings in C#.NET</title><content type='html'>If you want to remove tags such as HTML or XML (basically anything between &amp;lt; and &amp;gt;) from a string, use this regular expression to replace them with another value (nothing in this example):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;string regularExpresion = "&amp;lt[^&lt;&gt;]*&gt;";&lt;br /&gt; &lt;br /&gt;string body = "&amp;lt;html&gt;this&amp;lt;br /&gt;is&amp;lt;br /&gt;a&amp;lt;br /&gt;test&amp;lt;/html&gt;";&lt;br /&gt; &lt;br /&gt;Regex regex = new Regex(regularExpresion, RegexOptions.IgnoreCase | RegexOptions.Multiline);&lt;br /&gt; &lt;br /&gt;string bodyNoHTML = regex.Replace(body, "").Trim();&lt;/pre&gt;&lt;br /&gt;Input: &lt;pre&gt;&amp;lt;html&gt;1&amp;lt;br /&gt;2&amp;lt;br /&gt;2&amp;lt;br /&gt;4&amp;lt;/html&gt;&lt;/pre&gt;&lt;br /&gt;Output: &lt;pre&gt;1234&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5537906905537471566?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5537906905537471566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5537906905537471566' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5537906905537471566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5537906905537471566'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/remove-html-from-strings-in-cnet.html' title='Remove HTML from strings in C#.NET'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-8484703756453668052</id><published>2008-06-06T16:49:00.000-07:00</published><updated>2008-09-07T03:52:27.931-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>HTML substring in C#.NET</title><content type='html'>Getting a substring of text containing HTML tags is more tricky than you think. Assume that you want the first 10 characters of the following:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;"&amp;lt;p&gt;this is paragraph 1&amp;lt;p&gt;&amp;lt;p&gt;this is paragraph 2&amp;lt;/p&gt;"&lt;/pre&gt;&lt;br /&gt;The output would be:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;"&amp;lt;p&gt;this is"&lt;/pre&gt;&lt;br /&gt;As you can see, the returned text contains an unclosed P tag. If this is rendered to a page, subsequent content will be affected by the open P tag. Ideally, the preferred output would close any unclosed HTML tags in reverse of when they were opened:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;"&amp;lt;p&gt;this is&amp;lt;/p&gt;"&lt;/pre&gt;&lt;br /&gt;Here is a function that returns a subtring of HTML, making sure that no tags are left unclosed:&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: Black; border: 1px solid #cccccc; color: #cccccc; height: 500px; overflow: auto; scrollbar-base-color: #cccccc; scrollbar-track-color: Black"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt; &lt;br /&gt;public static class StringUtility&lt;br /&gt;{&lt;br /&gt;    public static string HTMLSubstring( string html, int length )&lt;br /&gt;    {&lt;br /&gt;        if ( html == null )&lt;br /&gt;        {&lt;br /&gt;            throw new ArgumentNullException( "html" );&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        List&amp;lt;string&gt; unclosedTags = new List&amp;lt;string&gt;();&lt;br /&gt; &lt;br /&gt;        bool isQuoted = false;&lt;br /&gt; &lt;br /&gt;        if ( html.Length &gt; length )&lt;br /&gt;        {&lt;br /&gt;            for ( int i = 0; i &lt; html.Length; i++ )&lt;br /&gt;            {&lt;br /&gt;                char currentCharacter = html[i];&lt;br /&gt; &lt;br /&gt;                char nextCharacter = ' ';&lt;br /&gt; &lt;br /&gt;                if ( i &lt; html.Length - 1 )&lt;br /&gt;                {&lt;br /&gt;                    nextCharacter = html[i + 1];&lt;br /&gt;                }&lt;br /&gt; &lt;br /&gt;                // Check if quotes are on.&lt;br /&gt;                if ( !isQuoted )&lt;br /&gt;                {&lt;br /&gt;                    if ( currentCharacter == '&lt;' &amp;&amp; nextCharacter != ' ' &amp;&amp; nextCharacter != '&gt;' )&lt;br /&gt;                    {&lt;br /&gt;                        if ( nextCharacter != '/' ) // Open tag.&lt;br /&gt;                        {&lt;br /&gt;                            int startIndex = i + 1;&lt;br /&gt; &lt;br /&gt;                            if ( startIndex &lt; html.Length )&lt;br /&gt;                            {&lt;br /&gt;                                int finishIndex = html.IndexOf( "&gt;", startIndex );&lt;br /&gt; &lt;br /&gt;                                if ( finishIndex &gt; 0 )&lt;br /&gt;                                {&lt;br /&gt;                                    if ( html[finishIndex - 1] != '/' )&lt;br /&gt;                                    {&lt;br /&gt;                                        string tag = html.Substring( startIndex, finishIndex - startIndex );&lt;br /&gt; &lt;br /&gt;                                        if ( tag.Contains( " " ) )&lt;br /&gt;                                        {&lt;br /&gt;                                            int temporaryFinishIndex = html.IndexOf( " ", startIndex );&lt;br /&gt; &lt;br /&gt;                                            tag = html.Substring( startIndex, temporaryFinishIndex - startIndex );&lt;br /&gt;                                        }&lt;br /&gt; &lt;br /&gt;                                        if ( !tag.Equals( "br", StringComparison.InvariantCultureIgnoreCase ) )&lt;br /&gt;                                        {&lt;br /&gt;                                            unclosedTags.Add( tag );&lt;br /&gt;                                        }&lt;br /&gt;                                    }&lt;br /&gt; &lt;br /&gt;                                    int tagLength = finishIndex + 1 - i;&lt;br /&gt; &lt;br /&gt;                                    length += tagLength;&lt;br /&gt; &lt;br /&gt;                                    i = finishIndex;&lt;br /&gt;                                }&lt;br /&gt;                            }&lt;br /&gt;                        }&lt;br /&gt;                        else if ( nextCharacter == '/' ) // Close tag.&lt;br /&gt;                        {&lt;br /&gt;                            int startIndex = i + 2;&lt;br /&gt; &lt;br /&gt;                            if ( startIndex &lt; html.Length )&lt;br /&gt;                            {&lt;br /&gt;                                int finishIndex = html.IndexOf( "&gt;", startIndex );&lt;br /&gt; &lt;br /&gt;                                if ( finishIndex &gt; 0 )&lt;br /&gt;                                {&lt;br /&gt;                                    string tag = html.Substring( startIndex, finishIndex - startIndex );&lt;br /&gt; &lt;br /&gt;                                    // FILO.&lt;br /&gt;                                    int index = unclosedTags.LastIndexOf( tag );&lt;br /&gt; &lt;br /&gt;                                    if ( index &gt;= 0 )&lt;br /&gt;                                    {&lt;br /&gt;                                        unclosedTags.RemoveAt( index );&lt;br /&gt; &lt;br /&gt;                                        int tagLength = finishIndex + 1 - i;&lt;br /&gt; &lt;br /&gt;                                        length += tagLength;&lt;br /&gt; &lt;br /&gt;                                        i = finishIndex;&lt;br /&gt;                                    }&lt;br /&gt;                                }&lt;br /&gt;                            }&lt;br /&gt;                        }&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    if ( currentCharacter == '"' )&lt;br /&gt;                    {&lt;br /&gt;                        isQuoted = false;&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                if ( i &gt;= length )&lt;br /&gt;                {&lt;br /&gt;                    html = string.Format( "{0}...", html.Substring( 0, i ) );&lt;br /&gt; &lt;br /&gt;                    unclosedTags.Reverse();&lt;br /&gt; &lt;br /&gt;                    foreach ( string unclosedTag in unclosedTags )&lt;br /&gt;                    {&lt;br /&gt;                        html += string.Format( "&amp;lt;/{0}&gt;", unclosedTag );&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        return html;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-8484703756453668052?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/8484703756453668052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=8484703756453668052' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/8484703756453668052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/8484703756453668052'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/html-substring-in-cnet.html' title='HTML substring in C#.NET'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-7427321696232547225</id><published>2008-06-06T16:43:00.001-07:00</published><updated>2008-07-31T07:56:37.411-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='neil kilbride'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><title type='text'>How do I remove whitespace from XML in C#.NET?</title><content type='html'>Once again... thanks &lt;a href="http://neilkilbride.blogspot.com/"&gt;Neil&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;using System;&lt;br /&gt;using System.Text.RegularExpressions;&lt;br /&gt; &lt;br /&gt;public static class XMLUtility&lt;br /&gt;{&lt;br /&gt;    public static string RemoveWhitespace( string xml )&lt;br /&gt;    {&lt;br /&gt;        Regex regex = new Regex(@"&gt;\s*&lt;");&lt;br /&gt;        xml = regex.Replace(xml, "&gt;&lt;");&lt;br /&gt; &lt;br /&gt;        return xml.Trim();&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-7427321696232547225?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/7427321696232547225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=7427321696232547225' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7427321696232547225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7427321696232547225'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/how-do-i-remove-whitespace-from-xml-in.html' title='How do I remove whitespace from XML in C#.NET?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-7651761561912962524</id><published>2008-06-06T16:42:00.001-07:00</published><updated>2008-07-03T05:30:55.330-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stringwriter'/><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='encoding'/><title type='text'>How do I create a StringWriter with encoding in C#.NET?</title><content type='html'>Simple, yet effective.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;using System;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Text;&lt;br /&gt; &lt;br /&gt;public class StringWriterWithEncoding : StringWriter&lt;br /&gt;{&lt;br /&gt;    public StringWriterWithEncoding( StringBuilder builder, Encoding encoding )&lt;br /&gt;        : base( builder )&lt;br /&gt;    {&lt;br /&gt;        _encoding = encoding;&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    Encoding _encoding;&lt;br /&gt; &lt;br /&gt;    public override Encoding Encoding&lt;br /&gt;    {&lt;br /&gt;        get { return _encoding; }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-7651761561912962524?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/7651761561912962524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=7651761561912962524' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7651761561912962524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7651761561912962524'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/how-do-i-create-stringwriter-with.html' title='How do I create a StringWriter with encoding in C#.NET?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-8039059904501689165</id><published>2008-06-06T16:39:00.001-07:00</published><updated>2008-09-07T04:05:11.764-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='serialization'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><title type='text'>XML serialization in C#.NET</title><content type='html'>Have you ever tried to parse XML using the .NET framework? I have, and I can never remember the right/wrong way to do it. I normally spend hours on the internet before finding the same solution that I found during my previous attempt. Not anymore! Instead of interacting with the XML directly, convert it to an object that can be easily manipulated. This post shows how to deserialize an XML string into an object and serialize it back into an XML string using attributes from the &lt;a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.aspx"&gt;System.Xml.Serialization namespace&lt;/a&gt; in the target class. The important ones that I've highlighted are XmlRoot, XmlAttribute and XmlElement. They're pretty self explanitory - they basically map a class to a root node, a class member to an attribute within a node and a class member to an element node respectively. When declaring these attributes, you specify the name of the attribute/node used in the string XML to establish the relationship. If your class uses exactly the same naming convention as the XML structure, you could (in theory) leave out these attributes. In most cases, the 2 naming conventions differ. I would recommend using them regardless because it makes your application more future proof. If the name of an element node changes, you only have to update the corresponding attribute instead of renaming a class member which could cause problems elsewhere (in the same or even other applications).&lt;br /&gt;&lt;br /&gt;This example includes a utility class with 2 important methods - DeserializeObject and SerializeObject. Both use generics so you pass the target class when calling either method. The XML sample can be deserialized to create a Person object. Alternatively, an existing Person object can be serialized to create a similar XML structure.&lt;br /&gt;&lt;br /&gt;Utility class:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;using System;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Xml;&lt;br /&gt;using System.Xml.Serialization;&lt;br /&gt;  &lt;br /&gt;public class XMLSerializationUtility&lt;br /&gt;{&lt;br /&gt;    public static T DeserializeObject&amp;lt;T&gt;( Encoding encoding, string xml )&lt;br /&gt;    {&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            using (MemoryStream memoryStream = new MemoryStream( StringToByteArray( encoding, xml ) ) )&lt;br /&gt;            {&lt;br /&gt;                using ( XmlTextWriter xmlTextWriter = new XmlTextWriter( memoryStream, encoding ) )&lt;br /&gt;                {&lt;br /&gt;                    XmlSerializer xmlSerializer = new XmlSerializer( typeof( T ) );&lt;br /&gt; &lt;br /&gt;                    return (T)xmlSerializer.Deserialize( memoryStream );&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        catch&lt;br /&gt;        {&lt;br /&gt;            return default( T );&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    public static string SerializeObject&amp;lt;T&gt;( Encoding encoding, T obj )&lt;br /&gt;    {&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            MemoryStream memoryStream = new MemoryStream();&lt;br /&gt; &lt;br /&gt;            using ( XmlTextWriter xmlTextWriter = new XmlTextWriter( memoryStream, encoding ) )&lt;br /&gt;            {&lt;br /&gt;                XmlSerializer xmlSerializer = new XmlSerializer( typeof( T ) );&lt;br /&gt;                xmlSerializer.Serialize( xmlTextWriter, obj );&lt;br /&gt; &lt;br /&gt;                memoryStream = (MemoryStream)xmlTextWriter.BaseStream;&lt;br /&gt;            }&lt;br /&gt; &lt;br /&gt;            return ByteArrayToString( encoding, memoryStream.ToArray() );&lt;br /&gt;        }&lt;br /&gt;        catch&lt;br /&gt;        {&lt;br /&gt;            return string.Empty;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    private static Byte[] StringToByteArray( Encoding encoding, string xml )&lt;br /&gt;    {&lt;br /&gt;        return encoding.GetBytes( xml );&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    private static string ByteArrayToString( Encoding encoding, byte[] byteArray )&lt;br /&gt;    {&lt;br /&gt;        return encoding.GetString( byteArray );&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Person class:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;using System;&lt;br /&gt;using System.Xml.Serialization;&lt;br /&gt; &lt;br /&gt;[XmlRoot( "person" ) ]&lt;br /&gt;public class Person&lt;br /&gt;{&lt;br /&gt;    private Guid _id;&lt;br /&gt; &lt;br /&gt;    [XmlAttribute( "id" )]&lt;br /&gt;    public Guid ID;&lt;br /&gt;    {&lt;br /&gt;        get { return _id; }        &lt;br /&gt;        set { _id = value; }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    private string _name;&lt;br /&gt; &lt;br /&gt;    [XmlElement( "Name" )]&lt;br /&gt;    public string Name;&lt;br /&gt;    {&lt;br /&gt;        get { return _name; }        &lt;br /&gt;        set { _name = value; }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    private DateTime _dateOfBirth;&lt;br /&gt; &lt;br /&gt;    [XmlElement( "dob" )]&lt;br /&gt;    public DateTime DateOfBirth;&lt;br /&gt;    {&lt;br /&gt;        get { return _dateOfBirth; }        &lt;br /&gt;        set { _dateOfBirth = value; }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;XML:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;br /&gt;&amp;lt;person id="0ADD2974-B14E-440B-B435-C0AF65E57ACF"&gt;&lt;br /&gt;    &amp;lt;name&gt;Andrew Gunn&amp;lt;/name&gt;&lt;br /&gt;    &amp;lt;dob&gt;1985-08-08T12:00:00Z&amp;lt;/dob&gt;&lt;br /&gt;&amp;lt;/person&gt;&lt;/pre&gt;&lt;br /&gt;Deserialize string XML into a Person object:&lt;br /&gt;&lt;pre&gt;Person person = XMLSerializationUtility.DeserializeObject&amp;lt;Person&gt;( Encoding.UTF8, xml );&lt;/pre&gt;&lt;br /&gt;Serialize a Person object into string XML:&lt;br /&gt;&lt;pre&gt;string xml = XMLSerializationUtility.SerializeObject&amp;lt;Person&gt;( Encoding.UTF8, Person );&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-8039059904501689165?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/8039059904501689165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=8039059904501689165' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/8039059904501689165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/8039059904501689165'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/xml-serialization-in-cnet.html' title='XML serialization in C#.NET'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4988120090504653135</id><published>2008-06-06T16:25:00.001-07:00</published><updated>2008-07-03T05:32:01.912-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='value types'/><category scheme='http://www.blogger.com/atom/ns#' term='nullable types'/><title type='text'>Nullable Types in C#.NET</title><content type='html'>Nullable types allow other value types to be represented as a "null value".&lt;br /&gt;&lt;br /&gt;Both examples produce the same result, but I prefer the first because it confuses the hell out of people who don't know it's meaning and requires less coding:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;int? x = null;&lt;br /&gt;Nullable&amp;lt;int&gt; y = null;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4988120090504653135?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4988120090504653135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4988120090504653135' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4988120090504653135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4988120090504653135'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/nullable-types-in-cnet.html' title='Nullable Types in C#.NET'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5184738510729283384</id><published>2008-06-06T16:20:00.001-07:00</published><updated>2008-09-07T04:05:47.606-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='wizard'/><title type='text'>ASP.NET Wizard - Finish button CommandName</title><content type='html'>If you want to override the FinishNavigationTemplate template, the CommandName for the finish button is &lt;b&gt;MoveComplete&lt;/b&gt;. I found several websites claiming it is MoveFinish but this won't trigger the event (definitely under the .NET 2.0 framework).&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;asp:Wizard runat="server"&gt;&lt;br /&gt;    &amp;lt;FinishNavigationTemplate&gt;&lt;br /&gt;        &amp;lt;asp:Button runat="server" CommandName="MoveComplete" Text="Finish" /&gt;&lt;br /&gt;    &amp;lt;/FinishNavigationTemplate&gt;&lt;br /&gt;&amp;lt;/asp:Wizard&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5184738510729283384?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5184738510729283384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5184738510729283384' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5184738510729283384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5184738510729283384'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/06/aspnet-wizard-finish-button-commandname.html' title='ASP.NET Wizard - Finish button CommandName'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-603092582143919187</id><published>2008-05-22T07:25:00.000-07:00</published><updated>2008-06-06T17:04:28.539-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visual sourcesafe'/><title type='text'>How do I add files/folders to Visual SourceSafe recursively?</title><content type='html'>The best way to add files and folders to Visual SourceSafe recursively is to drag and drop them from Windows Explorer.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create the new project in Visual SourceSafe (I prefer to think of them as folders but SourceSafe calls them projects).&lt;/li&gt;&lt;li&gt;Launch Windows Explorer and navigate to the physical location of the root folder containing the new files/folders. This location should be below the working directory and the name should be the same as the newly created SourceSafe project.&lt;/li&gt;&lt;li&gt;Drag and drop everything from the root folder into the new project.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Example:&lt;br /&gt;Assume that your working directory is C:\WorkingDirectory and you want to add a some files/folders from C:\WorkingDirectory\NewStuff.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a project called "NewStuff" under the working directory ("$/") in Visual SourceSafe.&lt;/li&gt;&lt;li&gt;Launch Windows Explorer and navigate to C:\WorkingDirectory\NewStuff.&lt;/li&gt;&lt;li&gt;Drag and drop everything from C:\WorkingDirectory\NewStuff into the "NewStuff" project.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-603092582143919187?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/603092582143919187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=603092582143919187' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/603092582143919187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/603092582143919187'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/05/how-do-i-add-filesfolders-to-visual.html' title='How do I add files/folders to Visual SourceSafe recursively?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4259654977200794744</id><published>2008-05-17T06:33:00.000-07:00</published><updated>2008-06-06T16:45:31.430-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reset'/><category scheme='http://www.blogger.com/atom/ns#' term='nano'/><category scheme='http://www.blogger.com/atom/ns#' term='crash'/><category scheme='http://www.blogger.com/atom/ns#' term='ipod'/><category scheme='http://www.blogger.com/atom/ns#' term='apple'/><title type='text'>How do I reset my iPod?</title><content type='html'>&lt;ol&gt;&lt;li&gt;Toggle the Hold switch on and off (slide to on and off again)&lt;/li&gt;&lt;li&gt;Press and hold the Menu and middle buttons buttons simultaneously until the Apple/iPod logo appears - this may take about 6 to 8 seconds. You may need to repeat this step.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4259654977200794744?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4259654977200794744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4259654977200794744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4259654977200794744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4259654977200794744'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/05/how-do-i-reset-my-ipod.html' title='How do I reset my iPod?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3142937718945440020</id><published>2008-05-14T05:18:00.000-07:00</published><updated>2008-09-07T04:11:47.344-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='port numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='udp'/><category scheme='http://www.blogger.com/atom/ns#' term='tcp/ip'/><category scheme='http://www.blogger.com/atom/ns#' term='sctp'/><title type='text'>Port numbers</title><content type='html'>&lt;a href="http://www.iana.org/assignments/port-numbers"&gt;http://www.iana.org/assignments/port-numbers&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3142937718945440020?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3142937718945440020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3142937718945440020' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3142937718945440020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3142937718945440020'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/05/port-numbers.html' title='Port numbers'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3530643710176008225</id><published>2008-05-06T04:09:00.001-07:00</published><updated>2008-06-06T16:46:39.030-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='chm'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft compiled html help files'/><title type='text'>Why can't I view some of my CHM files?</title><content type='html'>I found that when the filename contained a '#' character, I could open the file but the content wasn't visible. Removing the character fixed the problem.&lt;br /&gt;&lt;br /&gt;Example (before and after):&lt;br /&gt;C#.chm = CSharp.chm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3530643710176008225?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3530643710176008225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3530643710176008225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3530643710176008225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3530643710176008225'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/05/why-cant-i-view-some-of-my-chm-files.html' title='Why can&apos;t I view some of my CHM files?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-1641678852646385626</id><published>2008-04-23T05:29:00.000-07:00</published><updated>2008-04-24T02:00:36.547-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='paypoint'/><category scheme='http://www.blogger.com/atom/ns#' term='fare'/><category scheme='http://www.blogger.com/atom/ns#' term='public transport'/><category scheme='http://www.blogger.com/atom/ns#' term='nottingham'/><category scheme='http://www.blogger.com/atom/ns#' term='10 trip'/><category scheme='http://www.blogger.com/atom/ns#' term='tram'/><category scheme='http://www.blogger.com/atom/ns#' term='net'/><category scheme='http://www.blogger.com/atom/ns#' term='prices'/><title type='text'>Un-Fare Prices on Nottingham's Tram</title><content type='html'>I've been using the tram in Nottingham to get to and from work for about a year. Instead of paying for my fare onboard, I buy a 10 trip pass from any shop with PayPoint facilities. The price has always been £10 so each trip costs £1. If you pay the conductor for a return journey, it will cost £2.40, making it more expensive than my approach. Another reason I choose to buy this type of ticket is because the conductors rarely stamp it meaning I get some journeys for free :D.&lt;br /&gt;&lt;br /&gt;As of 28/04/2008, the prices across the range of tickets will go up, making my pass £13 (a whopping 30% increase). My first grumble is that this is a huge jump on what was once a value-for-money scheme. The return ticket will only go up to £2.70; just a fraction more than 2 trips using the pass! My second, and more important, grumble is that I bought one of these passes on 22/04/2008 and was charged the new price of £13. I wasn't aware of the planned increases at the time so I paid the shop assistant. After contacting &lt;a href="http://www.thetram.net"&gt;NET&lt;/a&gt; (Nottingham Express Transit) about the issue, it emerged that I'd been charged too much too early. NET spoke to PayPoint on my behalf who kindly gave me a 1 week pass for free. &lt;br /&gt;&lt;br /&gt;If you've also paid the new price before the changeover date, submit a complaint on NET's website but remember to keep your pass as they use it to gather information about the transaction.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-1641678852646385626?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/1641678852646385626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=1641678852646385626' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1641678852646385626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1641678852646385626'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/un-fare-prices-on-nottinghams-tram.html' title='Un-Fare Prices on Nottingham&apos;s Tram'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-6735988595037010425</id><published>2008-04-22T01:57:00.000-07:00</published><updated>2008-04-22T01:58:42.220-07:00</updated><title type='text'>PropertyData object with name "{PropertyName}" already exists</title><content type='html'>Change the dynamic property to be unique per language and back again. If the problem persists, try deleting and recreating the dynamic property.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-6735988595037010425?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/6735988595037010425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=6735988595037010425' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6735988595037010425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6735988595037010425'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/propertydata-object-with-name.html' title='PropertyData object with name &quot;{PropertyName}&quot; already exists'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3109436534404852153</id><published>2008-04-22T01:38:00.000-07:00</published><updated>2008-09-07T03:54:00.218-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='sky broadband'/><title type='text'>Sky Broadband installer - Hardware/software requirements</title><content type='html'>If you've got an fairly old PC/laptop and try to install Sky Broadband, you might find that you can't navigate through the wizard process because it won't allow you click the buttons. This is highly annoying because without going through this process, you can't install the software to get connected to the internet. Here is a list of minimum requirements that should resolve the problem and allow you to enjoy your new service.&lt;br /&gt;&lt;br /&gt;Software Requirements:&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.adobe.com/products/flashplayer"&gt;Adobe Flash Player&lt;/a&gt; (essential)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/windows/windowsmedia/default.mspx"&gt;Windows Media Player&lt;/a&gt; (latest version)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;displaylang=en"&gt;Microsoft .NET Framework 2.0&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;If you're running Windows, I would also recommend downloading all avalaible updates. Windows XP is a prime example that should be at least running &lt;a href="http://www.microsoft.com/windowsxp/sp2/default.mspx"&gt;Service Pack 2&lt;/a&gt;. Windows Media Player and the .NET framework should be bundled with some of the Windows updates so this is the easiest solution.&lt;br /&gt;&lt;br /&gt;Please don't quote me on these software requirements - they are just a collection of things I installed to get my sister's ancient laptop in a state where I could install Sky Broadband.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I'll post the hardware requirements soon but they can easily be found on the box that you receive from Sky.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3109436534404852153?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3109436534404852153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3109436534404852153' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3109436534404852153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3109436534404852153'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/sky-broadband-installer.html' title='Sky Broadband installer - Hardware/software requirements'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-9146185081147173458</id><published>2008-04-21T03:46:00.000-07:00</published><updated>2008-09-07T04:10:45.860-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='viewstate'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='state'/><category scheme='http://www.blogger.com/atom/ns#' term='controls'/><title type='text'>Maintain control state in ASP.NET</title><content type='html'>&lt;pre&gt;using System;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Web.UI;&lt;br /&gt; &lt;br /&gt;[Serializable()]&lt;br /&gt;[ToolboxData( "&lt;{0}:MyControl runat=\"server\"&gt;&lt;/{0}:MyControl&gt;" )]&lt;br /&gt;public class MyControl: Control&lt;br /&gt;{&lt;br /&gt;    [Serializable()]&lt;br /&gt;    private struct MyControlProperties&lt;br /&gt;    {&lt;br /&gt;        public int Property1;&lt;br /&gt;        public string Property2;&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    private MyControlProperties _properties = new MyControlProperties();&lt;br /&gt; &lt;br /&gt;    [DefaultValue( 0 )]&lt;br /&gt;    public int Property1&lt;br /&gt;    {&lt;br /&gt;        get&lt;br /&gt;        {&lt;br /&gt;            return _properties.Property1;&lt;br /&gt;        }&lt;br /&gt;        set&lt;br /&gt;        {&lt;br /&gt;            _properties.Property1 = value;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    [DefaultValue( "" )]&lt;br /&gt;    public string Property2&lt;br /&gt;    {&lt;br /&gt;        get&lt;br /&gt;        {&lt;br /&gt;            return _properties.Property2;&lt;br /&gt;        }&lt;br /&gt;        set&lt;br /&gt;        {&lt;br /&gt;            _properties.Property2 = value;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    protected override void OnInit( System.EventArgs e )&lt;br /&gt;    {&lt;br /&gt;        base.OnInit( e );&lt;br /&gt; &lt;br /&gt;        Page.RegisterRequiresControlState( this );&lt;br /&gt;    }                   &lt;br /&gt; &lt;br /&gt;    protected override object SaveControlState()&lt;br /&gt;    {&lt;br /&gt;        return _properties;&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    protected override void LoadControlState( object savedState )&lt;br /&gt;    {&lt;br /&gt;        _properties = (MyControlProperties)savedState;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-9146185081147173458?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/9146185081147173458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=9146185081147173458' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/9146185081147173458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/9146185081147173458'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/maintain-control-state-in-aspnet.html' title='Maintain control state in ASP.NET'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-9204794260159799470</id><published>2008-04-17T08:40:00.001-07:00</published><updated>2008-06-06T16:46:10.637-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='css attributes'/><category scheme='http://www.blogger.com/atom/ns#' term='windows internet explorer'/><title type='text'>CSS Attributes</title><content type='html'>Here is a collection of CSS attributes supported by Windows Internet Explorer - probably the best web browser in the world :P.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms531207(VS.85).aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms531207(VS.85).aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-9204794260159799470?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/9204794260159799470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=9204794260159799470' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/9204794260159799470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/9204794260159799470'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/css-attributes.html' title='CSS Attributes'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-6166857150890704616</id><published>2008-04-12T05:55:00.000-07:00</published><updated>2008-04-12T05:57:31.421-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='map'/><category scheme='http://www.blogger.com/atom/ns#' term='comcast'/><category scheme='http://www.blogger.com/atom/ns#' term='code'/><category scheme='http://www.blogger.com/atom/ns#' term='cheat'/><category scheme='http://www.blogger.com/atom/ns#' term='bonus'/><category scheme='http://www.blogger.com/atom/ns#' term='rainbow six vegas 2'/><title type='text'>Rainbow Six Vegas 2 - Bonus Map</title><content type='html'>Enter the following code to get a bonus map:&lt;br /&gt;&lt;pre&gt;comcast faster&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-6166857150890704616?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/6166857150890704616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=6166857150890704616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6166857150890704616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6166857150890704616'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/rainbow-six-vegas-2-bonus-map.html' title='Rainbow Six Vegas 2 - Bonus Map'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4081084702063760843</id><published>2008-04-11T09:17:00.000-07:00</published><updated>2009-08-10T01:17:45.418-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='http status codes'/><category scheme='http://www.blogger.com/atom/ns#' term='neil kilbride'/><title type='text'>HTTP Status Codes</title><content type='html'>&lt;p&gt;This post has been copied from &lt;a href="http://neilkilbride.blogspot.com" title="Neil Kilbride's Blog"&gt;Neil Kilbride's blog&lt;/a&gt; - cheers mate! I just wanted a copy on my blog for reference purposes.&lt;/p&gt;&lt;pre class="brush: text"&gt;Information                    # 1xx&lt;br /&gt;    Continue                       # 100&lt;br /&gt;    SwitchProtocl                  # 101&lt;br /&gt; &lt;br /&gt;Success                        # 2xx&lt;br /&gt;    OK                             # 200&lt;br /&gt;    Created                        # 201&lt;br /&gt;    Accepted                       # 202&lt;br /&gt;    NonAuthoritativeInformation    # 203&lt;br /&gt;    NoContent                      # 204&lt;br /&gt;    ResetContent                   # 205&lt;br /&gt;    PartialContent                 # 206&lt;br /&gt; &lt;br /&gt;Redirection                    # 3xx&lt;br /&gt;    MultipleChoice                 # 300&lt;br /&gt;    MovedPermanently               # 301&lt;br /&gt;    Found                          # 302&lt;br /&gt;    SeeOther                       # 303&lt;br /&gt;    NotModified                    # 304&lt;br /&gt;    UseProxy                       # 305&lt;br /&gt;    TemporaryRedirect              # 307&lt;br /&gt; &lt;br /&gt;ClientError                    # 4xx&lt;br /&gt;    BadRequest                     # 400&lt;br /&gt;    Unauthorized                   # 401&lt;br /&gt;    PaymentRequired                # 402&lt;br /&gt;    Forbidden                      # 403&lt;br /&gt;    NotFound                       # 404&lt;br /&gt;    MethodNotAllowed               # 405&lt;br /&gt;    NotAcceptable                  # 406&lt;br /&gt;    ProxyAuthenticationRequired    # 407&lt;br /&gt;    RequestTimeOut                 # 408&lt;br /&gt;    Conflict                       # 409&lt;br /&gt;    Gone                           # 410&lt;br /&gt;    LengthRequired                 # 411&lt;br /&gt;    PreconditionFailed             # 412&lt;br /&gt;    RequestEntityTooLarge          # 413&lt;br /&gt;    RequestURITooLong              # 414&lt;br /&gt;    UnsupportedMediaType           # 415&lt;br /&gt;    RequestedRangeNotSatisfiable   # 416&lt;br /&gt;    ExpectationFailed              # 417&lt;br /&gt; &lt;br /&gt;ServerError                    # 5xx&lt;br /&gt;    InternalServerError            # 500&lt;br /&gt;    NotImplemented                 # 501&lt;br /&gt;    BadGateway                     # 502&lt;br /&gt;    ServiceUnavailable             # 503&lt;br /&gt;    GatewayTimeOut                 # 504&lt;br /&gt;    VersionNotSupported            # 505&lt;/pre&gt;&lt;p&gt;Visit the &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"&gt;World Wide Web Consortium&lt;/a&gt; to find out more about HTTP status code definitions.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4081084702063760843?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4081084702063760843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4081084702063760843' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4081084702063760843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4081084702063760843'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/http-status-codes.html' title='HTTP Status Codes'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-8266750844376733251</id><published>2008-04-05T04:21:00.000-07:00</published><updated>2008-04-10T02:35:00.257-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DC'/><category scheme='http://www.blogger.com/atom/ns#' term='snowboarding boots'/><category scheme='http://www.blogger.com/atom/ns#' term='dcshoecousa'/><category scheme='http://www.blogger.com/atom/ns#' term='Graphix Boa'/><title type='text'>DC Graphix Boa</title><content type='html'>I recently got a pair of DC Graphix Boa snowboarding boots. They are amazing! I didn't want boots with laces and I wasn't impressed with Burton's alternative. The Boa system makes it so easy to tighten them up in only a few seconds. The main difference on the inner liner is the valve allowing you to inflate the section supporting your heel. I didn't think this would be very useful but I was wrong! You get the feeling like the foot won't move at all, meaning you can concentrate without worrying. They look really good too - mine are white with a gold DC logo on the back...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp3.blogger.com/_B7qeoYf7Cuw/R_dh7E7i_zI/AAAAAAAAABE/2-jm6L0xOn4/s1600-h/DC+Graphix+Boa+(White).jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_B7qeoYf7Cuw/R_dh7E7i_zI/AAAAAAAAABE/2-jm6L0xOn4/s320/DC+Graphix+Boa+(White).jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5185721163504090930" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-8266750844376733251?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/8266750844376733251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=8266750844376733251' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/8266750844376733251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/8266750844376733251'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/dc-graphix-boa.html' title='DC Graphix Boa'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_B7qeoYf7Cuw/R_dh7E7i_zI/AAAAAAAAABE/2-jm6L0xOn4/s72-c/DC+Graphix+Boa+(White).jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3921530291110143220</id><published>2008-04-04T11:33:00.001-07:00</published><updated>2008-09-07T04:11:20.516-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pc world'/><category scheme='http://www.blogger.com/atom/ns#' term='sony'/><category scheme='http://www.blogger.com/atom/ns#' term='home theater kit'/><category scheme='http://www.blogger.com/atom/ns#' term='currys'/><category scheme='http://www.blogger.com/atom/ns#' term='price promise'/><title type='text'>PC World price promise</title><content type='html'>A few months ago, I was sent on a mission to get my mum a Sony home theater kit. The model isn't important but the price is. Online, I found it for about £135 on Amazon but the lowest price in the stores was around £200. I didn't want to wait for it to be delivered so I decided to try the &lt;a href="http://www.pcworld.co.uk/martprd/editorial/price-match-promise"&gt;PC World Price Promise&lt;/a&gt;. In a nutshell, they'll beat any price from another shop or a selection of websites, one of them being Amazon :D.&lt;br /&gt;&lt;br /&gt;I printed a web page stating the price on Amazon and took it with me to PC World. They were happy to take an extra 10% off that price but unfortunately, they didn't have any in stock! Luckily, they checked stock levels in the Currys store next door who had plenty available. I was sent over there myself and was guaranteed that Currys would do the same offer. After speaking to one of the managers, I was informed that PC World were lying because they never match Internet prices. At this point, I was extremely pissed off! The level of customer service in Currys was terrible to say the least. OK, they don't and never have matched prices on websites but I had been told this on good authority. You have to remember that PC World and Currys are basically the same company, yet they act like bitter rivals. I felt like I was stuck in the middle of 2 shops trying to get the upper hand.&lt;br /&gt;&lt;br /&gt;Anyway, the story doesn't finish there. I wondered back into PC World to set a few things straight. I didn't care about who was right or wrong, I just wanted to get what I came for and go home. I must say for the record, the guys at PC World were very kind and helpful - the exact opposite to the people working in Currys. One person in particular worked really hard to get me what I wanted. He phoned Currys and got them to reserve and prepare the kit for collection. Great! All I had to do was pay and go all the way BACK to Currys! Oh the joys of retail therapy.&lt;br /&gt;&lt;br /&gt;The whole episode lasted about an hour when it should of took a few minutes. I guess I'm lucky in some ways for having both stores so close together, otherwise I would've came home empty handed. I can honestly say that I won't be shopping at either places again... NEVER. Hopefully, someone will read this post who works for the company and do something about it so other customers don't have to go through the same agony.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3921530291110143220?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3921530291110143220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3921530291110143220' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3921530291110143220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3921530291110143220'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/pc-world-price-promise.html' title='PC World price promise'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-82880796882515714</id><published>2008-04-04T08:48:00.000-07:00</published><updated>2008-07-03T05:37:56.098-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='validaterequest'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>A potentially dangerous Request.Form value was detected from the client</title><content type='html'>This error is caused because the .NET framework detected HTML in an input control (e.g. TextBox). I've highlighted 3 possible ways to get round the issue, all with their advantages and disadvantages:&lt;br /&gt;&lt;br /&gt;1. Add the following to the existing Page directive on the relevant pages.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ValidateRequest="false"&lt;/pre&gt;&lt;br /&gt;2. Add the following to the Web.config within the &amp;lt;system.web&gt; section (globally disable request validation). This will allow users to enter HTML into controls which could be harmful or result in undesirable consequences.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;pages validateRequest="false" /&gt;&lt;/pre&gt;&lt;br /&gt;3. Unless you need users to be able to enter HTML into a form, make sure all HTML displayed in controls is encoded.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;lblText.Text = HttpUtility.HtmlEncode( lblTest.Text );&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-82880796882515714?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/82880796882515714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=82880796882515714' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/82880796882515714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/82880796882515714'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/potentially-dangerous-requestform-value.html' title='A potentially dangerous Request.Form value was detected from the client'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-161069018147279892</id><published>2008-04-04T07:03:00.001-07:00</published><updated>2008-07-03T05:38:15.230-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hosts'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Windows - Hosts</title><content type='html'>The hosts file can be used to map IP addresses to host names. Each entry should be on an individual line with the IP address in the first column and the host name in the second (separated by at least one space). Lines can be commented by placing a # at the beginning. The hosts file can be find in C:\Windows\system32\drivers\etc. To see the effects of any changes, you'll need to restart or create new instances of the browser(s) or run the following from the command line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ipconfig /flushdns&lt;/pre&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;127.0.0.1    test&lt;/pre&gt;Subsequent requests for http://test will then point to 127.0.0.1 (local).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-161069018147279892?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/161069018147279892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=161069018147279892' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/161069018147279892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/161069018147279892'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/windows-hosts.html' title='Windows - Hosts'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-6478867164351873390</id><published>2008-04-04T06:52:00.000-07:00</published><updated>2008-09-07T04:03:49.424-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Windows - Map local folders</title><content type='html'>Network locations can be mapped pretty easily but mapping local folders is more complicated. Run the following from the command line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;subst &lt;i&gt;{drive}&lt;/i&gt;: &lt;i&gt;{directoryPath}&lt;/i&gt;&lt;/pre&gt;&lt;br /&gt;This example shows how to map C:\Windows to the W drive meaning that I can reference anything in that directory like W:\&lt;i&gt;{directoryPath}&lt;/i&gt;\&lt;i&gt;{fileName}&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;pre&gt;subst W: C:\Windows&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-6478867164351873390?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/6478867164351873390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=6478867164351873390' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6478867164351873390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6478867164351873390'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/windows-map-local-folders.html' title='Windows - Map local folders'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4622006262638798689</id><published>2008-04-02T03:03:00.000-07:00</published><updated>2008-07-03T05:39:16.002-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='layers'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>CSS - Layers</title><content type='html'>&lt;pre&gt;&amp;lt;div style="background-color: Red; height: 100px; width: 100px; z-index: 1"&gt;&amp;lt;/div&gt;&lt;br /&gt;&amp;lt;div style="background-color: White; height: 100px; left: 50px; position: relative; top: -50px; width: 100px; z-index: 2"&gt;&amp;lt;/div&gt;&lt;/pre&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;div style="background-color: Red; height: 100px; width: 100px; z-index: 1"&gt;&lt;/div&gt;&lt;div style="background-color: White; height: 100px; left: 50px; position: relative; top: -50px; width: 100px; z-index: 2"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4622006262638798689?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4622006262638798689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4622006262638798689' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4622006262638798689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4622006262638798689'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/css-layers.html' title='CSS - Layers'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-6469253653372912484</id><published>2008-04-01T03:55:00.000-07:00</published><updated>2008-11-04T01:13:10.469-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='function'/><category scheme='http://www.blogger.com/atom/ns#' term='capitalise'/><title type='text'>SQL - Capitalise function</title><content type='html'>This function will capitalise the first letter of every word in a sentence. The commented line can be used to ignore single letter words.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;create function dbo.Capitalise&lt;br /&gt;(&lt;br /&gt;    @Text varchar( 1000 )&lt;br /&gt;)&lt;br /&gt; &lt;br /&gt;returns varchar( 1000 )&lt;br /&gt; &lt;br /&gt;as&lt;br /&gt; &lt;br /&gt;begin &lt;br /&gt;    declare @ReturnString varchar( 1000 )&lt;br /&gt;    set @ReturnString = ''&lt;br /&gt; &lt;br /&gt;    declare @Word varchar(30)&lt;br /&gt; &lt;br /&gt;    declare @Pointer int&lt;br /&gt;    set @Pointer = 0&lt;br /&gt; &lt;br /&gt;    if right( @Text, 1 ) &lt;&gt; ' '&lt;br /&gt;        set @Text = @Text + ' '&lt;br /&gt; &lt;br /&gt;    while charindex( ' ', @Text, @Pointer ) &gt; 1&lt;br /&gt;    begin&lt;br /&gt;        set @Word = substring( @Text, @Pointer, charindex( ' ', @Text, @Pointer ) - @Pointer )&lt;br /&gt; &lt;br /&gt;        --if len( @Word ) &gt; 1&lt;br /&gt;            set @Word = upper( left( @Word, 1 ) ) + lower( right( @Word, len( @Word ) - 1 ) )&lt;br /&gt; &lt;br /&gt;        set @Pointer = charindex( ' ', @Text, @Pointer ) + 1&lt;br /&gt;        set @ReturnString = @ReturnString + @Word + ' '&lt;br /&gt;    end&lt;br /&gt; &lt;br /&gt;    set @ReturnString = rtrim( ltrim( @ReturnString ) )&lt;br /&gt; &lt;br /&gt;    return @ReturnString &lt;br /&gt;end&lt;/pre&gt;&lt;br /&gt;Example:&lt;pre&gt;select dbo.Capitalise( 'this is a test' ) as CapitalisedSentence&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-6469253653372912484?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/6469253653372912484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=6469253653372912484' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6469253653372912484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6469253653372912484'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/sql-capitalise-function.html' title='SQL - Capitalise function'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-6594848491522402682</id><published>2008-04-01T03:46:00.000-07:00</published><updated>2008-09-22T06:00:51.595-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='popup'/><category scheme='http://www.blogger.com/atom/ns#' term='window.open'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>JavaScript - Popup windows</title><content type='html'>&lt;pre&gt;function Popup( url, height, width )&lt;br /&gt;{&lt;br /&gt;    var windowProperties = "toolbar = 0, scrollbars = 1, location = 0, statusbar = 0, menubar = 0, resizable = 1, width = " + width + ", height = " + height + ", left = 50, top = 50";&lt;br /&gt; &lt;br /&gt;    return window.open( url, "", windowProperties );&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;function PopupScale( url, scale )&lt;br /&gt;{&lt;br /&gt;    // Default sizes.&lt;br /&gt;    var height = 800;&lt;br /&gt;    var width = 800;&lt;br /&gt;    &lt;br /&gt;    if ( window.screen ) &lt;br /&gt;    {&lt;br /&gt;        height = window.screen.availHeight * scale / 100;&lt;br /&gt;        width = window.screen.availWidth * scale / 100;&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    Popup( url, height, width );&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;input type="Submit" onclick="Popup( 'http://andrewgunn.blogspot.com/', 800, 800 )" value="Popup" /&gt; &lt;input type="Submit" onclick="PopupScale( 'http://andrewgunn.blogspot.com/', 75 )" value="Popup Scale" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-6594848491522402682?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/6594848491522402682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=6594848491522402682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6594848491522402682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6594848491522402682'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/javascript-popup-windows.html' title='JavaScript - Popup windows'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-98268340083712321</id><published>2008-04-01T03:22:00.000-07:00</published><updated>2008-09-07T04:02:17.797-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='clientY'/><category scheme='http://www.blogger.com/atom/ns#' term='hover'/><category scheme='http://www.blogger.com/atom/ns#' term='event'/><category scheme='http://www.blogger.com/atom/ns#' term='mouseY'/><category scheme='http://www.blogger.com/atom/ns#' term='clientX'/><category scheme='http://www.blogger.com/atom/ns#' term='mouseX'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>JavaScript - Hover effect</title><content type='html'>&lt;pre&gt;var _elementID;&lt;br /&gt;var _xOffset = 15;&lt;br /&gt;var _yOffset = 15;&lt;br /&gt; &lt;br /&gt;function GetMouseX( event )&lt;br /&gt;{&lt;br /&gt;    if ( !event )&lt;br /&gt;    {&lt;br /&gt;        event = window.event;&lt;br /&gt;    }&lt;br /&gt;      &lt;br /&gt;    if ( event.pageX )&lt;br /&gt;    {&lt;br /&gt;        return event.pageX;&lt;br /&gt;    }&lt;br /&gt;    else if ( event.clientX )&lt;br /&gt;    {&lt;br /&gt;        return event.clientX + ( document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft );&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;        return 0;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;function GetMouseY( event ) &lt;br /&gt;{&lt;br /&gt;    if ( !event ) &lt;br /&gt;    {&lt;br /&gt;        event = window.event;&lt;br /&gt;    }&lt;br /&gt;      &lt;br /&gt;    if ( event.pageY )&lt;br /&gt;    {&lt;br /&gt;        return event.pageY; &lt;br /&gt;    }&lt;br /&gt;    else if ( event.clientY )&lt;br /&gt;    {&lt;br /&gt;        return event.clientY + ( document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop );&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;        return 0;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;function Follow( event )&lt;br /&gt;{&lt;br /&gt;    if ( document.getElementById )&lt;br /&gt;    {                  &lt;br /&gt;        var element = document.getElementById( _elementID );&lt;br /&gt;        &lt;br /&gt;        if ( element != null )&lt;br /&gt;        {&lt;br /&gt;            var style = element.style; &lt;br /&gt;            style.left = ( parseInt( GetMouseX( event ) ) + _xOffset ) + 'px';&lt;br /&gt;            style.top = ( parseInt( GetMouseY( event ) ) + _yOffset ) + 'px'; &lt;br /&gt;            style.visibility = 'visible';&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;function Show( elementID )&lt;br /&gt;{&lt;br /&gt;    if ( document.getElementById )&lt;br /&gt;    {     &lt;br /&gt;        _elementID = elementID;&lt;br /&gt;            &lt;br /&gt;        document.onmousemove = Follow;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;function Hide( elementID )&lt;br /&gt;{&lt;br /&gt;    if ( document.getElementById )&lt;br /&gt;    {     &lt;br /&gt;        _elementID = elementID;&lt;br /&gt;            &lt;br /&gt;        var divStyle = document.getElementById( _elementID ).style;&lt;br /&gt;        divStyle.visibility = 'hidden';&lt;br /&gt;      &lt;br /&gt;        document.onmousemove = '';&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Example:&lt;div id="Hover" style="background-color: White; color: Black; padding: 5px; position: absolute; visibility: hidden;"&gt;Test&lt;/div&gt;&lt;br /&gt;&lt;div onmouseover="javascript:Show( 'Hover' )" onmouseout="javascript:Hide( 'Hover' )" style="background-color: Red; height: 100px; width: 100px;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;div id="Hover" style="background-color: White; color: Black; padding: 5px; position: absolute; visibility: hidden;"&gt;Test&amp;lt;/div&gt;&lt;br /&gt;&amp;lt;div onmouseover="javascript:Show( 'Hover' )" onmouseout="javascript:Hide( 'Hover' )" style="background-color: Red; height: 100px; width: 100px;"&gt;&amp;lt;/div&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-98268340083712321?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/98268340083712321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=98268340083712321' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/98268340083712321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/98268340083712321'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/04/javascript-hover-effect.html' title='JavaScript - Hover effect'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-2410531143496827614</id><published>2008-03-31T08:58:00.001-07:00</published><updated>2008-04-04T16:31:24.329-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='borovets'/><category scheme='http://www.blogger.com/atom/ns#' term='snowboarding'/><category scheme='http://www.blogger.com/atom/ns#' term='ilan baroukh'/><category scheme='http://www.blogger.com/atom/ns#' term='becky neal'/><category scheme='http://www.blogger.com/atom/ns#' term='svilen hristov dokuzov'/><category scheme='http://www.blogger.com/atom/ns#' term='simon wallwork'/><category scheme='http://www.blogger.com/atom/ns#' term='bulgaria'/><category scheme='http://www.blogger.com/atom/ns#' term='chris sidoli'/><title type='text'>Bulgaria Video 2</title><content type='html'>I'm the one in red!&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/YvcrUzrJbNA&amp;hl=en"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/YvcrUzrJbNA&amp;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-2410531143496827614?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/2410531143496827614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=2410531143496827614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/2410531143496827614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/2410531143496827614'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/03/bulgaria-video-2.html' title='Bulgaria Video 2'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-1668268175679090222</id><published>2008-03-31T08:56:00.000-07:00</published><updated>2008-04-04T16:31:38.958-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='borovets'/><category scheme='http://www.blogger.com/atom/ns#' term='snowboarding'/><category scheme='http://www.blogger.com/atom/ns#' term='ilan baroukh'/><category scheme='http://www.blogger.com/atom/ns#' term='becky neal'/><category scheme='http://www.blogger.com/atom/ns#' term='svilen hristov dokuzov'/><category scheme='http://www.blogger.com/atom/ns#' term='simon wallwork'/><category scheme='http://www.blogger.com/atom/ns#' term='bulgaria'/><category scheme='http://www.blogger.com/atom/ns#' term='chris sidoli'/><title type='text'>Bulgaria Video 1</title><content type='html'>What a view...&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/xU--OID5KNM&amp;hl=en"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/xU--OID5KNM&amp;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-1668268175679090222?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/1668268175679090222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=1668268175679090222' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1668268175679090222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1668268175679090222'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/03/bulgaria-video-1.html' title='Bulgaria Video 1'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-6668424155451587756</id><published>2008-03-31T08:29:00.000-07:00</published><updated>2008-09-07T04:02:02.146-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>JavaScript - Toggle element visibility</title><content type='html'>Here are 2 functions for showing/hiding an element. The first will simply invert it's visibility relative to the current state. The second has an extra parameter indicating the visibility:&lt;br /&gt;&lt;pre style="background-color: Black; border: 1px solid #cccccc; color: #cccccc; height: 50 0px; overflow: auto; scrollbar-base-color: #cccccc; scrollbar-track-color: Black"&gt;function ToggleElementVisibility( elementID )&lt;br /&gt;{&lt;br /&gt;    var element = document.getElementById( elementID );&lt;br /&gt;                 &lt;br /&gt;    if ( element != null )&lt;br /&gt;    {&lt;br /&gt;        if ( element.style.display == 'none' )&lt;br /&gt;        {            &lt;br /&gt;            element.style.display = '';        &lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {    &lt;br /&gt;            element.style.display = 'none';&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;function ShowHideElement( elementID, isVisible )&lt;br /&gt;{&lt;br /&gt;    var element = document.getElementById( elementID );&lt;br /&gt;                 &lt;br /&gt;    if ( element != null )&lt;br /&gt;    {&lt;br /&gt;        if ( isVisible == true )&lt;br /&gt;        {            &lt;br /&gt;            element.style.display = '';        &lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {    &lt;br /&gt;            element.style.display = 'none';&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;div id="ToggleShowHide" onclick="ShowHideElement( this.id, false )" style="background-color: Red; height: 100px; margin: 0 0 10px 0; width: 100px;"&gt;&lt;/div&gt; &lt;br /&gt;&lt;input type="Submit" value="Toggle" onclick="ToggleElementVisibility( 'ToggleShowHide' )" /&gt; &lt;input type="Submit" value="Show" onclick="ShowHideElement( 'ToggleShowHide', true )" /&gt; &lt;input type="Submit" value="Hide" onclick="ShowHideElement( 'ToggleShowHide', false )" /&gt;&lt;br /&gt;&lt;pre style="background-color: black; border: 1px solid #cccccc; color: #cccccc; height: 100px; overflow: auto; scrollbar-base-color: #cccccc; scrollbar-track-color: black"&gt;&amp;lt;div id="ToggleShowHide" onclick="ShowHideElement( this.id, false )" style="background-color: Red; height: 100px; margin: 0 0 10px 0; width: 100px;"&gt;&amp;lt;/div&gt; &lt;br /&gt;&amp;lt;input type="Submit" value="Toggle" onclick="ToggleElementVisibility( 'ToggleShowHide' )" /&gt;&lt;br /&gt;&amp;lt;input type="Submit" value="Show" onclick="ShowHideElement( 'ToggleShowHide', true )" /&gt;&lt;br /&gt;&amp;lt;input type="Submit" value="Hide" onclick="ShowHideElement( 'ToggleShowHide', false )" /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-6668424155451587756?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/6668424155451587756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=6668424155451587756' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6668424155451587756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6668424155451587756'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/03/javascript-toggle-element-visibility.html' title='JavaScript - Toggle element visibility'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4324538547981515455</id><published>2008-03-27T16:13:00.000-07:00</published><updated>2008-09-07T04:01:38.667-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='borovets'/><category scheme='http://www.blogger.com/atom/ns#' term='snowboarding'/><category scheme='http://www.blogger.com/atom/ns#' term='becky neal'/><category scheme='http://www.blogger.com/atom/ns#' term='georgina wyld'/><category scheme='http://www.blogger.com/atom/ns#' term='simon wallwork'/><category scheme='http://www.blogger.com/atom/ns#' term='luke ogelsby'/><category scheme='http://www.blogger.com/atom/ns#' term='chris sidoli'/><category scheme='http://www.blogger.com/atom/ns#' term='liv flaherty'/><category scheme='http://www.blogger.com/atom/ns#' term='ilan baroukh'/><category scheme='http://www.blogger.com/atom/ns#' term='svilen hristov dokuzov'/><category scheme='http://www.blogger.com/atom/ns#' term='fraser young'/><category scheme='http://www.blogger.com/atom/ns#' term='bulgaria'/><category scheme='http://www.blogger.com/atom/ns#' term='ross chambers'/><title type='text'>Bulgaria 2008 slide show</title><content type='html'>Bulga Bulga...&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/L0-D2ZAtkMg"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/L0-D2ZAtkMg" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4324538547981515455?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4324538547981515455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4324538547981515455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4324538547981515455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4324538547981515455'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/03/bulgaria-2008-slide-show.html' title='Bulgaria 2008 slide show'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-2630434551064752334</id><published>2008-03-20T05:19:00.000-07:00</published><updated>2008-03-31T08:51:52.412-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><title type='text'>Silverlight - The project type is not supported by this installation</title><content type='html'>Launch a command window, navigate to C:\Program Files\Microsoft Visual Studio x\Common7\IDE (where x is the version number) and run:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;devenv /setup&lt;/pre&gt;&lt;br /&gt;If you're using Visual Studio 2008, try downloading the latest &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=25144c27-6514-4ad4-8bcb-e2e051416e03&amp;displaylang=en"&gt;Silverlight Tools&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-2630434551064752334?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/2630434551064752334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=2630434551064752334' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/2630434551064752334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/2630434551064752334'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/03/silverlight-project-type-is-not.html' title='Silverlight - The project type is not supported by this installation'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-6204640133543607151</id><published>2008-03-18T14:02:00.001-07:00</published><updated>2008-03-31T08:50:56.272-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='textmode'/><category scheme='http://www.blogger.com/atom/ns#' term='password'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='textbox'/><title type='text'>How do I set the text using an ASP.NET Password TextBox?</title><content type='html'>&lt;pre&gt;tbPassword.Attributes["value"] = "test";&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-6204640133543607151?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/6204640133543607151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=6204640133543607151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6204640133543607151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6204640133543607151'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/03/how-do-i-set-text-using-aspnet-password.html' title='How do I set the text using an ASP.NET Password TextBox?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-75585771015994274</id><published>2008-03-18T10:12:00.003-07:00</published><updated>2008-04-04T16:32:20.524-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='gacutil'/><title type='text'>gacutil is not recognized as an internal or external command, operable program or batch file</title><content type='html'>Sometimes, you want to run gacutil from the command line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;gacutil /i &lt;i&gt;{assemblyPath}&lt;/i&gt;&lt;/pre&gt;&lt;br /&gt;On some computers (depending on the installation), you might get the following error message:&lt;br /&gt;&lt;br /&gt;'gacutil' is not recognized as an internal or external command, operable program or batch file&lt;br /&gt;&lt;br /&gt;You'll need to download and install the Visual Studio 2005 SDK. Included in the SDK is gacutil.exe. In order for Windows to recognise the gacutil command, you'll also need to modify the Path variable (Environment Varabiables). Simply add the location of the executable which is normally:&lt;br /&gt;&lt;br /&gt;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin&lt;br /&gt;&lt;br /&gt;Remember to include a semi-colon before adding the folder location.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-75585771015994274?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/75585771015994274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=75585771015994274' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/75585771015994274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/75585771015994274'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/03/gacutil-is-not-recognized-as-internal.html' title='gacutil is not recognized as an internal or external command, operable program or batch file'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-948348946255467645</id><published>2008-03-18T10:12:00.001-07:00</published><updated>2008-06-06T16:51:42.035-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='borovets'/><category scheme='http://www.blogger.com/atom/ns#' term='snowboarding'/><category scheme='http://www.blogger.com/atom/ns#' term='bulgaria'/><title type='text'>Borovets, Bulgaria</title><content type='html'>March 2008 - boys on tour, snowboarding in Bulgaria. We'd booked this holiday months before and to be honest, got a really good deal. We paid £460 for everything - flights, transfers, accomodation, breakfast and evening (although the food in the hotel was rubbish), ski pass and 3 days training. The only thing that concerned me was the weather - March is pretty much the end of the winter season. &lt;br /&gt;&lt;br /&gt;When we arrived, we were introduced to a resort with snow :D. OK, there could have been more snow but at least I knew that the levels would be much better at the top of the gondola. Our hotel room overlooked the end of the mini run - pretty much the best view. This is where we'd spend the first few days going on the chair lift. It featured a really steep slope - something I never thought we'd conquer after seeing for the first time in total darkness.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_B7qeoYf7Cuw/R_Z3fE7i_vI/AAAAAAAAAAk/B0Pak1-aryc/s1600-h/DSC00168.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_B7qeoYf7Cuw/R_Z3fE7i_vI/AAAAAAAAAAk/B0Pak1-aryc/s320/DSC00168.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5185463396746854130" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The first night was spent getting familiar with the local bars and restaurants. The next morning, we had our first lesson. I'd been to Austria a few years ago so I chose to go in the intermediate class. My mates were all put in the beginner class but I met a great set of people in mine. By the second day, we were going to the top of the mountain and I was falling over less and less. On day 4, our instructor brought a shovel so we could make a jump. We all had a few goes which improved our confidence and made me more keen to find more. The reason why we were still with the instructor was because he offered us 3 days for the price of 1, and if nothing else, he was an excellent guide. Unfortunately, we could only go from the top station to the middle station; the snow levels were insufficient towards the bottom. On the last day though, we had the courage to give it a go. Svilen led the way and we managed to get pretty close before we had to stop. Luckily, he had a man with a van who picked us up and took us for lunch - happy days! The last 2 days were probably the worst conditions - high winds meant the gondola was shut by mid-afternoon. We'd all had our fair share by this point and didn't mind a few cheeky runs on the nursery slope.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_B7qeoYf7Cuw/R_Z_aE7i_yI/AAAAAAAAAA8/3kjmBy3aMVY/s1600-h/DSC00207.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_B7qeoYf7Cuw/R_Z_aE7i_yI/AAAAAAAAAA8/3kjmBy3aMVY/s320/DSC00207.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5185472106940530466" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The nightlife in Borovets is amazing! There are plenty of restaurants, bars, clubs... even strip joints ;). The only thing I'll say about that food is to make sure it's cooked properly. We had chicken burgers once that were completely raw on one side. Sending them back to be cooked didn't make a difference so we ordered something else. The beer is really good and really cheap. In one place called Buzz Bar, you could get 2 beers for about £1.50 - bargain. Other favourites of ours include Frankos and the karaoke bar nearby (possibly Black Tiger). We stayed in the Rila hotel, probably one of the best. Our rooms were basic and small but we didn't spend much time in them at all. Our equipment was hired and stored in the same building meaning we could stroll down for breakfast and get our kit without rushing. It also had swimming and gym facilities - the spa was definitely beneficial after a hard day on the slopes.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_B7qeoYf7Cuw/R_Z5uE7i_wI/AAAAAAAAAAs/R1ULmDQIkKw/s1600-h/DSC00174.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_B7qeoYf7Cuw/R_Z5uE7i_wI/AAAAAAAAAAs/R1ULmDQIkKw/s320/DSC00174.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5185465853468147458" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I'd definitely recommend Borovets as a skiing resort but you should probably go a bit earlier in the season - February is a safe bet. We booked our holiday with &lt;a href="http://www.balkanholidays.co.uk"&gt;Balkan Holidays&lt;/a&gt; and had no complaints. The reps have lots of activities to do - the bar crawl being the most popular. &lt;br /&gt;&lt;br /&gt;If you have any questions about Borovets, give me a shout. Oh, one more thing, go to a restaurant called Hunters. It's ownled by our instructor's family and we ate there 3 nights in a row. The kebabs skewers are not to be missed. Say hi to Svilen if you go, haha.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-948348946255467645?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/948348946255467645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=948348946255467645' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/948348946255467645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/948348946255467645'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/03/borovets-bulgaria.html' title='Borovets, Bulgaria'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_B7qeoYf7Cuw/R_Z3fE7i_vI/AAAAAAAAAAk/B0Pak1-aryc/s72-c/DSC00168.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-618978589578229601</id><published>2008-02-27T08:27:00.001-08:00</published><updated>2008-09-08T09:51:01.078-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='aspnetdb'/><title type='text'>How do I create the aspnetdb database?</title><content type='html'>After installing the Microsoft .NET framework 2.0, launch a command window and run:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-618978589578229601?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/618978589578229601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=618978589578229601' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/618978589578229601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/618978589578229601'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/02/how-do-i-create-aspnetdb-database.html' title='How do I create the aspnetdb database?'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-1550607462424258820</id><published>2008-02-27T07:34:00.000-08:00</published><updated>2008-03-18T10:19:48.159-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='error 26'/><title type='text'>error: 26 - Error Locating Server/Instance Specified</title><content type='html'>"An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"&lt;br /&gt;&lt;br /&gt;I received this error because the SQL Server Browser service wasn't running. The advantages of having this running is that users connecting remotely don't have to specify a port and security is improved.&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Launch the Windows Services manager (Control Panel &gt; Administrative Tools &gt; Services)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Locate the "SQL Server Browser" service&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Right click the service and select "Enable"&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp3.blogger.com/_B7qeoYf7Cuw/R8WIk1v5UCI/AAAAAAAAAAc/iJaQlTMFxRE/s1600-h/ser.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_B7qeoYf7Cuw/R8WIk1v5UCI/AAAAAAAAAAc/iJaQlTMFxRE/s400/ser.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5171689913589518370" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-1550607462424258820?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/1550607462424258820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=1550607462424258820' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1550607462424258820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1550607462424258820'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/02/error-26-error-locating-serverinstance.html' title='error: 26 - Error Locating Server/Instance Specified'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_B7qeoYf7Cuw/R8WIk1v5UCI/AAAAAAAAAAc/iJaQlTMFxRE/s72-c/ser.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4382448636996246524</id><published>2008-02-25T08:06:00.000-08:00</published><updated>2008-03-18T10:19:35.597-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='error 28'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>error: 28 - Server doesn't support requested protocol</title><content type='html'>After trying to setup SQL Server 2005 Express, I kept getting the following error when I tried to connect from a web application:&lt;br /&gt;&lt;br /&gt;"An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 28 - Server doesn't support requested protocol)"&lt;br /&gt;&lt;br /&gt;Network protocols are disabled in SQL Server 2005 Express by default so we need to enable TCP/IP:&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Launch the SQL Server Configuration Manager&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Expand the "SQL Server 2005 Network Configuration" node&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Left click the "Protocols for SQLEXPRESS" node to view the supported protocols&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Right click the "TCP/IP" protocol and select "Enable"&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_B7qeoYf7Cuw/R8WGilv5UAI/AAAAAAAAAAM/zBcGW0aEdRA/s1600-h/Services.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_B7qeoYf7Cuw/R8WGilv5UAI/AAAAAAAAAAM/zBcGW0aEdRA/s320/Services.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5171687675911557122" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4382448636996246524?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4382448636996246524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4382448636996246524' title='43 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4382448636996246524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4382448636996246524'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/02/error-28-server-doesnt-support.html' title='error: 28 - Server doesn&apos;t support requested protocol'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_B7qeoYf7Cuw/R8WGilv5UAI/AAAAAAAAAAM/zBcGW0aEdRA/s72-c/Services.JPG' height='72' width='72'/><thr:total>43</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-693520905690623524</id><published>2008-02-24T03:05:00.001-08:00</published><updated>2008-03-18T10:20:22.863-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sharepod'/><category scheme='http://www.blogger.com/atom/ns#' term='ipod'/><category scheme='http://www.blogger.com/atom/ns#' term='itunes'/><title type='text'>SharePod</title><content type='html'>"&lt;a href="http://www.sturm.net.nz/website.php?Section=iPod+Programs&amp;Page=SharePod"&gt;SharePod 3&lt;/a&gt; is a lightweight music management program for your iPod. You can copy music and videos between your iPod and computers usually without having to install anything on the computer."&lt;br /&gt;&lt;br /&gt;This is a great application if you're on a computer with iTunes that hasn't been configured to use your iPod. It can be stored and run directly from your iPod which is why you don't need to install it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-693520905690623524?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/693520905690623524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=693520905690623524' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/693520905690623524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/693520905690623524'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/02/sharepod.html' title='SharePod'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-7580300214801765761</id><published>2008-02-18T02:27:00.000-08:00</published><updated>2008-09-07T04:01:13.903-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='itunes'/><title type='text'>iTunes Music converter</title><content type='html'>Apple recommend that music files for your iPod should be stored as AAC format (&lt;a target="_blank" href="http://docs.info.apple.com/article.html?artnum=93013"&gt;view article&lt;/a&gt;). After reading this, I converted all my mp3s which significantly reduced them in size. I thought I'd provide instructions so others can rearrange their music library in the same way.&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Store all your old music files (mp3s, WMAs etc) in the same folder (e.g. C:\Music)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Launch iTunes and remove all of the songs - hold CTRL and A, right click and choose 'Delete' (if you are asked to remove files, choose 'Keep Files' - this prevents the actual files from going to the recycle bin)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add a folder to the library - File &gt; Add Folder to Library, then select the folder from the first step&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Set the import encoder - Edit &gt; Preferences &gt; Advanced &gt; Importing, then choose the AAC Encoder&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Convert all the mp3s into AAC format - hold CTRL + A, right click and choose Convert Selection to AAC&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Remove all of the songs again&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add another folder to the library but this time, choose the music library folder used by iTunes&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;If you find that some or all of your existing songs in iTunes are the wrong format, it might be easier to convert these as well. Move them into a different location (cut and paste) and follow the above steps. Once complete, you can delete the contents of the folder from the first step.&lt;br /&gt;&lt;br /&gt;If you have questions, let me know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-7580300214801765761?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/7580300214801765761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=7580300214801765761' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7580300214801765761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7580300214801765761'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/02/itunes-music-converter.html' title='iTunes Music converter'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4382205076399518993</id><published>2008-02-18T02:26:00.000-08:00</published><updated>2008-09-07T04:00:47.595-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cd cover'/><category scheme='http://www.blogger.com/atom/ns#' term='album artwork'/><category scheme='http://www.blogger.com/atom/ns#' term='itunes'/><title type='text'>iTunes album artwork not found</title><content type='html'>When adding music to iTunes, it will try and find the album artwork and download it automatically. If no picture can be found, the default image will be displayed. I like all my albums to have the correct cover so I use online resources to download them myself. The main 2 websites I use are &lt;a href="http://www.allcdcovers.com" target="_blank"&gt;allcdcovers.com&lt;/a&gt; and &lt;a href="http://www.seekacover.com/" target="_blank"&gt;seekacover.com&lt;/a&gt;. Simply search for an artist/album and select a suitable result. Save the picture in a memorable folder (My Pictures is probably best) and go back into iTunes. Highlight all of the tracks under the album (left click the first track, hold down the shift key and left click the last track). Right click one of these tracks and choose 'Get Info' - this opens the menu for editing track information. Because multilpe songs were highlighted, any changes made at this point will affect all of the tracks. Near the bottom right, there is a section for the album artwork. Double click the white sqaure and locate the saved image. Make sure you apply changes by clicking 'OK' and the album artwork will be updated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4382205076399518993?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4382205076399518993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4382205076399518993' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4382205076399518993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4382205076399518993'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/02/itunes-album-artwork-not-found.html' title='iTunes album artwork not found'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4445043685892656832</id><published>2008-02-18T01:39:00.001-08:00</published><updated>2008-03-18T10:20:45.456-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows media player'/><category scheme='http://www.blogger.com/atom/ns#' term='itunes'/><title type='text'>iTunes vs Windows Media Player</title><content type='html'>Yesterday, I got my first iPod - the new nano. It is a thing of beauty! I've already got a big collection of mp3s so I was worried that iTunes would throw a wobbly. Instead, it was able to convert all my files to AAC format - reducing them in size whilst maintaining quality meaning I can store more music on my iPod. During this conversion, iTunes created new files and the naming convention was spot on. It automatically saves each track in an album folder which sits in an artist folder. It even downloaded the majority of the album artworks - the only job left for me was filling in the gaps. I love the fact that when I change the artist/album/track name in iTunes, the file/folder is updated.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://clkuk.tradedoubler.com/click?p=50662&amp;a=1471893&amp;g=16686336" target="_BLANK"&gt;&lt;img src="http://impgb.tradedoubler.com/imp?type(img)g(16686336)a(1471893)" border=0&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;When I plugged my iPod in for the first time, I decided to manually update it. After a while, I realised that this was too time consuming so it now syncs automatically. My original decision was made after hearing stories of iTunes deleting all the music from iPods. I think this only happens when iTunes itself contains no music; therefore the mirroring process will clear everything from the iPod - something I don't have to worry about because my iTunes always has the files. Now that my iPod is nearly full (I think I have about 300mb remaining), I will go back to manual updates. I guess I'll have to start being more selective by ignoring entire albums or individual songs that I don't or rarely listen to.&lt;br /&gt;&lt;br /&gt;I still own a Creative Zen Micro mp3 player but I can't see myself using it anymore. Before iTunes, Windows Media Player filled the void for ripping, managing and playing music. I never thought I'd say this but now I can't see myself using this anymore either. iTunes is not only an alternative; it's the replacement. My favourite feature is the cover flow where you can scroll through all of the album covers - something that is also on my iPod :D. To summarise, all of those who are afraid to use Apple products (like I was) have nothing to fear - I guarantee they won't look back!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4445043685892656832?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4445043685892656832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4445043685892656832' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4445043685892656832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4445043685892656832'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/02/itunes-vs-windows-media-player.html' title='iTunes vs Windows Media Player'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-1268121770624835699</id><published>2008-02-06T02:10:00.000-08:00</published><updated>2008-02-06T03:34:11.522-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='alienware'/><category scheme='http://www.blogger.com/atom/ns#' term='laptop'/><category scheme='http://www.blogger.com/atom/ns#' term='m9750'/><title type='text'>Alienware, I salute you!</title><content type='html'>Alienware have kindly agreed for my blog to be part of their affiliate scheme. For those of you who are interested in Alienware products, I highly recommend them. I bought an Area-51 m9750 laptop last year and still stand by my decision. Yes, they're a bit more expensive but the performace is amazing.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://clkuk.tradedoubler.com/click?p=61747&amp;a=1471893&amp;g=16979356" target="_BLANK"&gt;&lt;img src="http://impgb.tradedoubler.com/imp?type(img)g(16979356)a(1471893)" border=0&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In a previous post, I talked about how I upgraded the laptop's network card. This was made easy because the staff at Alienware were very helpful and provided me with a step-by-step guide - I was worried that I'd have to send it away.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-1268121770624835699?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/1268121770624835699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=1268121770624835699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1268121770624835699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1268121770624835699'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/02/alienware-i-salute-you.html' title='Alienware, I salute you!'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3525749635613076720</id><published>2008-02-01T00:58:00.000-08:00</published><updated>2008-09-07T04:00:26.993-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='columns'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>CSS columns</title><content type='html'>Here is a perfect solution to the 3 column layout in CSS. The left and right columns are floated left and right respectively. The middle column has left and right borders relative to the left and right column widths (either in pixels or a percentage). It is important to code them in the right order: left, right then middle. My example uses inline styles but these could be moved into a CSS file. Underneath the middle column is a cleaner DIV. This prevents any subsequent content from being affected by previous float attributes - treat it as a format resetter.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;div style="text-align: center;"&gt;&lt;br /&gt; &lt;br /&gt;    &amp;lt;div style="margin: auto; text-align: left; width: 75%"&gt;&lt;br /&gt; &lt;br /&gt;        &amp;lt;div style="background-color: red; margin: 0; padding: 5px;"&gt;Top&amp;lt;/div&gt;&lt;br /&gt; &lt;br /&gt;        &amp;lt;div style="background-color: orange; float: left; margin: 0; padding: 5px; width: 100px;"&gt;Left&amp;lt;/div&gt;&lt;br /&gt; &lt;br /&gt;        &amp;lt;div style="background-color: yellow; float: right; margin: 0; padding: 5px; width: 100px;"&gt;Right&amp;lt;/div&gt;&lt;br /&gt; &lt;br /&gt;        &amp;lt;div style="background-color: green; margin: 0 100px; padding: 5px;"&gt;Middle&amp;lt;/div&gt;&lt;br /&gt; &lt;br /&gt;        &amp;lt;div style="clear: both;"&gt;&amp;lt;/div&gt;&lt;br /&gt; &lt;br /&gt;        &amp;lt;div style="background-color: blue; margin: 0; padding: 5px;"&gt;Bottom&amp;lt;/div&gt;&lt;br /&gt; &lt;br /&gt;    &amp;lt;/div&gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;/div&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3525749635613076720?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3525749635613076720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3525749635613076720' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3525749635613076720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3525749635613076720'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/02/css-columns.html' title='CSS columns'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5254953188535873711</id><published>2008-01-30T08:17:00.000-08:00</published><updated>2008-09-07T04:00:12.738-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='onclientclick'/><category scheme='http://www.blogger.com/atom/ns#' term='page_isvalid'/><category scheme='http://www.blogger.com/atom/ns#' term='page_clientvalidate'/><category scheme='http://www.blogger.com/atom/ns#' term='client-side validation'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Client-side validation controls</title><content type='html'>Client-side validation controls (e.g. RegularExpressionValidator) are really good for spotting incorrect input before any server-side processing takes place because the page is prevented from doing a postback.&lt;br /&gt;&lt;br /&gt;What if you override the client click event (OnClientClick) of a button that is associated with one or more validation controls. Would you expect a similar behaviour? Wrong! The custom script is executed regardless of the validation.&lt;br /&gt;&lt;br /&gt;The desired outcome of the following example is to get a popup when the button is clicked if the text box isn't empty:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;asp:TextBox ID="tbName" runat="server" ValidationGroup="Name" /&gt;&lt;br /&gt;&amp;lt;asp:Button runat="server" Text="Submit" OnClientClick="javascript:alert( 'hello world' );" ValidationGroup="Name" /&gt;&lt;br /&gt;&amp;lt;asp:RequiredFieldValidator runat="server" ControlToValidate="tbName" Text="*" ValidationGroup="Name" /&gt;&lt;/pre&gt;&lt;br /&gt;The actual outcome is a popup even if the text box is empty. To make sure the page is valid, call Page_ClientValidate to update Page_IsValid (true/false) and add a condition around your script:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;asp:TextBox ID="tbName" runat="server" ValidationGroup="Name" /&gt;&lt;br /&gt;&amp;lt;asp:Button runat="server" Text="Submit" OnClientClick="javascript:Page_ClientValidate(); if ( Page_IsValid ) { alert( 'hello world' ); }" ValidationGroup="Name" /&gt;&lt;br /&gt;&amp;lt;asp:RequiredFieldValidator runat="server" ControlToValidate="tbName" Text="*" ValidationGroup="Name" /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5254953188535873711?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5254953188535873711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5254953188535873711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5254953188535873711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5254953188535873711'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/01/client-side-validation-controls.html' title='Client-side validation controls'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5396095691056778871</id><published>2008-01-29T01:10:00.000-08:00</published><updated>2008-02-09T11:05:09.309-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tag'/><category scheme='http://www.blogger.com/atom/ns#' term='pre'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>Tags inside PRE</title><content type='html'>PRE tags are used to format text; linebreaks, spaces and tabs are all recognised from the source instead of being ignored. One thing they don't display (without a small tweak) is tags (e.g. &amp;lt;test&amp;gt;) - the angle brackets and any content will be omitted but there is a solution. Simply replace the first angle bracket with &amp;amp;lt; (e.g. &amp;amp;lt;test&amp;gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5396095691056778871?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5396095691056778871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5396095691056778871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5396095691056778871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5396095691056778871'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/01/tags-inside-pre.html' title='Tags inside PRE'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-7598887470463530596</id><published>2008-01-26T05:53:00.000-08:00</published><updated>2008-02-09T11:12:33.655-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='episerver'/><category scheme='http://www.blogger.com/atom/ns#' term='page language'/><title type='text'>Change Page Language in EPiServer</title><content type='html'>After a previous post about changing an existing page's page type in EPiServer, I've now found out how to change an existing page's language. &lt;br /&gt;&lt;br /&gt;At Esendex, we have different websites for each country in EPiServer. Originally, we started with a single UK website which was simply copied to create ones for Australia, France and Spain. This meant that all of the pages had been created in English (default) instead of the respective country languages. Instead of creating further instances of the pages, we wanted to change the existing ones to save time. This also helped us with the our content mirroring; we have servers in the respective countries to host our global sites. These servers should only have a copy of the website in the appropriate language. We found it difficult mirroring English pages into French copies and we didn't want multiple instances on these servers.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;declare @PageID int&lt;br /&gt;declare @OriginalLanguageBranchID int&lt;br /&gt;declare @NewLanguageBranchID int&lt;br /&gt;declare @NewLanguageID nvarchar( 3 )&lt;br /&gt; &lt;br /&gt;set @PageID = X&lt;br /&gt;set @OriginalLanguageBranchID = Y&lt;br /&gt;set @NewLanguageBranchID = Z&lt;br /&gt;set @NewLanguageID = '' -- e.g. 'FR'&lt;br /&gt; &lt;br /&gt;update tblPageLanguage&lt;br /&gt;set fkLanguageBranchID = @NewLanguageBranchID, fkLanguageID = @NewLanguageID&lt;br /&gt;where fkPageID = @PageID&lt;br /&gt; &lt;br /&gt;update tblPage&lt;br /&gt;set fkMasterLanguageBranchID = @NewLanguageBranchID, fkLanguageID = @NewLanguageID&lt;br /&gt;where pkID = @PageID &lt;br /&gt; &lt;br /&gt;update tblProperty&lt;br /&gt;set fkLanguageBranchID = @NewLanguageBranchID&lt;br /&gt;where fkPageID = @PageID and fkLanguageBranchID = @OriginalLanguageBranchID&lt;br /&gt; &lt;br /&gt;exec editPageVersionList @PageID = @PageID, @SID = NULL&lt;/pre&gt;&lt;br /&gt;Simply replace X with the page ID, Y with the original (current) language branch ID and Z with the new language branch ID. The new language ID is respective to the new language branch ID. These ID values can be found by querying the tblLanguage and tblLanguageBranch tables.&lt;br /&gt;&lt;br /&gt;It might sound obvious, but before running this script on a page, make sure no instances for the new language already exist otherwise concurrency exceptions will be thrown.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-7598887470463530596?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/7598887470463530596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=7598887470463530596' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7598887470463530596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7598887470463530596'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/01/change-page-language-in-episerver.html' title='Change Page Language in EPiServer'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-525645086691468862</id><published>2008-01-21T03:54:00.000-08:00</published><updated>2008-09-07T03:59:27.415-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cage'/><category scheme='http://www.blogger.com/atom/ns#' term='barracks'/><category scheme='http://www.blogger.com/atom/ns#' term='rank'/><category scheme='http://www.blogger.com/atom/ns#' term='hint'/><category scheme='http://www.blogger.com/atom/ns#' term='1 on 1'/><category scheme='http://www.blogger.com/atom/ns#' term='xp'/><category scheme='http://www.blogger.com/atom/ns#' term='cheat'/><category scheme='http://www.blogger.com/atom/ns#' term='challenges'/><category scheme='http://www.blogger.com/atom/ns#' term='call of duty 4'/><title type='text'>Challenging challenges</title><content type='html'>Are you finding it hard to complete some of the challenges on Call Of Duty 4? With the help of a friend, you can host a Cage match (1 on 1) and organise different scenarios to achieve maximum XP and ultimately increase your rank. One of the best (but most boring) examples is head shot kills - you and your friend take it in turns to shoot each other in the head by continuously meeting at a specified location.&lt;br /&gt;&lt;br /&gt;Instructions:&lt;br /&gt;&lt;li&gt;Enter the pregame lobby&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Send an invite to your friend but tell him/her not to accept - simply get ready to accept&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Find a Cage match&lt;/li&gt;&lt;br /&gt;&lt;li&gt;As soon as you start matchmaking, tell your friend to accept the invitiation - he/she will then join the lobby and the match will begin&lt;/li&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-525645086691468862?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/525645086691468862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=525645086691468862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/525645086691468862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/525645086691468862'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/01/challenging-challenges.html' title='Challenging challenges'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-9173362432803349358</id><published>2008-01-10T08:11:00.000-08:00</published><updated>2008-09-22T01:27:24.185-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='page type'/><category scheme='http://www.blogger.com/atom/ns#' term='template'/><category scheme='http://www.blogger.com/atom/ns#' term='episerver'/><title type='text'>Change Page Types in EPiServer</title><content type='html'>I work for a company called &lt;a href="http://www.esendex.com" target="_blank"&gt;Esendex&lt;/a&gt; where I help development and maintain their web projects. The main website uses a CMS called &lt;a href="http://www.episerver.com" target="_blank"&gt;EPiServer&lt;/a&gt;, allowing non-technical people to create, edit and publish web pages. The system uses custom page types that are based on real *.aspx files known as templates. The templates specify the layout of the dynamic content stored in EPiServer's database which is editable in the CMS. When a page is loaded, the template requests the data and inserts each part into the relevant position.&lt;br /&gt;&lt;br /&gt;Pages in EPiServer only exist virtually - there is no physical file for their existence. They are simply based on one of the page types and the database keeps a record of any respective data. A single template can be used to create several pages that will all look the same but contain different information. This is a nice feature but what happens if a page is created against template X and we want to use template Y in the future? We asked the same question to an EPiServer specialist who didn't really have an answer. The best he could come up was to update the database manually; in other words - there is no built-in functionality. Below is some SQL that can be run against the EPiServer database in order to modify an existing page's page type:&lt;br /&gt;&lt;pre&gt;declare @PageID int&lt;br /&gt;set @PageID = X&lt;br /&gt; &lt;br /&gt;declare @PageTypeID int&lt;br /&gt;set @PageTypeID = Y&lt;br /&gt; &lt;br /&gt;declare @LinkURL nvarchar( 255 )&lt;br /&gt; &lt;br /&gt;select @LinkURL = [Filename] from tblPageType where pkID = @PageTypeID &lt;br /&gt; &lt;br /&gt;set @LinkURL = @LinkURL + '?id=' + cast( @PageID as nvarchar ) &lt;br /&gt; &lt;br /&gt;update tblPage set fkPageTypeID = @PageTypeID, LinkURL = @LinkURL where pkID = @PageID &lt;br /&gt; &lt;br /&gt;update tblWorkPage set LinkURL = @LinkURL where fkPageID = @PageID&lt;br /&gt; &lt;br /&gt;delete from tblWorkProperty&lt;br /&gt;where fkWorkPageID in ( select pkID from tblWorkPage where fkPageID = @PageID )&lt;/pre&gt;&lt;br /&gt;Simply replace X with the page ID and Y with the page type ID.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-9173362432803349358?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/9173362432803349358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=9173362432803349358' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/9173362432803349358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/9173362432803349358'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/01/change-page-types-in-episerver.html' title='Change Page Types in EPiServer'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-8465296338752784220</id><published>2008-01-07T02:45:00.001-08:00</published><updated>2008-10-14T06:36:02.929-07:00</updated><title type='text'>Hey I'm so cool! I've just signed up for this...</title><content type='html'>&lt;p&gt;Hey I'm so cool! I've just signed up for this great new service from Esendex where I can blog all day long from my mobile phone for free!&lt;/p&gt;&lt;br/&gt;Mobile post from the &lt;a href="http://www.esendex.co.uk/"&gt;Esendex&lt;/a&gt; BlogIt service&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-8465296338752784220?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/8465296338752784220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=8465296338752784220' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/8465296338752784220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/8465296338752784220'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2008/01/hey-i-so-cool-i-just-signed-up-for-this.html' title='Hey I&apos;m so cool! I&apos;ve just signed up for this...'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5339522394737236781</id><published>2007-12-05T01:33:00.000-08:00</published><updated>2008-09-07T03:58:10.467-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wireless gaming adapter'/><category scheme='http://www.blogger.com/atom/ns#' term='belkin'/><title type='text'>Bring back wires</title><content type='html'>Yesterday I spoke about my successful transition from wired to wireless. Today, all is not well - my wireless gaming adapter can't be configured using Windows Vista. Belkin kindly provided me with software for installing the adapter. Unfortunately, Vista can't find the hardware during the setup process but any computer running XP has no problems. After repeatedly configuring it at a friend's house, I now know of a web interface (accessible from Vista :D). I spent about 2 hours speaking to Belkin's support staff trying to get it to work! Hopefully, I can help others who are having similar problems and can't find the solution without spending a ridiculous amount of time on the phone.&lt;br /&gt;&lt;br /&gt;Here are the steps you should follow:&lt;br /&gt;&lt;li&gt;Disconnect from any wired/wireless networks&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Connect the gaming adapter to your PC&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Edit the TCP/IP properties for the Ethernet connection (Local Area Connection) - set the IP address to 192.168.2.100 (try not to conflict with any other network device), set the subnet mask to 255.255.255.0 (default), leave the default gateway blank and obtain the DNS server addresses automatically.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Navigate to &lt;a href="http://192.168.2.225"&gt;http://192.168.2.225&lt;/a&gt; in a web browser - this should load the web interface. From here, you can change the wireless settings such as SSID and encryption type. I'd recommend using WEP encryption although it depends on the router model. Because I have the new Belkin N1 Vision, they claim that is uses an advanced form of WPA encryption not compatible with the gaming adapter. Before you save the changes, make sure the device will obtain an IP address from the DHCP server automatically (there is an option on the same setup page).&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;This is a great solution but why couldn't they include the information in the box!? I only found out after calling their support line - the online help wasn't very impressive.&lt;br /&gt;&lt;br /&gt;The interface is also used to perform firmware updates - something you'll need to do if your network has WPA encryption.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5339522394737236781?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5339522394737236781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5339522394737236781' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5339522394737236781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5339522394737236781'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2007/12/bring-back-wires.html' title='Bring back wires'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3045526102926674752</id><published>2007-12-04T09:02:00.000-08:00</published><updated>2008-09-07T03:57:51.782-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wireless gaming adapter'/><category scheme='http://www.blogger.com/atom/ns#' term='alienware'/><category scheme='http://www.blogger.com/atom/ns#' term='belkin'/><category scheme='http://www.blogger.com/atom/ns#' term='n1 vision'/><category scheme='http://www.blogger.com/atom/ns#' term='nas'/><category scheme='http://www.blogger.com/atom/ns#' term='xbox'/><title type='text'>No more wires</title><content type='html'>After buying a new laptop, a NAS drive and a wireless gaming adapter, I decided to splash out again and increase the performance of my network. Poor transfer rates between the laptop and NAS drive made it almost impossible to utilise it's full potential. &lt;br /&gt;&lt;br /&gt;I always favoured Linksys hardware but I've now converted to using products made by Belkin. I chose the &lt;a href="http://catalog.belkin.com/IWCatProductPage.process?Product_Id=379601"&gt;Belkin N1 Vision&lt;/a&gt; router because it offers up to 300Mbps transfers which is perfect for a network with NAS drives.&lt;br /&gt;&lt;br /&gt;The first stage was the installation of a new internal network card for the laptop. When I bought it, I went for the cheaper alternative which doesn't support the IEEE 802.11n draft specification (something I would later regret). Alienware provided me with the new card (at an additional £30) and &lt;a href="http://4help.alienware.com/cgi-bin/alienware.cfg/php/enduser/std_adp.php?p_faqid=5605"&gt;instructions&lt;/a&gt; for carrying out the upgrade myself.&lt;br /&gt;&lt;br /&gt;The second stage was more simple - setting up the new router. Luckily, the router has a very easy-to-use wizard and it was up and running in no time. I even managed to keep all my old static IP addresses for the laptop, NAS drive and Xbox.&lt;br /&gt;&lt;br /&gt;After only a few minutes, I started to see the difference. I can now transfer high volumes of data in a fraction of the time. I would highly recommend the N1 Vision to anyone looking to increase their network range and speed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3045526102926674752?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3045526102926674752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3045526102926674752' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3045526102926674752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3045526102926674752'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2007/12/no-more-wires.html' title='No more wires'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-1336324879664876913</id><published>2007-12-04T04:52:00.000-08:00</published><updated>2008-09-07T03:57:38.501-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='onclick'/><category scheme='http://www.blogger.com/atom/ns#' term='ghost button'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Ghost button alternative</title><content type='html'>Following on from my previous post about Ghost Buttons, I've now found a much easier and efficient alternative.&lt;br /&gt;&lt;br /&gt;ASP.NET 1.x:&lt;br /&gt;&lt;pre&gt;btnTest.Attributes.Add( "onclick", "javascript:this.disabled = true; " + GetPostBackEventReference( btnTest ) );&lt;/pre&gt;&lt;br /&gt;ASP.NET 2.0:&lt;br /&gt;&lt;pre&gt;btnTest.Attributes.Add( "onclick", string.Format( "javascript:this.disabled = true; {0}", ClientScript.GetPostBackEventReference( btnTest, "" ) ) );&lt;/pre&gt;&lt;br /&gt;Advantages:&lt;br /&gt;&lt;ul style="margin-top: 0;"&gt;&lt;br /&gt;&lt;li&gt;You only need a handle to the control instead of the ID - sometimes these can get complicated if controls are placed inside other controls&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There is less code&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Only a single control is ouputted - this could mean a performance increase compared to using &lt;a href="http://andrewgunn.blogspot.com/2007/12/ghost-buttons.html"&gt;Ghost Buttons&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;Disadvantages:&lt;br /&gt;&lt;ul style="margin-top: 0;"&gt;&lt;br /&gt;&lt;li&gt;The code will need to be recompiled to make any changes to the click event&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-1336324879664876913?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/1336324879664876913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=1336324879664876913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1336324879664876913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/1336324879664876913'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2007/12/ghost-button-alternative.html' title='Ghost button alternative'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-7632574721251680924</id><published>2007-12-04T04:51:00.001-08:00</published><updated>2008-09-07T03:57:16.475-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='disabled'/><category scheme='http://www.blogger.com/atom/ns#' term='ghost button'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='postback'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='button'/><title type='text'>Ghost buttons</title><content type='html'>How do you disable a server-side button after it has been clicked to prevent subsequent clicks whilst the page is doing a postback?&lt;br /&gt;&lt;br /&gt;I'm sure your first response is similar to my initial answer; add the attribute, onclick="this.disabled = true;" to the button. Unfortunately, this can't be applied to a server-side button because it also disables any postback events.&lt;br /&gt;&lt;br /&gt;As a workaround, I added a duplicate HTML button to the page. It is important that the server-side button has an extra attribute; style="display: none;". This prevents it from being rendered to the browser but will still exist in the source code. You may be thinking that Visible="false" would do the same but this prevents the control from creating any output at all. The HTML button is the visible replacement but when clicked, it will trigger the click event of the server-side button or "Ghost Button".&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;input type="button" onclick="this.disabled = true; btnTest.click" value="Test"&gt;&lt;br /&gt;&amp;lt;asp:Button ID="btnTest" runat="server" style="display: none" /&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-7632574721251680924?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/7632574721251680924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=7632574721251680924' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7632574721251680924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/7632574721251680924'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2007/12/ghost-buttons.html' title='Ghost buttons'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-6669984136187905058</id><published>2007-12-04T04:50:00.001-08:00</published><updated>2007-12-04T04:50:37.505-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='aol'/><category scheme='http://www.blogger.com/atom/ns#' term='aol broadband'/><category scheme='http://www.blogger.com/atom/ns#' term='mtu'/><title type='text'>AOL, MTU... WTF???</title><content type='html'>This week I helped a friend install a wireless network in their home using their AOL Broadband connection. They purchased a Belkin ADSL2+ Modem with Wireless-G Router, I configured it using their username and password and enabled wireless security. All seemed well until I got a call a few days later. Their 2 computers both had connections to the internet but they were unable to view certain URLs like Hotmail, MySpace or any of Belkin's websites to get support! Eventually (with help from a friend), I found out that something called MTU was causing the problem. The router's MTU was set to 1342 but for AOL Broadband, it has to be 1450. The MTU can be changed using the router's web interface. For this model, it can be found by going through the steps for setting up the connection type.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-6669984136187905058?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/6669984136187905058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=6669984136187905058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6669984136187905058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/6669984136187905058'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2007/12/aol-mtu-wtf.html' title='AOL, MTU... WTF???'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-4278515891631685435</id><published>2007-12-04T04:49:00.001-08:00</published><updated>2008-09-07T03:54:48.449-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='internet explorer'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><category scheme='http://www.blogger.com/atom/ns#' term='button'/><title type='text'>Form button focus</title><content type='html'>Annoyingly, when a form element gets focus in IE, the respective submit button changes slightly. Combine this with custom styles for buttons and they gain a black border:&lt;br /&gt;&lt;br /&gt;&lt;div style="padding: 10px; background-color: white; text-align: center; width: auto;"&gt;&lt;input style="border: 1px solid red; background-color: red;" value="Click Me" type="button"&gt;&lt;/div&gt;&lt;br /&gt;Any ideas?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-4278515891631685435?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/4278515891631685435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=4278515891631685435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4278515891631685435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/4278515891631685435'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2007/12/form-button-focus.html' title='Form button focus'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-9173970531386067576</id><published>2007-12-04T04:48:00.001-08:00</published><updated>2008-04-09T04:46:47.160-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net form'/><category scheme='http://www.blogger.com/atom/ns#' term='placeholder'/><category scheme='http://www.blogger.com/atom/ns#' term='form button'/><category scheme='http://www.blogger.com/atom/ns#' term='asp:button'/><category scheme='http://www.blogger.com/atom/ns#' term='linkbutton'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='form'/><category scheme='http://www.blogger.com/atom/ns#' term='defaultbutton'/><category scheme='http://www.blogger.com/atom/ns#' term='asp:placeholder'/><category scheme='http://www.blogger.com/atom/ns#' term='asp:linkbutton'/><category scheme='http://www.blogger.com/atom/ns#' term='button'/><title type='text'>DefaultButton</title><content type='html'>When entering data into a web form, users often press the Enter key instead of clicking on a submit button. Classic HTML pages can have multiple forms, each having a separate submit button. This means that when a control gets focus in the first form, the page will automatically trigger the respective event if the user presses the Enter key.&lt;br /&gt;&lt;br /&gt;ASP.NET pages can only contain one server-side Form tag where all server-side controls must be defined. This only becomes a problem when a page requires several form sections. For example, a page might include two form sections; search and log in. If these both have their own submit buttons and are defined in the same server-side Form tag, how does the page know which event should be triggered when the user presses the Enter key? Normally the first button on the page takes precedence or nothing happens at all.&lt;br /&gt;&lt;br /&gt;To assign default buttons to each form section, simply place them (and any other related controls) inside a PlaceHolder control and set the DefaultButton attribute to the respective button ID.&lt;br /&gt;&lt;pre&gt;&amp;lt;asp:Panel DefaultButton="btnSubmit" runat="server"&gt; &lt;br /&gt;    &amp;lt;asp:TextBox ID="tbName" runat="server" /&gt;&lt;br /&gt;    &amp;lt;asp:Button ID="btnSubmit" runat="server" Text="Submit" /&gt;&lt;br /&gt;&amp;lt;/asp:Panel&gt;&lt;/pre&gt;&lt;br /&gt;This rule is not applicable to the LinkButton control (unless in IE).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-9173970531386067576?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/9173970531386067576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=9173970531386067576' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/9173970531386067576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/9173970531386067576'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2007/12/defaultbutton.html' title='DefaultButton'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-5078484757332068688</id><published>2007-11-26T05:33:00.000-08:00</published><updated>2007-11-30T03:29:34.265-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='through the fire and flames'/><category scheme='http://www.blogger.com/atom/ns#' term='guitar hero 3'/><category scheme='http://www.blogger.com/atom/ns#' term='dragonforce'/><category scheme='http://www.blogger.com/atom/ns#' term='rock god'/><category scheme='http://www.blogger.com/atom/ns#' term='sainsburys'/><category scheme='http://www.blogger.com/atom/ns#' term='guitar'/><category scheme='http://www.blogger.com/atom/ns#' term='game'/><title type='text'>Rock God</title><content type='html'>Guitar Hero 3 was a game that never appealed to me which is why I'm so surprised to say that I love it! I only bought it after seeing a very impressive demo in Game whilst on my lunch hour. Ever since, I've been playing it daily - it's even knocked Call Of Duty 4 off the top spot. I paid about £75 for mine but the day atfer I saw it on sale for a reasonable £65 in Sainsburys (just shows what can be saved if you shop around).&lt;br /&gt;&lt;br /&gt;As a noob, I'm slowly working my way up through the medium and hard difficulties. I haven't even attempted a song on expert so I went on YouTube to see if I could find any videos of other people doing them. Sure enough, I found plenty but one stood out from the rest - Through the Fire and Flames by Dragonforce:&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/-9ao_vOsZkg&amp;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/-9ao_vOsZkg&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-5078484757332068688?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/5078484757332068688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=5078484757332068688' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5078484757332068688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/5078484757332068688'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2007/11/rock-god.html' title='Rock God'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4046651698016467102.post-3879958212235932834</id><published>2007-10-04T15:14:00.000-07:00</published><updated>2007-12-05T09:09:54.420-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xbox live'/><category scheme='http://www.blogger.com/atom/ns#' term='wrt54g'/><category scheme='http://www.blogger.com/atom/ns#' term='firmware'/><category scheme='http://www.blogger.com/atom/ns#' term='linksys'/><category scheme='http://www.blogger.com/atom/ns#' term='port forwarding'/><category scheme='http://www.blogger.com/atom/ns#' term='nat settings'/><category scheme='http://www.blogger.com/atom/ns#' term='xbox'/><category scheme='http://www.blogger.com/atom/ns#' term='static ip'/><title type='text'>alterNATe settings</title><content type='html'>&lt;p&gt;Recently, I've been experiencing problems with Xbox LIVE. After talking to a few people with similar issues, I learned that the NAT settings on my router were too high. I'm sure you're asking yourslef the same question as I did; "what the fuck are NAT settings?". Anyway, I still don't know what they are but I do know there is 3 levels; strict, moderate and open. Originally, mine were set to strict which is very bad. The aim was to get them changed to open and enjoy Xbox LIVE again. By following these instructions, you too can get back online - just in time for Halo 3 :D.&lt;/p&gt;&lt;p&gt;These modifications are specific to the Linksys WRT54G v1.1 wireless router although they might also be suitable for other versions and/or models.&lt;/p&gt;&lt;p&gt;Download the latest firmware version from &lt;a href="http://www.linksys.com/"&gt;Linksys&lt;/a&gt; and follow the installation instructions.&lt;/p&gt;&lt;p&gt;Assign the Xbox a static IP address - this should be less than the DHCP starting IP address. Set the subnet mask to 255.255.255.0 and the default gateway to 192.168.1.1 (router's IP address). I'd also recommend manually setting the DNS servers - you can find these on the Status page of the router's setup website (&lt;a href="http://192.168.1.1"&gt;http://192.168.1.1&lt;/a&gt;).&lt;/p&gt;&lt;p&gt;Foward the following ports to the Xbox's static IP address using the router's setup website (Applications &amp;amp; Gaming &gt; Port Range Forward):&lt;/p&gt;&lt;ul&gt;&lt;li&gt;88 - 88 (UDP)&lt;/li&gt;&lt;li&gt;3074 - 3074 (Both)&lt;/li&gt;&lt;li&gt;2869 - 2869 (TCP)&lt;/li&gt;&lt;li&gt;10280 - 10284 (UDP)&lt;/li&gt;&lt;li&gt;1900 - 1900 (UDP)&lt;/li&gt;&lt;li&gt;10243 - 10243 (TCP)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I'd just like to finish with a small moan about Microsoft. I think it was an Xbox LIVE update in September that caused all this fuss. All I know is that everything worked a month ago and my network architecture hasn't changed. Microsoft should have informed Xbox LIVE users of the implications instead of letting them find out for themselves. &lt;p&gt;&lt;/p&gt;&lt;p&gt;If you have a different router, click &lt;a href="http://www.xbox.com/en-US/support/connecttolive/xbox360/homenetworking/equipment.htm"&gt;here&lt;/a&gt; to see whether it's compatible with Xbox LIVE.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4046651698016467102-3879958212235932834?l=andrewgunn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://andrewgunn.blogspot.com/feeds/3879958212235932834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4046651698016467102&amp;postID=3879958212235932834' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3879958212235932834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4046651698016467102/posts/default/3879958212235932834'/><link rel='alternate' type='text/html' href='http://andrewgunn.blogspot.com/2007/10/alternate-solutions.html' title='alterNATe settings'/><author><name>Andrew Gunn</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_B7qeoYf7Cuw/ST5lD8rZJqI/AAAAAAAAABw/2XnOvO7l3Lw/s1600-R/avatarpic-l.png'/></author><thr:total>0</thr:total></entry></feed>
