<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Guy Harwood</title><link>https://weblogs.asp.net:443/guyharwood/</link><description>UK based developer</description><item><title>Solution refactoring with NDepend and Resharper</title><link>https://weblogs.asp.net:443/guyharwood/solution-refactoring-with-ndepend-and-resharper</link><description>Recently I've been tackling some improvements to a commercial product that I developed over 6 years ago.
Some of the code I came across wasn't pretty, so I put NDepend and Resharper to task.

&lt;a href="http://www.guyharwood.co.uk/2013/02/solution-review-and-refactoring-with.html" mce_href="http://www.guyharwood.co.uk/2013/02/solution-review-and-refactoring-with.html"&gt;Read the full article on my personal blog&lt;/a&gt;</description><pubDate>Sun, 10 Feb 2013 20:56:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/solution-refactoring-with-ndepend-and-resharper</guid><category>NDepend</category><category>Refactoring</category><category>Resharper</category></item><item><title>CSS Agent for ASP.NET</title><link>https://weblogs.asp.net:443/guyharwood/css-agent-for-asp-net</link><description>&lt;p&gt;Came across this just now via twitter - http://www.keithclark.co.uk/labs/cssagent/&lt;/p&gt;&lt;p&gt;Havent tried it out yet, but sounds promising and very very useful.&lt;/p&gt;&lt;p&gt;Anyone given it a run yet?&lt;br&gt;&lt;/p&gt;</description><pubDate>Mon, 24 Jan 2011 09:37:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/css-agent-for-asp-net</guid></item><item><title>ASP.Net Design Patterns Book Review</title><link>https://weblogs.asp.net:443/guyharwood/asp-net-design-patterns-book-review</link><description>&lt;img src="http://d.sk8loc8.com/designPatterns.jpeg" title="Design Patters Book Cover" alt="Design Patters Book Cover" mce_src="http://www.sk8loc8.com/deposit/designPatterns.jpeg" align="left" height="170" width="134"&gt;
&lt;p&gt;&amp;nbsp;I've had this book for quite some time now and it definitely deserves a long overdue review.&amp;nbsp; I was looking for something that gave an up to date insight on how real applications are built using some of the most popular and proven patterns.&amp;nbsp; There are too many books around that go head first into one specific way of doing things, and it quickly becomes apparent that you cant apply a lot of the techniques to real world situations.&amp;nbsp; This book is not one of those.&amp;nbsp; &lt;/p&gt;&lt;p&gt;Scott provides an introduction to some popular and common design patterns (at which point you will probably find yourself saying 'oh yeah, i used that in &amp;lt;insert your previous project here&amp;gt;'), how they are categorized and most importantly how to read, understand and apply them.&amp;nbsp; He then moves swiftly on to show how these can be used to piece together a rich layered framework on which to build an application.&amp;nbsp; There are various examples of how the various layers interact with each other, all in a very well explained manner, making it easy to understand for developers at any level.&amp;nbsp; &lt;br&gt;&lt;/p&gt;&lt;p&gt;I made the mistake of taking this book into the office, and it has been the source of many conversations since. &lt;/p&gt;&lt;p&gt;Highly recommended. &lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br&gt;&lt;/p&gt;

