<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Museum Of Modern Thinking &#187; Development</title>
	<atom:link href="http://www.mkingscott.co.uk/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mkingscott.co.uk</link>
	<description>Observations and rants on driving, politics, games, films, life...</description>
	<lastBuildDate>Tue, 06 Dec 2011 20:00:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>C# LINQ standards for Finding and Getting</title>
		<link>http://www.mkingscott.co.uk/c-linq-standards-for-finding-and-getting/</link>
		<comments>http://www.mkingscott.co.uk/c-linq-standards-for-finding-and-getting/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 19:59:14 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.mkingscott.co.uk/?p=446</guid>
		<description><![CDATA[A bit of a semantics thing here: recently I&#8217;ve been creating a lot of extension methods over using LINQ. I used to call my &#8220;search&#8221; operation GetByID, e.g.: public Person...]]></description>
			<content:encoded><![CDATA[<p>A bit of a semantics thing here: recently I&#8217;ve been creating a lot of extension methods over <code><T></code> using LINQ. I used to call my &#8220;search&#8221; operation <code>GetByID</code>, e.g.:</p>
<p><code>public Person GetByID(this List<Person> persons, personID)<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;return persons.SingleOrDefault(p => p.PersonID == personID)<br />
}</code></p>
<p>However, that then means I need to check for <code>null</code> after calling <code>persons.GetByID(blah)</code>, which seems a bit odd for an explicit <code>Get</code> operation, as in &#8220;I&#8217;m sure this data is in here, if not, than an Exception would be permissible&#8221;.</p>
<p>So, now for extension method LINQ queries that use <code>.SingleOrDefault</code> I use <code>FindByID</code> to remind me to check for null afterwards, and my extension method <code>GetByID</code> now uses the LINQ <code>.Single</code> operator / thingy.</p>
<p>Very quick post, but there ya go <img src='http://www.mkingscott.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mkingscott.co.uk/c-linq-standards-for-finding-and-getting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 or Silverlight &#8211; can&#8217;t I have you both?</title>
		<link>http://www.mkingscott.co.uk/html5-or-silverlight-cant-i-have-you-both/</link>
		<comments>http://www.mkingscott.co.uk/html5-or-silverlight-cant-i-have-you-both/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 23:31:40 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.mkingscott.co.uk/?p=411</guid>
		<description><![CDATA[At work recently, a kindly contractor gave us a demo of what can be achieved in Microsoft&#8217;s Silverlight. The layout XAML seemed simple enough, and the RIA Services made data-binding...]]></description>
			<content:encoded><![CDATA[<p>At work recently, a kindly contractor gave us a demo of what can be achieved in Microsoft&#8217;s Silverlight. The layout XAML seemed simple enough, and the RIA Services made data-binding a snap, it was very impressive.</p>
<p>I have not followed Silverlight that closely, or indeed, at all. It has come on in leaps and bounds and with the advent of Silverlight 5 (debuted at Mix11 I think) adds even more enterprise-level functionality. It is something I will most definitely be investigating for Intranet development and gives me an answer to my recent ponderings of &#8220;what next?&#8221;.</p>
<p>Then I saw Mix11&#8242;s keynote on HTML5 in IE9 on Windows 7 &#8211; holy crap. The FourSquare 80s retro pixel application running natively in the browser (i.e. no plugins) was fantastic, as was the SVG anime that looked like video but was all real-time. I know that other browsers are HTML5 compliant (as much as they can be, it&#8217;s a developing spec), but cripes, it was impressive. In fact, if you have a HTML5 browser (IE9, Chrome, FireFox), get on over to <a href="">The World&#8217;s Biggest Pac-Man</a> site, where there are hundreds of inter-connected Pac-Man mazes to work through &#8211; as you exit the maze from the sides, you automatically go to the next maze.</p>
<p>Sure, it&#8217;s a game, sure it can be done on PC, games consoles, etc., but it&#8217;s running natively in a browser. HTML5 will open up a huge, rich experience on the internet and it&#8217;s also something I must investigate.</p>
<p>So, to sum up, 1 + 1 = 2. Ha. Seriously, I would look to Silverlight for intranet business applications where you can guarantee that the end user will have to install Silverlight, and HTML5 for &#8220;Joe Public&#8221; internet sites. Mind you, if Silverlight continues on its path, it may be shipped as part of the next Windows OS, or a Service Pack, or people will just come to see it as Flash-like, and just install it anyway.</p>
<p>Interesting times <img src='http://www.mkingscott.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Also, can&#8217;t I have you both? I&#8217;d buy that for a dollar!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mkingscott.co.uk/html5-or-silverlight-cant-i-have-you-both/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A programming book? From me? Nah.</title>
		<link>http://www.mkingscott.co.uk/a-programming-book-from-me-nah/</link>
		<comments>http://www.mkingscott.co.uk/a-programming-book-from-me-nah/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 01:24:06 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.mkingscott.co.uk/?p=401</guid>
		<description><![CDATA[Being the wise, old, programming sage that I am (hahahahahaha!), I&#8217;ve built up a set of practices that I use in my development work. Such information has been gleaned from...]]></description>
			<content:encoded><![CDATA[<p>Being the wise, old, programming sage that I am (hahahahahaha!), I&#8217;ve built up a set of practices that I use in my development work. Such information has been gleaned from those old things with pages in, er, books, that&#8217;s it, and some from forums, and some from official guidelines and other official guidelines (it&#8217;s always good to have a choice of standards).</p>
<p>Anyway, I was thinking of collating them into a book, but then realised it would be more of a pamphlet, no-one would buy it, hard work and effort is meant to be free these days (thanks to the internet), etc.</p>
<p>I still might tho&#8217;, as I have a lot of real-world, pragmatic experience on how software development usually happens (badly in most places), and if you are able to introduce your own rules to your own work, it gives the illusion of control. It would be more of a tips book, with things like &#8220;Specs? Hahahaha!&#8221; and &#8220;Tab spacing is your friend&#8221;.</p>
<p>Well, it might help junior developers <img src='http://www.mkingscott.co.uk/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Anyway, it&#8217;s more like a series of blog posts, so I&#8217;ll probably go with that, and then tweet the post URLs accordingly &#8211; stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mkingscott.co.uk/a-programming-book-from-me-nah/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Office-style buttons (accompanying images) with CSS</title>
		<link>http://www.mkingscott.co.uk/office-style-buttons-accompanying-images-with-css/</link>
		<comments>http://www.mkingscott.co.uk/office-style-buttons-accompanying-images-with-css/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 00:37:47 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.mkingscott.co.uk/?p=376</guid>
		<description><![CDATA[Image of what the rest of the post is about: (Excuse the rest of the site / styling, it&#8217;s the ASP.Net default one) Well, I&#8217;ve been meaning to write this...]]></description>
			<content:encoded><![CDATA[<p>Image of what the rest of the post is about:</p>
<p><img src="http://www.mkingscott.co.uk/wp-content/uploads/cssbuttons.png" alt="CSS Buttons" title="CSS Buttons" width="491" height="444" class="alignnone" /></a></p>
<p>(Excuse the rest of the site / styling, it&#8217;s the ASP.Net default one)</p>
<p>Well, I&#8217;ve been meaning to write this post for a while, it&#8217;s another one of my &#8220;if I don&#8217;t write this down somewhere I&#8217;ll forget it&#8221; entries, of which I need to write a couple more, but they can wait.</p>
<p>Please note that this is for ASP.Net web development and CSS (Cascading Style Sheets), so if you&#8217;re expecting some funny clips, film trailers, a sad litany of my latest injuries, or Hungarian donkey porn, you&#8217;ll have to wait <img src='http://www.mkingscott.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>As part of a project I&#8217;m working on, a requirement was to have buttons with small images next to them, similar to the MS Office buttons, or like the links in IE&#8217;s Favorites bar that have the favicon next to them. I seem to recall that you couldn&#8217;t (easily) add an image to a button, so I kinda cheated and used an ASP.Net LinkButtons. These are hyperlinks that can also have server-side events. The styling of the button was what I was after, not the plain text, so I set the LinkButton to render as a button, and added the following style declaration (via the LinkButton&#8217;s CssClass property).</p>
<p><code>&lt;asp:LinkButton runat="server" ID="uxPrevL" CausesValidation="false" <strong>CssClass="button back" </strong>Text="Prev" OnClick="uxPrevB_Click" Visible="false" Width="75px"></asp:LinkButton></code></p>
<p>As you can see, I&#8217;m adding two style classes, <code>button</code> and <code>back</code>. Note that I&#8217;m also setting the width of the button, this can also be done via CSS, or with ASP.Net theming.</p>
<p>Here&#8217;s another button:</p>
<p><code>&lt;asp:LinkButton runat="server" ID="uxNextL" <strong>CssClass="button next"</strong> Text="Next" OnClick="uxNextB_Click"></asp:LinkButton></code></p>
<p>As you can see, the style classes for this button are <code>button</code> and <code>next</code>. Here&#8217;s the style definition for <code>button</code></p>
<p><code>.button<br />
{<br />
    background-color: #ddd;<br />
    background-position: 5% 50%;<br />
    background-repeat: no-repeat;<br />
    border: 2px outset #ddd;<br />
    cursor: pointer;<br />
    display: inline-block;<br />
    margin: 5px;<br />
    padding: 5px 5px 5px 25px;<br />
    text-align: center;<br />
    text-decoration: none;<br />
}</code></p>
<p>As you can see, we&#8217;re setting a few background properties, a border, a handy (ha ha) cursor to illustrate the button is clickable, making the element display as inline-block, setting margins and border and padding, and some text alignment gubbins.</p>
<p>The important part here is the <code>background-position</code> property. Whatever background we place on the button will be position 5% of the width in from the left and 50% vertically, or, technically speaking, nudged in a bit and slapped in the middle. I was slapped in my middle one, I didn&#8217;t like it&#8230;</p>
<p>Ok, let&#8217;s get those images declared &#8211; remember we&#8217;ve got two style classes being applied, so here&#8217;s the necessary declarations:</p>
<p><code>.back<br />
{<br />
    background-image: url('../Images/back.png');<br />
}<br />
.next<br />
{<br />
    background-image: url('../Images/next.png');<br />
}</code></p>
<p>And that&#8217;s basically it &#8211; you just declare the (appropriately sized) images you want to appear on the button and through the CSS magic of &#8220;applying several styles&#8221;, it works &#8211; honest <img src='http://www.mkingscott.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I also changed the color of the button text when the mouse hovers over the button, and gave a faux &#8220;pressed in&#8221; appearance when they button was clicked via the following:</p>
<p><code>.button:hover<br />
{<br />
    color: #000;<br />
}<br />
.button:active<br />
{<br />
    border-style: inset;<br />
}</code></p>
<p>The button was tested in IE7+ (forget you, IE6!) and FF3+, which were our target browsers, and should be ok on Mac browsers as well.</p>
<p>Let me know what you think, if you like <img src='http://www.mkingscott.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mkingscott.co.uk/office-style-buttons-accompanying-images-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A follow up to Where Should I Be?</title>
		<link>http://www.mkingscott.co.uk/a-follow-up-to-where-should-i-be/</link>
		<comments>http://www.mkingscott.co.uk/a-follow-up-to-where-should-i-be/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 23:41:28 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.mkingscott.co.uk/?p=360</guid>
		<description><![CDATA[Reading back on my Where Should I Be post, there was a underlying current to that post. The simple answer to the Where Should I Be question was this: In...]]></description>
			<content:encoded><![CDATA[<p>Reading back on my <a href="./where-should-i-be/">Where Should I Be post</a>, there was a underlying current to that post. The simple answer to the Where Should I Be question was this:</p>
<p><strong>In another company.</strong></p>
<p>It wasn&#8217;t about the development choices (I&#8217;m still doing ASP.Net development and loving it), or learning a few new things (I&#8217;m currently getting to grips with the Telerik ASP.Net AJAX control suite), and working with a great bunch of people. In fact, the development team actually got applauded a last week for a demo; I don&#8217;t think that would have happened at the old place.</p>
<p>Anyway, time for bed, but I really must blog some more as there&#8217;s lots happening in the world that requires my oh-so-important view on it <img src='http://www.mkingscott.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mkingscott.co.uk/a-follow-up-to-where-should-i-be/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>James Hares&#8217; &#8220;5 little wonders&#8221; series for C# / .Net</title>
		<link>http://www.mkingscott.co.uk/james-hares-5-little-wonders-series-for-c-net/</link>
		<comments>http://www.mkingscott.co.uk/james-hares-5-little-wonders-series-for-c-net/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 08:21:26 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.mkingscott.co.uk/?p=320</guid>
		<description><![CDATA[A while ago, Scott Guthrie (Product Manager of the .NET Framework) tweeted a link to James Hare&#8217;s &#8220;C#/.NET Five Little Wonders That Make Code Better (1 of 3)&#8221;. James has...]]></description>
			<content:encoded><![CDATA[<p>A while ago, <a href="http://weblogs.asp.net/scottgu/">Scott Guthrie</a> (Product Manager of the .NET Framework) <a href="http://twitter.com/scottgu">tweeted</a> a link to James Hare&#8217;s &#8220;C#/.NET Five Little Wonders That Make Code Better (1 of 3)&#8221;. James has since published parts 2 and 3, and I provide the links below as a handy reference:</p>
<p><a href="http://geekswithblogs.net/BlackRabbitCoder/archive/2010/08/26/c.net-five-little-wonders-that-make-code-better-1-of.aspx">C#/.NET Five Little Wonders That Make Code Better (1 of 3)</a></p>
<p><a href="http://geekswithblogs.net/BlackRabbitCoder/archive/2010/09/02/c.net-five-more-little-wonders-that-make-code-better-2.aspx">C#/.NET Five Little Wonders That Make Code Better (2 of 3)</a></p>
<p><a href="http://geekswithblogs.net/BlackRabbitCoder/archive/2010/09/09/c.net-five-final-little-wonders-that-make-code-better-3.aspx">C#/.NET Five Little Wonders That Make Code Better (3 of 3)</a></p>
<p>The tips are short, well-written and cover items such as the null coalescing operator, the StopWatch class, object / collection initialisers, a talk on the use of <code>var</code> and (LINQ) extension methods.</p>
<p>Well worth a read <img src='http://www.mkingscott.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mkingscott.co.uk/james-hares-5-little-wonders-series-for-c-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# &#8211; converting an IEnumerable item&#8217;s single property to a CSV</title>
		<link>http://www.mkingscott.co.uk/c-converting-an-ienumerable-items-single-property-to-a-csv/</link>
		<comments>http://www.mkingscott.co.uk/c-converting-an-ienumerable-items-single-property-to-a-csv/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 05:46:50 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.mkingscott.co.uk/?p=276</guid>
		<description><![CDATA[I recently had to extract some items from an IList and pass their Guid identifiers to a legacy SQL Server stored procedure that required a list of comma-separated values. Rather...]]></description>
			<content:encoded><![CDATA[<p>I recently had to extract some items from an <code>IList</code> and pass their Guid identifiers to a legacy SQL Server stored procedure that required a list of comma-separated values.</p>
<p>Rather than loop round the list, appending items to a string with a comma at the end, then stripping the last comma off, or adding the chosen property to a IList<string>, converting it to an array and then String.Join-ing that array, I came up with the following:</p>
<p><code>string divisionsCSV = String.Join(",", ((List<IDivisionView>)divisions).ConvertAll<string>(d => d.DivisionID.ToString("b")).ToArray());</code></p>
<p>(There&#8217;s a casting of <code>divisions</code> to an <code>List&lt;IDivisionView&gt;</code> because a) <code>divisions</code> is an <code>IList</code> and b) <code>ConvertAll</code> is on the concrete implementation of </code>IList</code>)</p>
<p>I'm using <code>ConvertAll</code> to, er, convert a single property of every item in the list, in this case the Guid identifier of the division to a string. Incientally, I'm keeping the Guid parentheses thanks to the "b" parameter of the <code>ToString</code> call. The <code>ToArray</code> call then stuffs it all into an array ready for the <code>String.Join</code> call.</p>
<p>Any thoughts, comments or improvements?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mkingscott.co.uk/c-converting-an-ienumerable-items-single-property-to-a-csv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where should I be?</title>
		<link>http://www.mkingscott.co.uk/where-should-i-be/</link>
		<comments>http://www.mkingscott.co.uk/where-should-i-be/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 00:10:42 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.mkingscott.co.uk/?p=262</guid>
		<description><![CDATA[Not existential angst, but wondering where I need to position myself as a developer. I&#8217;ve missed out on some technologies, and I&#8217;m wondering how far down the rabbit hole I...]]></description>
			<content:encoded><![CDATA[<p>Not existential angst, but wondering where I need to position myself as a developer. I&#8217;ve missed out on some technologies, and I&#8217;m wondering how far down the rabbit hole I should go with some of them.</p>
<p>I&#8217;m still very much a web developer, so I certainly should be looking at ASP.Net MVC and jQuery, as well as upgrading my knowledge in the standard Web Forms, not forgetting the AJAX toolkit as well. Behind the scenes, looking at data storage layers such as LINQ to SQL and their enterprise patter, as well as applicable patterns such as the Repository Pattern and even the Active Record pattern.</p>
<p>That&#8217;s where things get, frankly, a bit dull and convoluted. I read a great post recently about how coding these days is how to link one library to another, or just whack some XML together to control a Spring.Net DI solution. I, like the author, can&#8217;t find the fun in that. Sure, it may get projects done quicker, and it&#8217;s standard, but it can also be a lot of overkill. That&#8217;s why I&#8217;d prefer a simple approach to projects, nice and lightweight, no navel-gazing about what might be required two years down the line, not coding an interface for every single class because &#8220;it&#8217;s the right thing to do&#8221; although it&#8217;ll never be used, adding tests to every single method (even private ones) because &#8220;it&#8217;s the right thing to do&#8221;, etc.</p>
<p>I&#8217;m a firm believer in Jeff Attwood&#8217;s mantra YAGNI &#8211; you ain&#8217;t gonna need it. If the customer hasn&#8217;t asked for it, and if there&#8217;s no chance it will be required within a year or so, don&#8217;t code it. Write your code in such a way that things can be replaced easily (and yes, I guess that does mean some interfaces, but surely not on every single bloody class), and keep it simple. I use as many syntactical shortcuts as I can, as I&#8217;m lazy, but that&#8217;s why they were added to the language.</p>
<p>Anyway, a bit off topic &#8211; I&#8217;m really writing this as a store for where I should be heading. I am a Microsoft chap, and I enjoy the products they put out and their technoology approaches. I find it amusing when I suggest a Microsoft solution (such as ASP.Net&#8217;s Forms Authentication) and am told by a colleague that he&#8217;ll write it themselves &#8211; how many people does Microsoft employ to work on stuff like this? How much R&#038;D do they do? And one person thinks they can do it better? Heh, it&#8217;s another contradiction, I guess &#8211; I said I don&#8217;t like merely linking up one library with another, but I guess you could say that&#8217;s all I&#8217;m doing with the Forms Authentication, but hey, it&#8217;s sometimes a pain to get right and it&#8217;s fun wreslting with it BUT it provides a hell of a lot out of the box&#8230;</p>
<p>And don&#8217;t get me started on form validation &#8211; &#8220;oh, we don&#8217;t use the validation controls because they don&#8217;t work&#8221;. Yeah, ok, I&#8217;ve used them countless times and they seem just dandy.</p>
<p>Gah, back on topic. I really should be looking at what&#8217;s new in Windows Forms and the top best practices in that area as well, and look at Silverlight as well.</p>
<p>Hmmm, lots to cover &#8211; I&#8217;d better get started&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mkingscott.co.uk/where-should-i-be/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PayDate Calculator explained</title>
		<link>http://www.mkingscott.co.uk/paydate-calculator-explained/</link>
		<comments>http://www.mkingscott.co.uk/paydate-calculator-explained/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 21:46:27 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Money]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.mkingscott.co.uk/?p=79</guid>
		<description><![CDATA[Just a quick heads-up, I&#8217;ve added a PayDate Calculator page from which you can download a futility that calculates the number of weeks in a month for budgeting purposes &#8211;...]]></description>
			<content:encoded><![CDATA[<p>Just a quick heads-up, I&#8217;ve added a <a href="http://www.mkingscott.co.uk/paydate-calculator/">PayDate Calculator page</a> from which you can download a futility that calculates the number of weeks in a month for budgeting purposes &#8211; go and try it!</p>
<p>PS: It&#8217;s called a futility because it&#8217;s a 68k application that requires a 22mb Microsoft .Net 2.0 Framework installed <img src='http://www.mkingscott.co.uk/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' />  Still, not a reason to not try it <img src='http://www.mkingscott.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mkingscott.co.uk/paydate-calculator-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net &#8211; confirmation before delete</title>
		<link>http://www.mkingscott.co.uk/aspnet-confirmation-before-delete/</link>
		<comments>http://www.mkingscott.co.uk/aspnet-confirmation-before-delete/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 21:29:12 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.mkingscott.co.uk/aspnet-confirmation-before-delete/</guid>
		<description><![CDATA[I realise this is a bit of a departure from my usual posts (i.e. I&#8217;m not ranting), but I&#8217;d thought I&#8217;d share a rather useful bit of ASP.Net code I&#8217;ve...]]></description>
			<content:encoded><![CDATA[<p>I realise this is a bit of a departure from my usual posts (i.e. I&#8217;m not ranting), but I&#8217;d thought I&#8217;d share a rather useful bit of ASP.Net code I&#8217;ve been using.</p>
<p>When a user is presented with a GridView of data they can delete, it&#8217;s usually a good idea to give them a &#8220;Are you sure?&#8221; confirmation dialog using Javascript, like so:</p>
<p><code>&lt;asp:Button ID="uxDelete" runat="server" Text="Delete" OnClientClick="javascript: return confirm('Are you sure you want to delete this record?');" /&gt;</code></p>
<p>(The above is an ASP button, to be placed in a TemplateField in a GridView)</p>
<p>Now that will give a plain &#8220;Are you sure?&#8221; message, but it&#8217;s a bit vague &#8211; what if the GridView has twenty-five, fifty or one hundred records displayed? Will the user be sure they clicked the right delete button for the right product / entry / whatever?</p>
<p>By some clever use of the Eval statement, the dataitem you want to delete and some character escapes, it&#8217;s possible to put an identifiable piece of data in the Javascript confirm call:</p>
<p><code>&lt;asp:Button ID="uxDelete" runat="server" Text="Delete" OnClientClick='&lt;%# Eval("ProductCode", "javascript: return confirm(\"Are you sure you want to delete {0}?\");") %&gt;' /&gt;</code></p>
<p>Now, when the user clicks delete on an item, the name of the item will appear in the confirm dialog, reinforcing their decision to delete.</p>
<p>Another reason I&#8217;ve blogged this is to have it somewhere where I can always get hold of it &#8211; I don&#8217;t remember stuff as well as I used to <img src='http://www.mkingscott.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mkingscott.co.uk/aspnet-confirmation-before-delete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