</description><pubDate>Thu, 20 Jan 2011 12:37:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/asp-net-design-patterns-book-review</guid><category>asp.net</category><category>books</category><category>Design</category></item><item><title>NDepend - Code Analysis and Refactoring</title><link>https://weblogs.asp.net:443/guyharwood/ndepend-code-analysis-and-refactoring</link><description>&lt;p&gt;&lt;a href="http://www.ndepend.com" target="_blank"&gt;NDepend&lt;/a&gt; is a code analysis tool for Visual Studio, allowing you to measure code quality using various techniques included within the software package that plugs quite neatly into Visual Studio.&lt;/p&gt;  &lt;p&gt;&lt;a href="https://aspblogs.blob.core.windows.net/media/guyharwood/Media/NDependBig14_17E9DDAE.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="NDependBig14" border="0" alt="NDependBig14" src="https://aspblogs.blob.core.windows.net/media/guyharwood/Media/NDependBig14_thumb_5F7BB6D5.png" width="244" height="174" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I have been working on a complete refactoring of &lt;a href="http://www.sk8loc8.com/" target="_blank"&gt;www.sk8loc8.com&lt;/a&gt; for the last few months, moving from a somewhat inconsistent Linq2SQL set up to a cleaner stack consisting of view models, UI Service layer, Domain Model and Generic Repository with EF4 sitting underneath it all.&amp;#160; One thing that is never easy is to gain an understanding of just how tied up your code is, and what approach you need to take to clean it all up.&amp;#160; &lt;a href="http://www.jetbrains.com/resharper/" target="_blank"&gt;Resharper&lt;/a&gt; is always my first tool of choice, but what to do when you have some ad-hoc question in your mind about what state of affairs your solution is currently in?&amp;#160; &lt;a href="http://www.ndepend.com" target="_blank"&gt;NDepend&lt;/a&gt; fills this gap rather neatly, allowing you to write custom queries using &lt;a href="http://www.ndepend.com/Features.aspx#CQL" target="_blank"&gt;Code Query Language (CQL)&lt;/a&gt; to shine a light on those dark areas of code within your solution.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="https://aspblogs.blob.core.windows.net/media/guyharwood/Media/NDependBig17_0A73A4DB.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="NDependBig17" border="0" alt="NDependBig17" src="https://aspblogs.blob.core.windows.net/media/guyharwood/Media/NDependBig17_thumb_19C706EA.png" width="223" height="160" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;My favourite part of &lt;a href="http://www.ndepend.com" target="_blank"&gt;NDepend&lt;/a&gt; has to be the &lt;a href="http://www.ndepend.com/Features.aspx#DependenciesView" target="_blank"&gt;dependency Graph&lt;/a&gt;.&amp;#160; It provides a global overview of ‘whos using who’ and is really useful when your trying to break apart that spaghetti mess you promised yourself was just a prototype.&amp;#160; This works hand in hand with the dependency matrix, which is sometimes easier to reference in the muddiest of waters.&lt;/p&gt;  &lt;p&gt;If i were to change one thing about it, it would be to make the initial introduction a little easier.&amp;#160; It can be a touch difficult to get your head around at first, but if you take the time out to watch the introductory video, you will soon be on your feet.&lt;/p&gt;  &lt;p&gt;What are you waiting for?&amp;#160; Get that spaghetti code out and let &lt;a href="http://www.ndepend.com" target="_blank"&gt;NDepend&lt;/a&gt; have it for breakfast.&lt;/p&gt;</description><pubDate>Mon, 15 Nov 2010 20:54:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/ndepend-code-analysis-and-refactoring</guid><category>asp.net</category><category>Code Analysis</category><category>NDepend</category><category>Refactoring</category></item><item><title>The requested operation cannot be performed on a file with a user-mapped section open when performing a subversion commit</title><link>https://weblogs.asp.net:443/guyharwood/the-requested-operation-cannot-be-performed-on-a-file-with-a-user-mapped-section-open-when-performing-a-subversion-commit</link><description>&lt;p&gt;This one has got me a few times.&amp;#160; &lt;/p&gt;  &lt;p&gt;What it means is that the files you are trying to commit are in use by another application OR the repository files at the server end are in use by another application.&lt;/p&gt;  &lt;p&gt;9 times out of 10 that application is your anti virus software.&lt;/p&gt;  &lt;p&gt;Putting a folder exclusion on your anti virus so it doesn't look at your visual studio projects folder or your subversion repositories folder should solve the issue.&lt;/p&gt;  &lt;p&gt;It’s the first thing you should check anyway!&lt;/p&gt;</description><pubDate>Wed, 04 Aug 2010 10:47:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/the-requested-operation-cannot-be-performed-on-a-file-with-a-user-mapped-section-open-when-performing-a-subversion-commit</guid><category>Gotcha</category><category>Source Code Control</category><category>Subversion</category></item><item><title>Application Lifecycle Management with Visual Studio 2010 – Wrox Book</title><link>https://weblogs.asp.net:443/guyharwood/application-lifecycle-management-with-visual-studio-2010-wrox-book</link><description>&lt;p&gt;After running with a somewhat disconnected set of tools (vs 2008, Ontime, sharepoint 2007) for managing our projects we decided to make the move to Team Foundation Server 2010.&amp;#160; With limited coverage of the product available online i went in search of a book and found this…&lt;/p&gt;  &lt;p&gt;&lt;a href="https://aspblogs.blob.core.windows.net/media/guyharwood/Media/0470484268_7B278790.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="0470484268" border="0" alt="0470484268" src="https://aspblogs.blob.core.windows.net/media/guyharwood/Media/0470484268_thumb_46A6B548.jpg" width="104" height="129" /&gt;&lt;/a&gt; &lt;a href="http://www.wrox.com/WileyCDA/WroxTitle/Professional-Application-Lifecycle-Management-with-Visual-Studio-2010.productCd-0470484268.html" target="_blank"&gt;View this book on the Wrox website&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I must point out that i have only read 10 of the 26 chapters so far, mainly the ones that cover source code control, work item tracking and database projects.&amp;#160; This enables our dev team to get familiar with it before switching project management over at a future date.&lt;/p&gt;  &lt;p&gt;Needless to say i am very impressed with the detail it provides, answering pretty much every question i had about TFS so far.&amp;#160; I'm looking forward to digging into the sections on testing, code analysis and architecture.&lt;/p&gt;  &lt;p&gt;Highly recommended.&lt;/p&gt;</description><pubDate>Thu, 10 Jun 2010 13:26:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/application-lifecycle-management-with-visual-studio-2010-wrox-book</guid><category>asp.net</category><category>books</category><category>tfs</category></item><item><title>TinyFluidGrid – a clean and lightweight css framework</title><link>https://weblogs.asp.net:443/guyharwood/tinyfluidgrid-a-clean-and-lightweight-css-framework</link><description>&lt;p&gt;I've been using the &lt;a href="http://960.gs/" target="_blank"&gt;960 Grid system&lt;/a&gt; for a while on some of my &lt;a href="http://www.sk8loc8.com/" target="_blank"&gt;personal projects&lt;/a&gt; and if like me you are no css ninja its convenient for sidestepping the usual nightmare of a good cross browser layout, and allows you to move on to the nitty gritty code and functionality.&lt;/p&gt;  &lt;p&gt;I just stumbled across a new layout generator that looks rather snazzy and has the functionality to back it up.&amp;#160; &lt;a href="http://www.tinyfluidgrid.com/" target="_blank"&gt;TinyFluidGrid&lt;/a&gt; generates exactly that – a tiny fluid grid!&lt;/p&gt;  &lt;p&gt;Worth a look.&lt;/p&gt;</description><pubDate>Thu, 03 Jun 2010 13:42:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/tinyfluidgrid-a-clean-and-lightweight-css-framework</guid><category>asp.net</category><category>css</category><category>html</category><category>links</category></item><item><title>List of Countries in Excel Spreadsheet for Drop Down List</title><link>https://weblogs.asp.net:443/guyharwood/list-of-countries-in-excel-spreadsheet-for-drop-down-list</link><description>&lt;p&gt;Attached to this post is an excel spreadsheet i use for populating drop down lists for choosing countries.&lt;/p&gt;  &lt;p&gt;Personally i prefer to have these in a table, and fill the drop down from there, but i have also included formatted markup for the list items that can be copied directly between the drop down list markup.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/guyharwood/image_10E9A1D4.png" mce_href="https://aspblogs.blob.core.windows.net/media/guyharwood/Media/image_10E9A1D4.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/guyharwood/image_thumb_238E75BE.png" style="border: 0px none; display: inline;" title="image" alt="image" mce_src="https://aspblogs.blob.core.windows.net/media/guyharwood/Media/image_thumb_238E75BE.png" border="0" height="205" width="644"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="/guyharwood/attachment/7471076.ashx" mce_href="/guyharwood/attachment/7471076.ashx"&gt;Download the Excel file here&lt;/a&gt; &lt;br&gt;&lt;/p&gt;</description><pubDate>Wed, 05 May 2010 09:34:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/list-of-countries-in-excel-spreadsheet-for-drop-down-list</guid><category>asp.net</category><category>data</category><category>dropdownlist</category><category>excel</category></item><item><title>IIS7 Failure after installing Advanced Logging</title><link>https://weblogs.asp.net:443/guyharwood/iis7-failure-after-installing-advanced-logging</link><description>&lt;p&gt;I came across a nasty issue when i installed the Advanced Logging feature for IIS7 via the Web Platform Installer on my Windows 2008 Server.&amp;#160; Basically, after installation and reboot none of my sites were working and returned 503 – Internal Server Error.&lt;/p&gt;  &lt;p&gt;Snooping around in the Event Viewer i found the following error reported by the W3SVC…&lt;/p&gt;  &lt;pre&gt;The Module DLL C:\Program Files\IIS\Advanced Logging\AdvancedLoggingModule.dll failed to load.  &lt;/pre&gt;

&lt;pre&gt;The data is the error&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Even though the DLLs are there, it is not picking them up.&lt;/p&gt;

&lt;p&gt;I managed to find a fix via google that involves editing the configapplicationHost.config file in the C:\Windows\System32\inetsrv\ directory.&lt;/p&gt;

&lt;p&gt;1.&amp;#160; Copy AdvancedLoggingModule.dll and ClientLoggingHandler.dll to %windir%\system32 (C:\windows\system32&amp;#160; on a default setup)&lt;/p&gt;

&lt;p&gt;2.&amp;#160; Locate the file C:\Windows\System32\inetsrv\configapplicationHost.config and make a backup, then open it in a text editor (i recommend &lt;a href="http://notepad-plus.sourceforge.net/uk/site.htm" target="_blank"&gt;Notepad++&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;3.&amp;#160; Search for the following 2 lines (mine are located on line 570)..&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre class="csharpcode"&gt;&amp;lt;add name=&lt;span class="str"&gt;&amp;quot;ClientLoggingHandler&amp;quot;&lt;/span&gt; image=&lt;span class="str"&gt;&amp;quot;%ProgramFiles%\IIS\Advanced Logging\ClientLoggingHandler.dll&amp;quot;&lt;/span&gt; /&amp;gt;
&amp;lt;add name=&lt;span class="str"&gt;&amp;quot;AdvancedLoggingModule&amp;quot;&lt;/span&gt; image=&lt;span class="str"&gt;&amp;quot;%ProgramFiles%\IIS\Advanced Logging\AdvancedLoggingModule.dll&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;and alter them to….&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;pre class="csharpcode"&gt;&amp;lt;add name=&lt;span class="str"&gt;&amp;quot;ClientLoggingHandler&amp;quot;&lt;/span&gt; image=&lt;span class="str"&gt;&amp;quot;%windir%\system32\ClientLoggingHandler.dll&amp;quot;&lt;/span&gt; /&amp;gt;
&amp;lt;add name=&lt;span class="str"&gt;&amp;quot;AdvancedLoggingModule&amp;quot;&lt;/span&gt; image=&lt;span class="str"&gt;&amp;quot;%windir%\system32\AdvancedLoggingModule.dll&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;4. Open a command prompt and run iisReset.&lt;/p&gt;

&lt;p&gt;5. All sites should now be working.&lt;/p&gt;
&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;</description><pubDate>Tue, 20 Apr 2010 15:34:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/iis7-failure-after-installing-advanced-logging</guid><category>asp.net</category><category>Gotcha</category><category>iis7</category><category>windows server 2008</category></item><item><title>jTouch - jQuery cheatsheet for your iPhone</title><link>https://weblogs.asp.net:443/guyharwood/jtouch-jquery-cheatsheet-for-your-iphone</link><description>&lt;p&gt;I stumbled across this neat little &lt;a href="http://labs.colorcharge.com/jtouch/" title="Phone app/site" target="_blank" mce_href="http://labs.colorcharge.com/jtouch/"&gt;iPhone app/site&lt;/a&gt; while checking out the &lt;a href="http://nettuts.s3.amazonaws.com/154_cheatsheet/jquery12_colorcharge.png" mce_href="http://nettuts.s3.amazonaws.com/154_cheatsheet/jquery12_colorcharge.png" target="_blank"&gt;jQuery cheatsheet&lt;/a&gt; made available by &lt;a href="http://www.colorcharge.com" mce_href="http://www.colorcharge.com" target="_blank"&gt;colorcharge.com&lt;/a&gt;&lt;/p&gt;
  
&lt;p&gt;Its called jTouch and gives you the jQuery API (currently only v1.2.3) as a nice browsable app on your iPhone...&lt;/p&gt;
  
&lt;p&gt;&lt;a href="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520001_2.png" mce_href="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520001_2.png"&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520001_thumb.png" style="border: 0px none ;" alt="Picture 001" mce_src="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520001_thumb.png" border="0" width="164" height="244"&gt;&lt;/a&gt;&amp;nbsp; &lt;a href="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520002_2.png" mce_href="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520002_2.png"&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520002_thumb.png" style="border: 0px none ;" alt="Picture 002" mce_src="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520002_thumb.png" border="0" width="164" height="244"&gt;&lt;/a&gt;&amp;nbsp; &lt;a href="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520003_2.png" mce_href="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520003_2.png"&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520003_thumb.png" style="border: 0px none ;" alt="Picture 003" mce_src="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/jTouchjQuerycheatsheetforyouriPhone_B622/Picture%2520003_thumb.png" border="0" width="164" height="244"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fweblogs.asp.net%2fguyharwood%2farchive%2f2008%2f12%2f17%2fjtouch-jquery-cheatsheet-for-your-iphone.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fweblogs.asp.net%2fguyharwood%2farchive%2f2008%2f12%2f17%2fjtouch-jquery-cheatsheet-for-your-iphone.aspx" alt="kick it on DotNetKicks.com" border="0"&gt;&lt;/a&gt; &lt;br&gt;&lt;/p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fweblogs.asp.net%2fguyharwood%2farchive%2f2008%2f12%2f17%2fjtouch-jquery-cheatsheet-for-your-iphone.aspx"&gt;&lt;/a&gt;</description><pubDate>Wed, 17 Dec 2008 12:57:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/jtouch-jquery-cheatsheet-for-your-iphone</guid><category>asp.net</category><category>iPhone</category><category>jQuery</category></item><item><title>Toggle items in a CheckBoxList using jQuery</title><link>https://weblogs.asp.net:443/guyharwood/toggle-items-in-a-checkboxlist-using-jquery</link><description>&lt;p&gt;Just a little snippet of jQuery that i find useful for toggling selection of items in an asp.net CheckBoxList control.&lt;/p&gt;
  
&lt;ol&gt;   
&lt;li&gt;Set the CssClass of your CheckBoxList to recipientList &lt;/li&gt;
    
&lt;li&gt;Add a reference in your page/master to jQuery &lt;/li&gt;
    
&lt;li&gt;Add the following javascript into your page header.. &lt;/li&gt;
 &lt;/ol&gt;
  
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; toggleChecks(b) {&lt;br&gt;    $(&lt;span class="str"&gt;".recipientList input[type=checkbox]"&lt;/span&gt;).each(&lt;span class="kwrd"&gt;function&lt;/span&gt;() {&lt;br&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;typeof&lt;/span&gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;.&lt;span class="kwrd"&gt;checked&lt;/span&gt; != &lt;span class="str"&gt;"undefined"&lt;/span&gt;) {&lt;br&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (b == &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;br&gt;                &lt;span class="kwrd"&gt;this&lt;/span&gt;.&lt;span class="kwrd"&gt;checked&lt;/span&gt; = (!&lt;span class="kwrd"&gt;this&lt;/span&gt;.&lt;span class="kwrd"&gt;checked&lt;/span&gt;);&lt;br&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;br&gt;                &lt;span class="kwrd"&gt;this&lt;/span&gt;.&lt;span class="kwrd"&gt;checked&lt;/span&gt; = b;&lt;br&gt;        }&lt;br&gt;    });&lt;br&gt;}&lt;/pre&gt;

&lt;p&gt;Now you can have 3 links/buttons/images alongside your CheckBoxList – One to toggle the checked state of all checkboxes, one to set all checkboxes to checked, and finally one to uncheck all checkboxes.&amp;nbsp; &lt;/p&gt;

&lt;p&gt;Setting the parameter ‘b’ to null means ‘toggle the state’, true = checked and false = unchecked.&lt;/p&gt;

&lt;p&gt;My HTML for the links looks like this…&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="selectAll"&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="selectionToggle"&lt;/span&gt; &lt;span class="attr"&gt;onclick&lt;/span&gt;&lt;span class="kwrd"&gt;="toggleChecks(true);return false;"&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;="#"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Select All&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="selectNone"&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="selectionToggle"&lt;/span&gt; &lt;span class="attr"&gt;onclick&lt;/span&gt;&lt;span class="kwrd"&gt;="toggleChecks(false);return false;"&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;="#"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Select None&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="toggle"&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="selectionToggle"&lt;/span&gt; &lt;span class="attr"&gt;onclick&lt;/span&gt;&lt;span class="kwrd"&gt;="toggleChecks(null);return false;"&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;="#"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Invert Selection&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class="kwrd"&gt;You can very easily wire the Javascript function into a &lt;a href="http://plugins.jquery.com/" mce_href="http://plugins.jquery.com/" target="_blank"&gt;jQuery plugin&lt;/a&gt; for all your projects.&lt;/span&gt;&lt;/p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fweblogs.asp.net%2fguyharwood%2farchive%2f2008%2f11%2f21%2ftoggle-items-in-a-checkboxlist-using-jquery.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fweblogs.asp.net%2fguyharwood%2farchive%2f2008%2f11%2f21%2ftoggle-items-in-a-checkboxlist-using-jquery.aspx" alt="kick it on DotNetKicks.com" border="0"&gt;&lt;/a&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;</description><pubDate>Fri, 21 Nov 2008 09:44:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/toggle-items-in-a-checkboxlist-using-jquery</guid><category>asp.net</category><category>controls</category><category>Javascript</category><category>jQuery</category></item><item><title>ColorPic - nice free tool for developers</title><link>https://weblogs.asp.net:443/guyharwood/colorpic-nice-free-tool-for-developers</link><description>&lt;p&gt;I had to get stuck in to some re-styling of a gridview today and found myself constantly firing up Fireworks and using the Color Palette to tweak the shade and get the hex code (yuck!), after using &lt;a href="http://www.iosart.com/firefox/colorzilla/" target="_blank"&gt;Colorzilla&lt;/a&gt; to extract it from the page i was working on.&lt;/p&gt;  &lt;p&gt;After half an hour of tediousness i found something pretty much straight away via Google (and its free)...&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.iconico.com/colorpic/" target="_blank"&gt;ColorPic from Iconico.com&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/ColorPicnicefreetoolfordevelopers_A5D2/ColorPicSmall_2.gif"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="244" alt="ColorPicSmall" src="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/ColorPicnicefreetoolfordevelopers_A5D2/ColorPicSmall_thumb.gif" width="128" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Nice and easy to use and speeds up the job, hope you find it as useful as i did...&lt;/p&gt;  &lt;p&gt;Taken from &lt;a href="http://www.guyharwood.com/post/ColorPic-Excellent-free-tool-for-Designers-and-Developers.aspx" target="_blank"&gt;my personal blog&lt;/a&gt;&lt;/p&gt;</description><pubDate>Fri, 24 Oct 2008 10:49:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/colorpic-nice-free-tool-for-developers</guid><category>Design</category><category>Dev Tools</category></item><item><title>SEO Manager for ASP.NET - manage your meta tag and sitemap generation from one place</title><link>https://weblogs.asp.net:443/guyharwood/seo-manager-for-asp-net-manage-your-meta-tag-and-sitemap-generation-from-one-place</link><description>&lt;p&gt;When asp.net 2 arrived i was very pleased to see full support included for accessing the head section of a page programmatically.&amp;nbsp; This meant i could now access and add all the meta tag information dynamically.&amp;nbsp; Recently i started looking into dynamic sitemap generation and picked up a wealth of good tips from &lt;a href="http://www.wrox.com/WileyCDA/WroxTitle/productCd-0470131470.html" mce_href="http://www.wrox.com/WileyCDA/WroxTitle/productCd-0470131470.html"&gt;Cristian Darie and Jaimie Sirovichs' excellent book on SEO for Asp.Net&lt;/a&gt; - including a basic implementation of a sitemap http handler.&amp;nbsp; &lt;/p&gt;
  
&lt;p&gt;&amp;nbsp; &lt;br&gt;I decided to blend the management and generation of the meta tags and sitemap into one set of tools that could be easily implemented into any asp.net site.&lt;/p&gt;
  
&lt;p&gt;&lt;b&gt;Screenshot of pageManager.aspx&lt;/b&gt;&lt;/p&gt;
  
&lt;p&gt;&lt;a href="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/ASPMmanageyourmetatagsandsitemapgenerati_86C3/pageManager_2.gif" mce_href="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/ASPMmanageyourmetatagsandsitemapgenerati_86C3/pageManager_2.gif"&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/ASPMmanageyourmetatagsandsitemapgenerati_86C3/pageManager_thumb.gif" style="border-width: 0px;" alt="pageManager.aspx" mce_src="https://aspblogs.blob.core.windows.net/media/guyharwood/WindowsLiveWriter/ASPMmanageyourmetatagsandsitemapgenerati_86C3/pageManager_thumb.gif" border="0" width="604" height="269"&gt;&lt;/a&gt; &lt;/p&gt;
  &lt;h3&gt;How it works&lt;/h3&gt;  
&lt;p&gt;PageManager allows you to add meta tags to pages within your site and specify whether or not the page should be included in the sitemap.&amp;nbsp; This is all stored in a sql server database, and the tables can easily be imported into an existing site.&lt;/p&gt;
  
&lt;p&gt;When a page loads it performs a query against tblPage to see if an entry exists for a page with its name (including any paths after the domain name for uniqueness of course).&amp;nbsp; if it does it then proceeds to load any meta tag data into its header, and a custom page title if one is present.&lt;/p&gt;
  
&lt;p&gt;Sitemap.ashx generates an xml sitemap of all the pages from tblPage flagged as 'include in sitemap' via pageManager.aspx.&amp;nbsp; The sitemap is based on the &lt;a href="http://www.sitemaps.org/" mce_href="http://www.sitemaps.org/" target="_blank"&gt;sitemaps.org standard&lt;/a&gt; , but only includes a minimal amount of information (such as page priority).&amp;nbsp; &lt;/p&gt;
  &lt;h4&gt;&lt;b&gt;But most of my pages are data driven - did you think about that?&lt;/b&gt;&lt;/h4&gt;  
&lt;p&gt;Yes, most of mine are too..&lt;/p&gt;
  
&lt;p&gt;The sitemap generator uses reflection to load a custom class that you create, which implements a single method - returning a custom generated list of sitemap entries&lt;/p&gt;
  
&lt;p&gt;&lt;b&gt;For example...&lt;/b&gt;&lt;/p&gt;
  
&lt;p&gt;lets say you have product.aspx (as included in the example project download below) and it accepts a simple parameter that determines which product to display on the page. such as &lt;b&gt;mysite.com/product.aspx?productID=1544&lt;/b&gt;&lt;/p&gt;
  
&lt;p&gt;Simply create a class that implements ICustomPageInfo and implement its only member - GetCustomPageItems() As List(Of SitemapItem)&lt;/p&gt;
  
&lt;p&gt;The purpose of this function is to return a List of sitemapitems for insertion into the generated sitemap instead of 1 parameterless link to product.aspx.&amp;nbsp; So ideally, you would scan the products table, pick out the product pages you want indexed and return those urls as a list of sitemap items.&lt;/p&gt;
  
&lt;p&gt;The only other thing you have to do is specify the fully qualified name of this class you have created in the 'Custom Call' box in pageManager for the page in question and the sitemap handler will append these to the generated sitemap automatically.&lt;/p&gt;
  
&lt;p&gt;For an example of this, see the ProductSitemapInfo class in the example project download below.&lt;/p&gt;
  
&lt;p&gt;I have already set this up in the attached mdf example database.&lt;/p&gt;
  &lt;h4&gt;&lt;b&gt;But what about specific meta tags for these data driven pages?&lt;/b&gt;&lt;/h4&gt;  
&lt;p&gt;I implement these at product level within the system, so the user adding/editing the product would insert a heap of keywords specific to the product in question.&amp;nbsp;&amp;nbsp; When that product is loaded into product.aspx i populate the keywords and description meta tags from the product record in the database, essentially overriding the insertion at basepage level from tag data specified in pageManager.&amp;nbsp; You can easily extend this by creating a 'populate_header' event in the basepage, subscribing to this at page level and inserting your custom keywords/tags right there and then.&amp;nbsp; &lt;/p&gt;
  
&lt;p&gt;This is how i do it in some of the sites i have developed.&lt;/p&gt;
  &lt;h4&gt;&lt;b&gt;But i dont use Query strings in my pages?&lt;/b&gt;&lt;/h4&gt;  
&lt;p&gt;If you understand how this works then surely you can work out the rest yourself :-P&lt;/p&gt;
  &lt;h3&gt;The Contents of the example project&lt;/h3&gt;  
&lt;p&gt;admin/pageManager.aspx - where you set what pages to include in the sitemap and what meta tags to pump into each page you want indexing.&lt;/p&gt;
  
&lt;p&gt;App_Data/pageManager.mdf - the database used as an example (includes the products table from Northwind :-P )&lt;/p&gt;
  
&lt;p&gt;code/basepage.vb - you may have one already - so do i.&amp;nbsp; This just contains the basic hook into the page_load event to populate the necessary meta tag information and title - if found in the database.&lt;/p&gt;
  
&lt;p&gt;code/db.vb - database access code, just to save you the time of rolling your own if you choose to download the demo project and want to run it.&lt;/p&gt;
  
&lt;p&gt;code/ICustomPageInfo.vb - an interface to allow multiple sitemap url generation for data driven pages (explanation below)&lt;/p&gt;
  
&lt;p&gt;code/PageInfo.vb - a helper class for the page data, quite basic but easily extended.&amp;nbsp; I will no doubt rewrite this based around LINQ very soon (time permitting :-S)&lt;/p&gt;
  
&lt;p&gt;code/ProductSitemapInfo.vb - an example implementation of ICustomPageInfo for the product.aspx page &lt;/p&gt;
  
&lt;p&gt;code/siteMapItem.vb - simple helper object that holds sitemap url information&lt;/p&gt;
  
&lt;p&gt;code/util.vb - just some utility functions for generic stuff like web.config access etc...&lt;/p&gt;
  
&lt;p&gt;default.aspx - do i really have to explain this one? :-P&lt;/p&gt;
  
&lt;p&gt;product.aspx - a data driven page that shows an individual product based on the id passed in via query string.&lt;/p&gt;
  
&lt;p&gt;siteMap.ashx - the http handler that returns the xml sitemap.&lt;/p&gt;
  &lt;h3&gt;Its Basic&lt;/h3&gt;  
&lt;p&gt;Yes, there are quite a lot of things that can be done to extend this, some of which i have already done and used in live sites, for example....&lt;/p&gt;
  
&lt;p&gt;Create a specific basepage method that can be overridden to allow extra tags/keywords to be appended/inserted at page level&lt;/p&gt;
  
&lt;p&gt;use LINQ to query the aspx pages that populate the treeview in pageManager.aspx (not really necessary but hey its new!)&lt;/p&gt;
  
&lt;p&gt;Use caching to store specific page tags after first retrieval.&lt;/p&gt;
  
&lt;p&gt;The gridview for adding metatags is pretty mediocre, but serves as an example, ok? :-P&lt;/p&gt;
  
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
  
&lt;p&gt;I hope you find this tool to be beneficial like i have.&amp;nbsp; &lt;/p&gt;
  
&lt;p&gt;The core of it is currently in use on live sites that rank well in their area, and it saves a lot of manual work when we need to modify our keywords and add pages to the sitemap.&lt;/p&gt;
  
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fweblogs.asp.net%2fguyharwood%2farchive%2f2008%2f04%2f24%2fseo-manager-for-asp-net-manage-your-meta-tag-and-sitemap-generation-from-one-place.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fweblogs.asp.net%2fguyharwood%2farchive%2f2008%2f04%2f24%2fseo-manager-for-asp-net-manage-your-meta-tag-and-sitemap-generation-from-one-place.aspx&amp;amp;bgcolor=0099FF" alt="kick it on DotNetKicks.com" border="0"&gt;&lt;/a&gt;&lt;/p&gt;
  &lt;h4&gt;&lt;b&gt;Download&lt;/b&gt;&lt;/h4&gt;
&lt;p&gt;Both versions come with a populated database dumped from SQL Server 2000, and
also a create database script if you want to start from scratch.&amp;nbsp; The
tblProduct table comes directly from Northwind.&amp;nbsp;
  
 &lt;br&gt;&lt;/p&gt;
  
&lt;p&gt;&lt;a href="http://www.mrbaldman.co.uk/files/pagemanager.rar" mce_href="http://www.mrbaldman.co.uk/files/pagemanager.rar" target="_blank"&gt;Vs2008 .Net 3.5 in Visual Basic.NET Download&lt;/a&gt;&lt;br&gt; &lt;/p&gt;
&lt;a href="http://www.mrbaldman.co.uk/files/pagemanagerCS.rar" mce_href="http://www.mrbaldman.co.uk/files/pagemanagerCS.rar" target="_blank"&gt;Vs2008 .Net 3.5 in C# Download &lt;/a&gt;
&lt;p&gt;note - some of the directory parsing code originates from &lt;a href="http://aspnet.4guysfromrolla.com/articles/083006-1.aspx" mce_href="http://aspnet.4guysfromrolla.com/articles/083006-1.aspx" target="_blank"&gt;this post by Scott Mitchell&lt;/a&gt;&lt;/p&gt;
</description><pubDate>Thu, 24 Apr 2008 15:33:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/seo-manager-for-asp-net-manage-your-meta-tag-and-sitemap-generation-from-one-place</guid><category>meta tags</category><category>reflection</category><category>seo</category><category>sitemaps</category></item><item><title>Dispose your DataContext After use</title><link>https://weblogs.asp.net:443/guyharwood/dispose-your-datacontext-after-use</link><description>&lt;p&gt;This is my first blog post on here, so Hello from me.&amp;nbsp; &lt;/p&gt;
  
&lt;p&gt;Rather than just have a meaningless 'hello' first post, i thought i would at least post something useful (albeit rather small)..&lt;/p&gt;
  
&lt;p&gt;With all the talk of LINQ at the moment there are a lot of examples popping up on sites and most of them follow this kind of format...&lt;/p&gt;
  &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:9f38c03c-f32e-4c74-9759-cff0f5fc48c8" style="margin: 0px; padding: 0px; display: inline; float: none;"&gt;
&lt;pre style="overflow: auto; background-color: White;"&gt;&lt;div&gt;&lt;!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;myDbDataContext ctx &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; myDbDataContext(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;connectionString&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br&gt;&lt;br&gt;var query &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; from.... &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;great LINQ example etc...&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;oh, wait, no disposal of my data context?&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;When i first started learning LINQ I was pretty curious as to why most examples do not offer some kind of indication that disposal is required.&amp;nbsp; Maybe because that is exactly what they are - examples.&amp;nbsp; Regardless, i have always disposed my dataContext objects, usually taken care of automatically by wrapping them in a &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2354870&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2354870&amp;amp;SiteID=1" target="_blank"&gt;using block&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It is advised on various sites, as pointed out in &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2354870&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2354870&amp;amp;SiteID=1" target="_blank"&gt;this MSDN forum post&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;I am currently preparing a rather long post on SEO management for Asp.Net and hope to have that up soon.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.feedburner.com/GuyHarwood" rel="alternate" type="application/rss+xml"&gt;&lt;img src="http://www.feedburner.com/fb/images/pub/feed-icon32x32.png" alt="" style="border: 0pt none ; vertical-align: middle;"&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://feeds.feedburner.com/GuyHarwood" rel="alternate" type="application/rss+xml"&gt;Subscribe in a reader&lt;/a&gt;&lt;/p&gt;
</description><pubDate>Wed, 23 Apr 2008 13:09:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/guyharwood/dispose-your-datacontext-after-use</guid><category>DataContext</category><category>Dispose</category><category>LINQ</category></item></channel></rss>