<?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-4228744319574131817</id><updated>2012-01-26T06:41:03.914-08:00</updated><category term='LINQ'/><category term='Visual Studio'/><category term='NMock'/><category term='Lucene'/><category term='SQL'/><category term='Email'/><category term='authentication'/><category term='Accessibility'/><category term='TFS'/><category term='Troubleshooting'/><category term='funnies'/><category term='MVP'/><category term='Web.config'/><category term='Tips'/><category term='Sitecore'/><category term='IIS'/><category term='TechEd'/><category term='validation'/><category term='ASP.NET'/><category term='Testing'/><category term='C#'/><category term='CruiseControl.NET'/><category term='Xml'/><category term='off-topic'/><category term='SMTP'/><category term='Xslt'/><category term='Screen readers'/><category term='Lambda'/><category term='regular expressions'/><category term='IE'/><category term='XHTML'/><category term='XML Web services'/><category term='JavaScript'/><category term='.NET'/><category term='Best practice'/><title type='text'>Neil Pullinger's .NET Blog</title><subtitle type='html'>ASP.NET, Visual Studio, C#, Sitecore Content Management System</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>74</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-3142259969038247180</id><published>2011-07-13T06:36:00.000-07:00</published><updated>2011-07-13T06:42:49.645-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene'/><title type='text'>Lucene: Compression support not configured</title><content type='html'>I got this error when trying to extract Hits.Doc from Lucene:&lt;br /&gt;&lt;br /&gt;Compression support not configured&lt;br /&gt;&lt;br /&gt;&lt;span class="wiki javaExceptionFirstLine"&gt; &lt;b&gt;at&lt;/b&gt; SupportClass.CompressionSupport.CheckCompressionSupport()&lt;br /&gt;&lt;b&gt;at&lt;/b&gt; SupportClass.CompressionSupport.Uncompress(Byte[] input)&lt;br /&gt;&lt;b&gt;at&lt;/b&gt; Lucene.Net.Index.FieldsReader.Uncompress(Byte[] input)&lt;br /&gt;&lt;b&gt;at&lt;/b&gt; Lucene.Net.Index.FieldsReader.AddField(Document doc, FieldInfo fi, Boolean binary, Boolean compressed, Boolean tokenize)&lt;br /&gt;&lt;b&gt;at&lt;/b&gt; Lucene.Net.Index.FieldsReader.Doc(Int32 n, FieldSelector fieldSelector)&lt;br /&gt;&lt;b&gt;at&lt;/b&gt; Lucene.Net.Index.SegmentReader.Document(Int32 n, FieldSelector fieldSelector)&lt;br /&gt;&lt;b&gt;at&lt;/b&gt; Lucene.Net.Index.IndexReader.Document(Int32 n)&lt;br /&gt;&lt;b&gt;at&lt;/b&gt; Lucene.Net.Search.IndexSearcher.Doc(Int32 i)&lt;br /&gt;&lt;b&gt;at&lt;/b&gt; Lucene.Net.Search.Hits.Doc(Int32 n)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The solution was to add the following missing keys into Sitecore AppSettings.config:&lt;br /&gt;&lt;br /&gt;&amp;lt;add key="Lucene.Net.FSDirectory.class" value="Sitecore.Data.Indexing.FSDirectory, Sitecore.Kernel" /&amp;gt;&lt;br /&gt;&amp;lt;add key="Lucene.Net.CompressionLib.class" value="Sitecore.IO.Compression, Sitecore.Kernel" /&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-3142259969038247180?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3142259969038247180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3142259969038247180' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3142259969038247180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3142259969038247180'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2011/07/lucene-compression-support-not.html' title='Lucene: Compression support not configured'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-8469138683736052961</id><published>2011-05-17T04:59:00.000-07:00</published><updated>2011-05-17T05:03:36.159-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.</title><content type='html'>I get this error from time to time when editing plain text files in Visual Studio. I tried correcting it by going to File, Save As, Save with Encoding (in the Save dropdown). This seemed to do the trick about 50% of the time. However, it would seem this was just coincidence. Latest findings suggest it is a Firefox cache problem. I tried the same URL in another browser and it worked. Fingers crossed this is a fix.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-8469138683736052961?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/8469138683736052961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=8469138683736052961' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8469138683736052961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8469138683736052961'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2011/05/page-you-are-trying-to-view-cannot-be.html' title='The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-7542353845438363278</id><published>2011-01-14T03:18:00.001-08:00</published><updated>2011-01-14T03:22:42.629-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Xml'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>Non white space characters cannot  be added to content.</title><content type='html'>When trying to initialise an XDocument with a string containing XML, I kept getting the error:&lt;br /&gt;&lt;br /&gt;Unhandled Exception: System.ArgumentException: Non white space characters cannot be added to content.&lt;br /&gt;&lt;br /&gt;With help from a &lt;a href="http://gokulives.com/"&gt;colleague&lt;/a&gt;, and recalling how I'd got around this error previously, the solution is to use the static XDocument.Parse( string ) method. Eg:&lt;br /&gt;&lt;br /&gt;var myXDoc = XDocument.Parse( xmlString );&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-7542353845438363278?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/7542353845438363278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=7542353845438363278' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7542353845438363278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7542353845438363278'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2011/01/non-white-space-characters-cannot-be.html' title='Non white space characters cannot  be added to content.'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-4574328924630248533</id><published>2010-12-01T04:33:00.000-08:00</published><updated>2010-12-09T03:16:02.946-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='XML Web services'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>SOAP header Security was not understood</title><content type='html'>XML Web services seem to be declining in use, so finding information on this SoapHeaderException proved to be a bit difficult. I added in &amp;lt;soapextensionimportertypes&amp;gt; and installed WSE 3.0, but it made no difference. What worked for me was adding the following line to my code:&lt;br /&gt;&lt;pre&gt;webService.SoapVersion =&lt;br /&gt;System.Web.Services.Protocols.SoapProtocolVersion.Soap12;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;[Edit 9 Dec 2010]&lt;br /&gt;&lt;br /&gt;Actually, this was a red herring. It worked by adding a "service reference", rather than a old-fashioned "web reference".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-4574328924630248533?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/4574328924630248533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=4574328924630248533' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4574328924630248533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4574328924630248533'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2010/12/soap-header-security-was-not-understood.html' title='SOAP header Security was not understood'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-5046883715220083118</id><published>2010-08-18T07:25:00.000-07:00</published><updated>2010-08-18T07:29:38.112-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Using Sitecore with Firefox, Chrome and other browsers</title><content type='html'>Sitecore recommends the use of IE for its client. When trying to log in with Firefox or Chrome (and presumably others), you don't get the option of viewing the desktop. There is a way you can override this behaviour. Open Sitecore in IE and go to the User Manager. Select your account and click Edit to bring up the "Edit User" dialogue. Click on the Profile tab and set the start URL to "Desktop". Save your changes and then try logging in with Firefox, etc. You should now see the full desktop.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-5046883715220083118?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/5046883715220083118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=5046883715220083118' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5046883715220083118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5046883715220083118'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2010/08/using-sitecore-with-firefox-chrome-and.html' title='Using Sitecore with Firefox, Chrome and other browsers'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-3390343038295533749</id><published>2010-06-15T06:48:00.000-07:00</published><updated>2010-06-15T06:53:12.199-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Xslt'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Sitecore link fields put /home in the target URL's href</title><content type='html'>When using sc:fld('fieldname', ., 'url') in an XSLT rendering to get a link field's target URL, you will find that the href includes '/home'. This is rarely desirable. Thankfully, it's easy to solve. Simply use sc:fld('fieldname', ., 'id') instead to get the target ID. You can then pass the ID to sc:path().&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-3390343038295533749?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3390343038295533749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3390343038295533749' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3390343038295533749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3390343038295533749'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2010/06/sitecore-link-fields-put-home-in-target.html' title='Sitecore link fields put /home in the target URL&apos;s href'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-3020971459744215547</id><published>2010-03-23T06:24:00.000-07:00</published><updated>2010-03-23T06:28:23.253-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Xslt'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>How to remove an apostrophe from a string in Sitecore XSLT</title><content type='html'>Given a variable named "string", you can remove apostrophes by declaring a variable to hold the apostrophe and then passing that to the sc:Replace method:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;xsl:variable name="apos"&amp;gt;'&amp;lt;/xsl:variable&amp;gt;&lt;br /&gt;&amp;lt;xsl:variable name="string"&lt;br /&gt;select="sc:Replace( $input, $apos, '' )" /&amp;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/4228744319574131817-3020971459744215547?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3020971459744215547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3020971459744215547' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3020971459744215547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3020971459744215547'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2010/03/how-to-remove-apostrophe-from-string-in.html' title='How to remove an apostrophe from a string in Sitecore XSLT'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-9037220986983797013</id><published>2009-11-17T00:32:00.000-08:00</published><updated>2009-11-17T00:40:24.363-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TFS'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>The solution is offline because its associated Team Foundation Server is offline</title><content type='html'>When opening a solution in Visual Studio 2008, I kept getting the following message in the Output window:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;This solution is offline.  [Team Foundation Server:&lt;br /&gt;http://server:8080/]&lt;br /&gt;The solution is offline because its associated&lt;br /&gt;Team Foundation Server is offline.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I kept having to go into the "change source control" and re-bind the solution. After a while, this began to get annoying. Then I found this post: http://www.eggheadcafe.com/software/aspnet/33487526/connecting-automatically.aspx. It turned out the solution was to set some registry keys. I navigated to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\Servers\&lt;tfs server name&gt; and changed "Offline" to 0 and "AutoReconnect" to 1. I've no idea how these got reset! (Please back-up your registry first if you want to try the same.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-9037220986983797013?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/9037220986983797013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=9037220986983797013' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/9037220986983797013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/9037220986983797013'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/11/solution-is-offline-because-its.html' title='The solution is offline because its associated Team Foundation Server is offline'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-2829466461808170605</id><published>2009-11-13T02:43:00.000-08:00</published><updated>2009-11-13T02:47:42.203-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>System.ArgumentException: Illegal characters in path</title><content type='html'>This exception caused me a headache for an hour today on a development web site. After various rebuilds failed to cure the issue, I found out that the aspnet_wp.exe process had somehow become corrupted. Re-saves of the web.config file didn't help, so I opened Task Manager, killed the process and was back up and working again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-2829466461808170605?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/2829466461808170605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=2829466461808170605' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2829466461808170605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2829466461808170605'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/11/systemargumentexception-illegal.html' title='System.ArgumentException: Illegal characters in path'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-3424652153982951477</id><published>2009-10-28T04:40:00.000-07:00</published><updated>2009-10-28T04:46:40.598-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Get a list of all Sitecore Items tagged with specific multilist items</title><content type='html'>If you wish to return all items in the content tree that have been tagged with a specific multilist item, you might be tempted to use Sitecore.Context.Database.SelectSingleItem(), passing it an XPath query. The problem with this is that performance degrades as the content tree grows. A far more efficient way is to use the GetReferrers method of the LinkDatabase class as shown below:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Database db = Sitecore.Context.ContentDatabase;&lt;br /&gt;&lt;br /&gt;LinkDatabase linkDb = Globals.LinkDatabase;&lt;br /&gt;&lt;br /&gt;// lookupItem is the multilist item&lt;br /&gt;ItemLink[] links = linkDb.GetReferrers( lookupItem );&lt;br /&gt;&lt;br /&gt;foreach( ItemLink link in links )&lt;br /&gt;{&lt;br /&gt;  Item linkedItem = db.Items[link.SourceItemID];&lt;br /&gt;  // Process item...&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/4228744319574131817-3424652153982951477?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3424652153982951477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3424652153982951477' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3424652153982951477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3424652153982951477'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/10/get-list-of-all-sitecore-items-tagged.html' title='Get a list of all Sitecore Items tagged with specific multilist items'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-8858013379770494965</id><published>2009-10-12T04:59:00.000-07:00</published><updated>2009-10-12T05:04:24.461-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Example Useful C# Extension Functions</title><content type='html'>Here are a few extension functions that I find useful:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        public static bool IsNullOrEmpty(&lt;br /&gt;        this string expression )&lt;br /&gt;        {&lt;br /&gt;            bool result = string.IsNullOrEmpty(&lt;br /&gt;            expression );&lt;br /&gt;            return result;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public static string ToFormat(&lt;br /&gt;        this string expression, params object[] args )&lt;br /&gt;        {&lt;br /&gt;            string result = String.Format(&lt;br /&gt;            expression, args );&lt;br /&gt;            return result;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public static bool IsValidEmailAddress(&lt;br /&gt;        this string expression )&lt;br /&gt;        {&lt;br /&gt;            bool result = BaseRegexHelper.IsValid(&lt;br /&gt;            expression, emailRegex );&lt;br /&gt;            return result;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public static bool IsValidGuid(&lt;br /&gt;        this string expression )&lt;br /&gt;        {&lt;br /&gt;            bool result = BaseRegexHelper.IsValid(&lt;br /&gt;            expression, guidRegex );&lt;br /&gt;            return result;&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The latter two functions call this method:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        public static bool IsValid(&lt;br /&gt;        string input, string pattern )&lt;br /&gt;        {&lt;br /&gt;            bool isValid = false;&lt;br /&gt;&lt;br /&gt;            if( input != null )&lt;br /&gt;            {&lt;br /&gt;                string trimmedExpression =&lt;br /&gt;                input.Trim();&lt;br /&gt;&lt;br /&gt;                if( trimmedExpression.Length &gt; 0 )&lt;br /&gt;                {&lt;br /&gt;                    Regex regexGuid = new Regex(&lt;br /&gt;                    pattern, RegexOptions.IgnoreCase );&lt;br /&gt;                    isValid = regexGuid.IsMatch(&lt;br /&gt;                    trimmedExpression );&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            return isValid;&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/4228744319574131817-8858013379770494965?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/8858013379770494965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=8858013379770494965' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8858013379770494965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8858013379770494965'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/10/example-useful-c-extension-functions.html' title='Example Useful C# Extension Functions'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-445439400454122762</id><published>2009-08-14T05:07:00.000-07:00</published><updated>2009-08-14T05:21:25.963-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Xslt'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Write to Sitecore log file from XSLT</title><content type='html'>It is simple to write to the Sitecore log file from within an XSLT file without having to write any custom code. We can just hook up to the Sitecore.Diagnostics.Log class and call one of its methods.&lt;br /&gt;&lt;br /&gt;In the web.config, define the extension under &amp;lt;xslextensions&amp;gt;:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;extension mode="on"&lt;br /&gt;type="Sitecore.Diagnostics.Log, Sitecore.Kernel"&lt;br /&gt;namespace="http://www.sitecore.net/log"&lt;br /&gt;singleInstance="true" /&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Within the XSLT file, add a prefix that matches the namespace you used in the above step:&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:stylesheet version="1.0"&lt;br /&gt;xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&lt;br /&gt;xmlns:sc="http://www.sitecore.net/scReal"&lt;br /&gt;xmlns:dot="http://www.sitecore.net/dot"&lt;br /&gt;xmlns:log="http://www.sitecore.net/log"&lt;br /&gt;exclude-result-prefixes="dot sc log"&amp;gt;&lt;br /&gt;&lt;br /&gt;The Log class contains a number of overloads for Info, Warn, Error and so on. Some of these expect an exception as a parameter, so we cannot call these direct from XSLT. We can, however match the overloads that expect a string and an object (eg. Warn( String, Object )):&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:value-of select="log:Warn('Warning message', 'Another string... perhaps the name of your rendering file')" /&amp;gt;&lt;br /&gt;&lt;br /&gt;That's it! Now you can log whatever you like from within your renderings.&lt;/xslextensions&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-445439400454122762?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/445439400454122762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=445439400454122762' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/445439400454122762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/445439400454122762'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/08/write-to-sitecore-log-file-from-xslt.html' title='Write to Sitecore log file from XSLT'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-4375203212740395587</id><published>2009-08-06T04:36:00.000-07:00</published><updated>2009-08-06T04:44:56.915-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Xml'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Lambda'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Using Linq lambda expressions to retrieve XML elements based on the value of an attribute</title><content type='html'>The following example program loads an XML file, then selects all the elements named "field" within it. It then uses a lambda expression to get the inner text of the "alternativeTitle" element.&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;          XDocument xd = XDocument.Load( "..\\..\\file.xml" );&lt;br /&gt;&lt;br /&gt;          var fields = from el in xd.Descendants()&lt;br /&gt;                       where el.Name.ToString().StartsWith( "field" )&lt;br /&gt;                       select el;&lt;br /&gt;&lt;br /&gt;          Console.WriteLine( GetElementValue(fields, "alternativeTitle") );&lt;br /&gt;          Console.ReadLine();&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      static string GetElementValue( IEnumerable&amp;lt;XElement&amp;gt; elements, string attributeName )&lt;br /&gt;      {&lt;br /&gt;          return elements.Single( p =&amp;gt; p.Attributes().Single( q =&amp;gt; q.Name == "name" ).Value == attributeName ).Value;&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;The XML file used in the example is as follows:&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;add&amp;gt;&lt;br /&gt;&amp;lt;doc&amp;gt;&lt;br /&gt;  &amp;lt;field name="id"&amp;gt;some_id&amp;lt;/field&amp;gt;&lt;br /&gt;  &amp;lt;field name="readableid"&amp;gt;interesting_publications&amp;lt;/field&amp;gt;&lt;br /&gt;  &amp;lt;field name="name"&amp;gt;Interesting Publications&amp;lt;/field&amp;gt;&lt;br /&gt;  &amp;lt;field name="alternativeTitle"&amp;gt;Online publications&amp;lt;/field&amp;gt;&lt;br /&gt;&amp;lt;/doc&amp;gt;&lt;br /&gt;&amp;lt;/add&amp;gt;&lt;br /&gt;&lt;br /&gt;The program outputs the text:&lt;br /&gt;&lt;br /&gt;Online publications&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-4375203212740395587?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/4375203212740395587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=4375203212740395587' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4375203212740395587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4375203212740395587'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/08/using-linq-lambda-expressions-to.html' title='Using Linq lambda expressions to retrieve XML elements based on the value of an attribute'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-7564906727068963752</id><published>2009-07-28T03:51:00.000-07:00</published><updated>2009-07-28T04:03:47.989-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Xslt'/><title type='text'>Enable XSLT IntelliSense within Visual Studio</title><content type='html'>Wouldn't it be nice to have Visual Studio list the available template names when typing out a call-template statement in XSLT? Wouldn't it also be nice to have it list available parameter names when typing out a with-param statement?&lt;br /&gt;&lt;br /&gt;To enable these autocompletions and more, you need to back up your registry and then run regedit. Within regedit, create a string value called "XsltIntellisense" under "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\XmlEditor" key, giving it the value "True". That's it!&lt;br /&gt;&lt;br /&gt;Ultimately, I'd like to see full IntelliSense for XSLT in Visual Studio, but this is a good start.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-7564906727068963752?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/7564906727068963752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=7564906727068963752' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7564906727068963752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7564906727068963752'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/07/enable-xslt-intellisense-within-visual.html' title='Enable XSLT IntelliSense within Visual Studio'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-1594834486426039220</id><published>2009-07-28T03:17:00.000-07:00</published><updated>2009-07-28T03:19:47.679-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>The type initializer for 'Sitecore.Search.SearchManager' threw an exception</title><content type='html'>If you get this (or similar) error, check that the version of the Sitecore.Kernel.dll referenced by class libraries is the same as used by the web site. It fixed a problem I had anyway!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-1594834486426039220?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/1594834486426039220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=1594834486426039220' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1594834486426039220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1594834486426039220'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/07/type-initializer-for.html' title='The type initializer for &apos;Sitecore.Search.SearchManager&apos; threw an exception'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-2519376705088107426</id><published>2009-07-14T08:20:00.000-07:00</published><updated>2009-07-14T08:23:18.346-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Accessibility'/><title type='text'>ASP.NET Accessibility Top Ten</title><content type='html'>Here are my top ten tips for designing accessible ASP.NET sites. These are based on my understanding and opinion. If I am radically wrong about any of these, please feel free to correct me by leaving a comment.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Always set the display of validation controls to ‘dynamic’&lt;br /&gt;&lt;/span&gt;In this way, screen readers ignore the text of the error message when there is no error.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Do not use image buttons&lt;/span&gt;&lt;br /&gt;They are invisible to screen readers. Use a button with a background image instead.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Do not use AutoPostBack&lt;/span&gt;&lt;br /&gt;They are impossible to navigate using a keyboard.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Do not use separator characters between links&lt;/span&gt;&lt;br /&gt;Characters in breadcrumbs, footers, etc. are read out by screen readers. Use a span instead with a style instead. Or better still, use a bulleted list with a background image.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Display sets of results or links in a bulleted list&lt;/span&gt;&lt;br /&gt;In a landing page or search results page, having each result marked up as a bullet makes it easier to navigate between results.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Insert hidden header text at the start of every navigation list&lt;/span&gt;&lt;br /&gt;Screen reader users can navigate by headers and choose to skip the navigation lists.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Surround the individual digits in telephone numbers with span tags&lt;/span&gt;&lt;br /&gt;Otherwise, the whole number will be read out as a single value.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Use hidden images with pagination and other non-descriptive hyperlinks&lt;/span&gt;&lt;br /&gt;If pagination links are in the format: 1 | 2 | 3, a screen reader will read the links as ‘link 1’, ‘link 2’ and so on. So, insert a hidden image that has the alt text set to something more descriptive.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Include file sizes and types in hyperlink text&lt;/span&gt;&lt;br /&gt;Unwittingly clicking a link to a file attachment can cause confusion.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Don’t bother using access keys&lt;/span&gt;&lt;br /&gt;They are device-dependent, they can conflict with other shortcut keys and there is no standardisation as to what each key combination should do. Better to have clear navigation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-2519376705088107426?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/2519376705088107426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=2519376705088107426' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2519376705088107426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2519376705088107426'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/07/aspnet-accessibility-top-ten.html' title='ASP.NET Accessibility Top Ten'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-9013616557910414358</id><published>2009-07-14T03:17:00.000-07:00</published><updated>2009-07-14T03:52:30.324-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Using a Clean Sitecore Client for Authoring</title><content type='html'>I had a situation this week where I could not get the Sitecore client to work on my local machine. Although I could browse the end web site, I got the dreaded vague null reference exception when trying to browse to /sitecore. As the web site was fairly complex, I was finding it very painful to try to re-contruct from new. In the end, it dawned on me that all I needed to do was install a clean Sitecore client that was completely separate from the web site. This gave me the ability to change content, while the end web site enabled me to view the effect of code changes. This set-up has other benefits too; the Sitecore client runs unimpeded by any custom code  (unless you are using pipelines, etc.). This makes it easier to identify/eliminate custom code as a possible cause for any slowness. Similarly, you can readily identify if any errors in the log are due to your code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-9013616557910414358?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/9013616557910414358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=9013616557910414358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/9013616557910414358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/9013616557910414358'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/07/using-clean-sitecore-client-for.html' title='Using a Clean Sitecore Client for Authoring'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-8128770198220527706</id><published>2009-07-09T00:54:00.000-07:00</published><updated>2009-07-09T01:00:50.535-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Value cannot be null</title><content type='html'>When trying to open the Sitecore client (ie. by putting /sitecore in the URL), I got the following exception:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Exception: System.ArgumentNullException&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Message: Value cannot be null.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Parameter name: item&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Source: Sitecore.Kernel&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at Sitecore.Web.UI.HtmlControls.Menu.AddFromDataSource(Item item, String target)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at Sitecore.Web.UI.HtmlControls.DataContextMenu.OnLoad(EventArgs e)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Control.LoadRecursive()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I noticed that the URL had changed to /sitecore/shell&lt;br /&gt;&lt;br /&gt;With so few clues as to the cause, I simply entered the full path to the log-in screen (/sitecore/login). The log-in screen loaded and I was able to log in successfully.&lt;br /&gt;&lt;br /&gt;Out of curiosity, I logged out again and then re-tried /sitecore on its own. The log-in screen opened OK that time. I've no idea as to the cause and I don't fancy investigating. If you're having the same problem, why not try what I did? Good luck.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-8128770198220527706?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/8128770198220527706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=8128770198220527706' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8128770198220527706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8128770198220527706'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/07/value-cannot-be-null.html' title='Value cannot be null'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-1435927552217185090</id><published>2009-07-08T02:35:00.000-07:00</published><updated>2009-07-08T03:03:37.377-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Web.config'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Save Settings to Web.Config file</title><content type='html'>Here's a quick snippet showing how to save a setting back to the web.config file. You are best wrapping this block in a try/catch in case the ASPNET user (or equivalent) does not have write access permissions to the file.&lt;br /&gt;&lt;br /&gt;Configuration config = WebConfigurationManager.OpenWebConfiguration( "~/" );&lt;br /&gt;AppSettingsSection appSettings = config.GetSection( "appSettings" ) as AppSettingsSection;&lt;br /&gt;&lt;br /&gt;if ( appSettings != null )&lt;br /&gt;{&lt;br /&gt; if ( appSettings.Settings ["mySetting"] != null )&lt;br /&gt; {&lt;br /&gt;   appSettings.Settings.Remove( "mySetting" );&lt;br /&gt; }&lt;br /&gt; appSettings.Settings.Add( "mySetting", text );&lt;br /&gt;}&lt;br /&gt;config.Save( ConfigurationSaveMode.Modified );&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-1435927552217185090?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/1435927552217185090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=1435927552217185090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1435927552217185090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1435927552217185090'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/07/save-settings-to-webconfig-file.html' title='Save Settings to Web.Config file'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-4610109496658140970</id><published>2009-04-15T04:09:00.000-07:00</published><updated>2009-04-15T04:15:17.932-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SqlParameter is Already Contained in Another SqlParameterCollection</title><content type='html'>This exception occurred between calls to a method I used to populate a SqlCommand object.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SqlCommand cmd = conn.CreateCommand();&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;foreach (SqlParameter sqlParameter in sqlParameters)&lt;br /&gt;{&lt;br /&gt;    cmd.Parameters.Add(sqlParameter );&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The solution was to clear the parameter collection at the end of the method (in a finally block, actually):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cmd.Parameters.Clear();&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/4228744319574131817-4610109496658140970?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/4610109496658140970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=4610109496658140970' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4610109496658140970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4610109496658140970'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/04/sqlparameter-is-already-contained-in.html' title='SqlParameter is Already Contained in Another SqlParameterCollection'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-9121693011584542715</id><published>2009-04-09T00:30:00.000-07:00</published><updated>2009-04-09T00:39:41.796-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>Button click event handler fires twice</title><content type='html'>I had a simple button on a form together with its click event handler. On debugging, I noticed that the event handler was firing twice. After a long investigation, I decided to check the HTTP headers. These revealed that the "Display Page Validation" option I was using in the Tools menu of the Web Dev toolbar in Firefox was the culprit.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1QQHTld1anE/Sd2lVZ7ZqtI/AAAAAAAAAC0/-HSG8ZkB8o8/s1600-h/validationtoolbar.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 43px;" src="http://2.bp.blogspot.com/_1QQHTld1anE/Sd2lVZ7ZqtI/AAAAAAAAAC0/-HSG8ZkB8o8/s320/validationtoolbar.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5322592121777662674" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;When switched on, this runs the handler a second time, submitting the results to a validator at w3.org. This is something to bear in mind, particularly for code that must only run once, such as handling credit card payments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-9121693011584542715?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/9121693011584542715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=9121693011584542715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/9121693011584542715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/9121693011584542715'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/04/button-click-event-handler-fires-twice.html' title='Button click event handler fires twice'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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://2.bp.blogspot.com/_1QQHTld1anE/Sd2lVZ7ZqtI/AAAAAAAAAC0/-HSG8ZkB8o8/s72-c/validationtoolbar.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-8104731383598874565</id><published>2009-01-16T06:14:00.000-08:00</published><updated>2009-01-16T06:34:27.370-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Accessibility'/><title type='text'>Accessible print-friendly web pages</title><content type='html'>There are times when you might want to render a page specifically for printing (rather than using CSS). For example you might want to include or exclude specific information on the printed page. When users view the print-friendly page, you might want to include some instructions at the top of the page, but not have these themselves print out. You might want to let users know they are viewing a print-friendly version and provide them with a link back to the on-screen view.&lt;br /&gt;&lt;br /&gt;You can do this by first defining a &amp;ldquo;noprint&amp;rdquo; class:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    &amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;        @media print&lt;br /&gt;        {&lt;br /&gt;            .noprint&lt;br /&gt;            {&lt;br /&gt;                display: none;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    &amp;lt;/style&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can then include your instructions in a DIV having this class.&lt;br /&gt;&lt;br /&gt;Typically, the next action a user will take on viewing the page is to open the print dialogue box. We could attach a &amp;ldquo;window.print()&amp;rdquo; JavaScript action to the body&amp;rsquo;s onload event, or within a &amp;lt;script&amp;gt; tag somewhere in the body. However, having a dialogue box appear automatically is not particularly accessible as it changes the focus. The alternative is to insert a &amp;ldquo;print this page&amp;rdquo; link if the browser supports JavaScript. For non-JavaScript browsers, simply inform the user to use his or her browser&amp;rsquo;s print menu. This is demonstrated by the following HTML:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    &amp;lt;div class="noprint" style="background-color: #eeeeee;&lt;br /&gt;border: solid 1px black; padding: 10px 10px 10px 10px;"&amp;gt;&lt;br /&gt;        &amp;lt;p&amp;gt;&lt;br /&gt;            You are viewing a print-friendly version&lt;br /&gt; of a page.&amp;lt;/p&amp;gt;&lt;br /&gt;        &amp;lt;p&amp;gt;&lt;br /&gt;&lt;br /&gt;            &amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;                var str = "Print this page";&lt;br /&gt;                document.write(&lt;br /&gt;str.link("javascript:window.print()"));&lt;br /&gt;            &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;/p&amp;gt;&lt;br /&gt;        &amp;lt;noscript&amp;gt;&lt;br /&gt;            &amp;lt;p&amp;gt;&lt;br /&gt;                Please select print from your browser&amp;rsquo;s&lt;br /&gt;menu to print the page&amp;lt;/p&amp;gt;&lt;br /&gt;        &amp;lt;/noscript&amp;gt;&lt;br /&gt;        &amp;lt;p&amp;gt;&lt;br /&gt;            or &amp;lt;a href="/path/file.htm"&amp;gt;&lt;br /&gt;return to the normal on-screen view of the page&lt;br /&gt;            &amp;lt;/a&amp;gt;&lt;br /&gt;        &amp;lt;/p&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;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/4228744319574131817-8104731383598874565?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/8104731383598874565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=8104731383598874565' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8104731383598874565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8104731383598874565'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/01/accessible-print-friendly-web-pages.html' title='Accessible print-friendly web pages'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-6740075816561702426</id><published>2009-01-16T05:45:00.000-08:00</published><updated>2009-01-16T06:04:18.945-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Screen readers'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Accessibility'/><category scheme='http://www.blogger.com/atom/ns#' term='Xslt'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Screen reader friendly phone numbers</title><content type='html'>When you display a telephone number on screen, screen readers read it out as a single number. The Fangs screen reader emulator (see http://sourceforge.net/projects/fangs) reads the number (01234) 567890 as &amp;ldquo;left paren six hundred sixty-eight right paren five hundred sixty-seven thousand eight hundred ninety&amp;rdquo;. The &amp;ldquo;six hundred sixty-eight&amp;rdquo; bit is particularly curious: the 01234 is being interpreted as an octal number.&lt;br /&gt;&lt;br /&gt;By encasing each digit within a &amp;lt;span /&amp;gt; tag, the digits are read out individually. So, (01234) 567890 becomes &amp;ldquo;left paren zero one two three four right paren five six seven eight nine zero&amp;rdquo;.&lt;br /&gt;&lt;br /&gt;I have written an XSLT template that takes a phone number and applies a &amp;lt;span /&amp;gt; to each digit:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  &amp;lt;xsl:template name="DisplayPhoneNumber"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:param name="position" /&amp;gt;&lt;br /&gt;    &amp;lt;xsl:param name="phonenumber" /&amp;gt;&lt;br /&gt;    &amp;lt;xsl:variable name="digit"&lt;br /&gt;select="substring($phonenumber, $position, 1)" /&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;      &amp;lt;xsl:when test="contains('012345678', $digit)"&amp;gt;&lt;br /&gt;        &amp;lt;span&amp;gt;&lt;br /&gt;          &amp;lt;xsl:value-of select="$digit" /&amp;gt;&lt;br /&gt;        &amp;lt;/span&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:when&amp;gt;&lt;br /&gt;      &amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;        &amp;lt;xsl:value-of select="$digit" /&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;xsl:if test="$position &amp;amp;lt;&lt;br /&gt;string-length($phonenumber)"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:call-template name="DisplayPhoneNumber"&amp;gt;&lt;br /&gt;        &amp;lt;xsl:with-param name="position"&amp;gt;&lt;br /&gt;          &amp;lt;xsl:value-of select="$position+1" /&amp;gt;&lt;br /&gt;        &amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;        &amp;lt;xsl:with-param name="phonenumber"&lt;br /&gt;select="$phonenumber" /&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:if&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To call the template, pass in the telephone number and prime the starting position using a value of 1:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;      &amp;lt;xsl:call-template name="DisplayPhoneNumber"&amp;gt;&lt;br /&gt;        &amp;lt;xsl:with-param name="position" select="'1'" /&amp;gt;&lt;br /&gt;        &amp;lt;xsl:with-param name="phonenumber"&lt;br /&gt;select="'(01234) 567890'" /&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you&amp;rsquo;re using this within Sitecore, you can simply pass in a field value in the usual way:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;      &amp;lt;xsl:call-template name="DisplayPhoneNumber"&amp;gt;&lt;br /&gt;        &amp;lt;xsl:with-param name="position" select="'1'" /&amp;gt;&lt;br /&gt;        &amp;lt;xsl:with-param name="phonenumber"&lt;br /&gt;select="sc:fld('phone', .)" /&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:call-template&amp;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/4228744319574131817-6740075816561702426?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/6740075816561702426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=6740075816561702426' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6740075816561702426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6740075816561702426'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2009/01/screen-reader-friendly-phone-numbers.html' title='Screen reader friendly phone numbers'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-5592416020076937520</id><published>2008-12-19T03:44:00.000-08:00</published><updated>2008-12-19T03:48:33.667-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>Loading this assembly would produce a different grant set from other instances</title><content type='html'>If you get this exception message when trying to browse an ASP.NET site you are developing, first stop the site in IIS, then clear out the ASP.NET Temporary Files folder that relate to your site (default location is under C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files). Then start IIS and try browsing the site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-5592416020076937520?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/5592416020076937520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=5592416020076937520' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5592416020076937520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5592416020076937520'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/12/loading-this-assembly-would-produce.html' title='Loading this assembly would produce a different grant set from other instances'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-9082072863130070424</id><published>2008-12-19T03:35:00.000-08:00</published><updated>2008-12-19T03:41:45.236-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><title type='text'>Localhost on IIS7</title><content type='html'>By default, browsing to localhost on IIS7 brings up a welcome screen. To associate localhost with a particular web site, right-click the web site in IIS7 and select "Edit Bindings" (or just "Bindings", depending on which pane you were in when you right-clicked; IIS is still as inconsistent as ever!). In the "Add Site Binding" dialogue box, add localhost as a host name. Apply the changes. You will now be able to browse to localhost.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-9082072863130070424?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/9082072863130070424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=9082072863130070424' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/9082072863130070424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/9082072863130070424'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/12/localhost-on-iis7.html' title='Localhost on IIS7'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-790377997023407404</id><published>2008-12-18T03:22:00.000-08:00</published><updated>2008-12-19T13:28:17.467-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio External Tools Menu</title><content type='html'>Further to my post about setting up Windows Explorer as an external tool within Visual Studio (http://www.neilpullinger.co.uk/2008/03/open-visual-studio-project-folder-in.html), I have set up a number of other tools set up in the same way. Here's my list now:&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Title&lt;/th&gt;&lt;th&gt;Command&lt;/th&gt;&lt;th&gt;Arguments&lt;/th&gt;&lt;th&gt;Notes&lt;/th&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Run test&lt;/td&gt;&lt;td&gt;(full path to nunit.exe)&lt;/td&gt;&lt;td&gt;$(ItemPath)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Reflector&lt;/td&gt;&lt;td&gt;(full path to reflector.exe)&lt;/td&gt;&lt;td&gt;$(ItemPath)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;FxCop&lt;/td&gt;&lt;td&gt;(full path to fxcop.exe)&lt;/td&gt;&lt;td&gt;$(TargetPath)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Explorer&lt;/td&gt;&lt;td&gt;(full path to explorer.exe)&lt;/td&gt;&lt;td&gt;/e, /select, $(ItemPath)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Open in Notepad&lt;/td&gt;&lt;td&gt;(full path to notepad.exe)&lt;/td&gt;&lt;td&gt;$(ItemPath)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Open&lt;/td&gt;&lt;td&gt;(full path to a batch file containing just "%1")&lt;/td&gt;&lt;td&gt;$(ItemPath)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Error Lookup&lt;/td&gt;&lt;td&gt;(errlook.exe, in VS\Common\Tools folder)&lt;/td&gt;&lt;td&gt;(none)&lt;/td&gt;&lt;td&gt;Not sure where this one came from; installed by default?&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;Spy++&lt;/td&gt;&lt;td&gt;(spyxx.exe, in VS\Common\Tools folder)&lt;/td&gt;&lt;td&gt;(none)&lt;/td&gt;&lt;td&gt;Installed by default&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;I've excluded a couple of the others that are there by default (eg. Create Guid and Dotfuscator).&lt;br /&gt;&lt;br /&gt;(Edited 19/12/2008)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-790377997023407404?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/790377997023407404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=790377997023407404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/790377997023407404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/790377997023407404'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/12/further-to-my-post-about-setting-up.html' title='Visual Studio External Tools Menu'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-5044724489062299486</id><published>2008-10-14T00:55:00.000-07:00</published><updated>2008-10-14T01:50:02.594-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Best practice'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Always set AutoPage to true in LinqDataSource</title><content type='html'>If you are binding a control to a LinqDataSource, always set the AutoPage property on the LinqDataSource to true (AutoPage=&amp;ldquo;true&amp;rdquo;) if you have enabled paging on the data-bound control. Without the AutoPage option set, the LinqDataSource will pull back all records in the data source every time a page is browsed. Not only is this inefficient and not scalable, but it allows the client to determine the level of resources required, which is not good practice.&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:LinqDataSource ID="LinqDataSource1" runat="server"&lt;br /&gt;ContextTypeName="MyDataContext" TableName="MyTable" AutoPage="true"&amp;gt;&amp;lt;/asp:LinqDataSource&amp;gt;&lt;br /&gt;&lt;br /&gt;Sadly, the AutoPage option doesn’t seem to be available in other DataSource objects, so a manual implementation is necessary for these.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-5044724489062299486?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/5044724489062299486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=5044724489062299486' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5044724489062299486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5044724489062299486'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/10/always-set-autopage-to-true-in.html' title='Always set AutoPage to true in LinqDataSource'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-9198342603701360080</id><published>2008-09-04T05:58:00.000-07:00</published><updated>2008-09-04T06:28:54.821-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='validation'/><title type='text'>CustomValidator does not fire</title><content type='html'>Recently, I needed to ensure that a user fill in one of two TextBox controls on a form I was designing. I couldn't use two RequiredFieldValidator controls as that would mandate that both fields be completed. I therefore created a CustomValidator control and added it to the page. It did not work. There was a flaw in my thinking. The control did not ever fire when needed (ie. when both fields are blank), because the control does not, by default, validate blank fields. Thankfully, there is a way to change this. You can set the ValidateEmptyText to true:&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:CustomValidator ID="myValidator" runat="server" ErrorMessage="Error message" OnServerValidate="myValidator_ServerValidate ValidateEmptyText="true"&amp;gt;&amp;lt;/asp:CustomValidator&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-9198342603701360080?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/9198342603701360080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=9198342603701360080' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/9198342603701360080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/9198342603701360080'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/09/customvalidator-does-not-fire.html' title='CustomValidator does not fire'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-3449019335666918442</id><published>2008-09-03T08:24:00.000-07:00</published><updated>2008-09-03T08:28:38.120-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='off-topic'/><title type='text'>Windows does not shut down</title><content type='html'>Slightly off-topic, but if your computer does not respond to an ordinary shutdown command, you can force a shutdown. To do this, select Start, Shutdown in the usual way and, as you click OK, hold down the control key. Use with care as this might terminate processes uncleanly. Always back up your data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-3449019335666918442?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3449019335666918442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3449019335666918442' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3449019335666918442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3449019335666918442'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/09/windows-does-not-shut-down.html' title='Windows does not shut down'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-1732171237089066241</id><published>2008-08-21T01:08:00.000-07:00</published><updated>2008-08-21T01:19:56.352-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='NMock'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>FindControl Causes Null Reference Exception with NMock</title><content type='html'>When using NMock on code that uses FindControl, a null reference exception is thrown:&lt;br /&gt;&lt;p class="MsoNormal"  style="font-family:courier new;"&gt;&lt;span style=""&gt;PlaceHolder placeHolder =&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style="font-family:courier new;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-family:courier new;" &gt;PlaceHolder&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;) _view.MyPanel.FindControl(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-family:courier new;" &gt;"myplaceholder"&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;You could use the indexer instead:&lt;br /&gt;&lt;p class="MsoNormal"  style="font-family:courier new;"&gt;&lt;span style=""&gt;PlaceHolder placeHolder =&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style="font-family:courier new;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-family:courier new;" &gt;PlaceHolder&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;) _view.MyPanel.Controls[0];&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; But if you insert another control in the panel, you break your code. So, the alternative is to loop through the controls and find a match by ID:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;ControlCollection ctrls = _view.MyPanel.Controls;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;foreach( Control ctrl in ctrls )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    if( ctrl.ID == "myplaceholder" )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        placeHolder = (PlaceHolder) ctrl;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-1732171237089066241?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/1732171237089066241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=1732171237089066241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1732171237089066241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1732171237089066241'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/08/findcontrol-causes-null-reference.html' title='FindControl Causes Null Reference Exception with NMock'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-3145179880401121542</id><published>2008-08-02T07:25:00.000-07:00</published><updated>2008-08-02T07:39:41.966-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CruiseControl.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>CruiseControl builds not working</title><content type='html'>Here's a quick checklist to assist in getting failed builds working again in &lt;a href="http://ccnet.thoughtworks.com/"&gt;CruiseControl.NET&lt;/a&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Comment out any custom tasks, such as running unit tests, in the ccnet config file (defined within &amp;lt;exec&amp;gt; elements)&lt;/li&gt;&lt;li&gt;Find error details quickly within the build log by searching for the following words/phrases:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;could not&lt;br /&gt;&lt;/li&gt;&lt;li&gt;failed&lt;br /&gt;&lt;/li&gt;&lt;li&gt;success="false"&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Check whether the code compiled without error by:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Running the project's team build as used by CCNET&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Searching for "csc" (or "vbc") in the build log&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Clear out temporary files on the build server to remove any sticky references&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/4228744319574131817-3145179880401121542?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3145179880401121542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3145179880401121542' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3145179880401121542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3145179880401121542'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/08/cruisecontrol-builds-not-working.html' title='CruiseControl builds not working'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-2546161287860907063</id><published>2008-07-23T13:02:00.000-07:00</published><updated>2008-07-23T13:05:57.496-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TechEd'/><title type='text'>TechEd Video</title><content type='html'>I recently discovered &lt;a href="http://animoto.com"&gt;Animoto&lt;/a&gt;, so here's a quick video of my time at &lt;a href="http://www.neilpullinger.co.uk/2007/11/reflections-of-week-at-tech-ed.html"&gt;TechEd&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript" src="http://widgets.clearspring.com/o/46928cc51133af17/48878e31c62d964a/46928cc5788deb29/75ac05a6/widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-2546161287860907063?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/2546161287860907063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=2546161287860907063' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2546161287860907063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2546161287860907063'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/07/teched-video.html' title='TechEd Video'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-7185570411467877803</id><published>2008-07-18T06:30:00.000-07:00</published><updated>2008-07-18T06:46:08.001-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Could not find property 'Name' on object of type: Sitecore.Data.SqlServer.SqlServerDataProvider</title><content type='html'>This week, I branched a solution in TFS and checked out the branch. It built successfully. I then added virtual directories in IIS to point at the locations of the app_config, sitecore, sitecore modules and data folders (I move these outside of the web site root for easier swappability and source control). On browsing to the site, I got the message:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Could not find property 'Name' on object of type: Sitecore.Data.SqlServer.SqlServerDataProvider&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It took a while to figure out that this was due to the assemblies in source control being out of date. Once I'd copied the contents of the bin folder on the live web server to my local machine, I was able to browse the site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-7185570411467877803?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/7185570411467877803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=7185570411467877803' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7185570411467877803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7185570411467877803'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/07/could-not-find-property-name-on-object.html' title='Could not find property &apos;Name&apos; on object of type: Sitecore.Data.SqlServer.SqlServerDataProvider'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-4179462701129980646</id><published>2008-07-08T03:02:00.001-07:00</published><updated>2008-07-08T03:24:12.259-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>Creation of the virtual directory http://localhost/ failed</title><content type='html'>On attempting to check out a project in VS2008, I got the following message:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The local IIS URL http://localhost/ specified for Web project DemoWebsite has not been configured. In order to open this project the virtual directory needs to be configured. Would you like to create the virtual directory now?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;On clicking yes, I got the following error:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Creation of the virtual directory http://localhost/ failed with the error: The URL 'http://localhost/' is already mapped to a different folder location.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The rest of the solution checked out all right, but the above project did not; it was marked as unavailable. I right-clicked the project node in the solution explorer and selected the option to edit the project (.csproj) file. Near the bottom of the file, I found the following:&lt;br /&gt;&lt;br /&gt;&amp;lt;iisurl&amp;gt;http://localhost/&amp;lt;/iisurl&amp;gt;&lt;br /&gt;&lt;br /&gt;I edited this entry to add a virtual directory:&lt;br /&gt;&lt;br /&gt;&amp;lt;iisurl&amp;gt;http://localhost/myapp&amp;lt;/iisurl&amp;gt;&lt;br /&gt;&lt;br /&gt;Having saved the change, I then right-clicked the project node in the solution explorer again and reloaded the project. When I was prompted to create the virtual directory again, the creation was successful and the project checked out. The virtual directory is created under the running web site in IIS (on Windows XP).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-4179462701129980646?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/4179462701129980646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=4179462701129980646' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4179462701129980646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4179462701129980646'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/07/creation-of-virtual-directory.html' title='Creation of the virtual directory http://localhost/ failed'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-8969880729773415076</id><published>2008-06-12T01:27:00.000-07:00</published><updated>2008-10-08T01:00:11.226-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='funnies'/><category scheme='http://www.blogger.com/atom/ns#' term='off-topic'/><title type='text'>Songs and bands likely to appeal to IT nerds</title><content type='html'>This list was compiled with the "help" of colleagues. Feel free to add to these bad puns.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Motley Cruise Control&lt;/li&gt;&lt;li&gt;Status Disk Quota&lt;/li&gt;&lt;li&gt;Visio Killed the Radio Star (by De-Buggles)&lt;/li&gt;&lt;li&gt;Iron Python Maiden&lt;/li&gt;&lt;li&gt;The Google Dolls&lt;/li&gt;&lt;li&gt;USB-40&lt;/li&gt;&lt;li&gt;InXSlt&lt;/li&gt;&lt;li&gt;Fleetwood (Apple) Mac&lt;/li&gt;&lt;li&gt;Bob Marley and the E-mailers&lt;/li&gt;&lt;li&gt;Sonny and SharePoint&lt;/li&gt;&lt;li&gt;Black-eyed ASPs&lt;/li&gt;&lt;li&gt;CultureInfo Club&lt;/li&gt;&lt;li&gt;Re-bootylicious&lt;/li&gt;&lt;li&gt;System of a Downtime&lt;/li&gt;&lt;li&gt;Billy Blu-Ray Cyrus&lt;/li&gt;&lt;li&gt;Snoop Blogg&lt;/li&gt;&lt;li&gt;Shania Twain interface&lt;/li&gt;&lt;li&gt;Silverlight Lady&lt;/li&gt;&lt;li&gt;Public Image Limited Disk Space&lt;/li&gt;&lt;li&gt;Don't believe the hyperterminal&lt;/li&gt;&lt;li&gt;Token Ring of Fire (by Jonny Cache)&lt;/li&gt;&lt;li&gt;Awk This Way (by Runas /user:DMC)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Wired for soundcard&lt;/li&gt;&lt;li&gt;Dragonforce shutdown&lt;/li&gt;&lt;li&gt;Bat out of HTML&lt;/li&gt;&lt;li&gt;Earth, Wind and Firewire&lt;/li&gt;&lt;li&gt;MPEGgy Sue&lt;/li&gt;&lt;li&gt;Great balls of Firefox&lt;/li&gt;&lt;li&gt;Alien Ant Web Farm&lt;/li&gt;&lt;/ul&gt;And my personal favourite:&lt;br /&gt;&lt;br /&gt;Adam and the NAnts&lt;br /&gt;&lt;br /&gt;[Edited 8 Oct 2008]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-8969880729773415076?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/8969880729773415076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=8969880729773415076' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8969880729773415076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8969880729773415076'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/06/songs-and-bands-likely-to-appeal-to-it.html' title='Songs and bands likely to appeal to IT nerds'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-8342510631847551604</id><published>2008-05-12T02:15:00.000-07:00</published><updated>2008-05-12T02:20:14.067-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XHTML'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>TableHeaderScope enum does not generate XHTML-compliant output</title><content type='html'>When adding the scope attribute to a column for accessibility, the following does not generate XHTML-compliant output:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;TableHeaderCell th = new TableHeaderCell();&lt;br /&gt;th.Scope = TableHeaderScope.Column;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It generates the following HTML:&lt;br /&gt;&lt;pre&gt;&amp;lt;th scope="column"&amp;gt;&lt;/pre&gt;&lt;br /&gt;The value of the scope attribute should be "col". A work-around is to add the scope attribute manually using the Attributes collection:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;th.Attributes.Add("scope", "col");&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/4228744319574131817-8342510631847551604?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/8342510631847551604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=8342510631847551604' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8342510631847551604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8342510631847551604'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/05/tableheaderscope-enum-does-not-generate.html' title='TableHeaderScope enum does not generate XHTML-compliant output'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-6264918568394846111</id><published>2008-04-24T01:30:00.000-07:00</published><updated>2008-09-16T06:26:08.908-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Postback opens layout rather than the Sitecore item</title><content type='html'>This was a weird one. I created a Sitecore item with layout and a sublayout. Then I placed a Button control on the sublayout and adding a click event handler that did something simple like display "Hello World" in a label on the sublayout. However, clicking the button navigated to the layout, rather than posting back to the Sitecore item. A colleague searched the Sitecore forum and eventually sorted the problem. It was due to the following line being commented out in the Form.browser file:&lt;br /&gt;&lt;pre&gt;&amp;lt;adapter controlType="System.Web.UI.HtmlControls.HtmlForm"&lt;br /&gt;adapterType="Sitecore.Web.FormAdapter, Sitecore.Kernel" /&amp;gt;&lt;/pre&gt;&lt;br /&gt;I had commented this out due to runtime exceptions I was getting that referred to this line in the file. However, it now seems perfectly happy with it left in!&lt;br /&gt;&lt;br /&gt;The file exists in the App_Browsers folder in the web site root. If it isn’t there, copy it from a clean 5.3.1 installation.&lt;br /&gt;&lt;br /&gt;[Edited 30/7/2008]&lt;br /&gt;&lt;br /&gt;And thanks to my colleague &lt;a href="http://www.jasonlinham.co.uk/"&gt;Jason Linham&lt;/a&gt; for noting further that the folder should not be hidden.&lt;br /&gt;&lt;br /&gt;[Updated 16/9/2008]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-6264918568394846111?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/6264918568394846111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=6264918568394846111' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6264918568394846111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6264918568394846111'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/04/postback-opens-layout-rather-than.html' title='Postback opens layout rather than the Sitecore item'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-915958446791386590</id><published>2008-04-23T03:35:00.000-07:00</published><updated>2008-05-02T00:59:13.760-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>System.OutOfMemoryException during Visual Studio 2008 build</title><content type='html'>Just recently, Visual Studio 2008 kept failing with a System.OutOfMemoryException when doing a build. The problem seems to have been due to inadequate Windows virtual memory. I upped the value of the paging file and, so far, have had no further exceptions.&lt;br /&gt;&lt;br /&gt;... 1 hour later... whoops, spoke too soon. A re-installation is now taking place.&lt;br /&gt;&lt;br /&gt;[Edit 2/5/2008: Still no luck. I have noticed that massive amounts of data are generated in the temporary ASP.NET files folder (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files). The other day, VS created over 3Gb of data in there when building a solution that was only 187Mb in size. Might be part of the problem.]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-915958446791386590?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/915958446791386590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=915958446791386590' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/915958446791386590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/915958446791386590'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/04/systemoutofmemoryexception-during.html' title='System.OutOfMemoryException during Visual Studio 2008 build'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-5653058788864111372</id><published>2008-04-16T06:12:00.000-07:00</published><updated>2009-01-07T06:31:22.469-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Sitecore item content not showing</title><content type='html'>As I&amp;rsquo;ve spent too many times trying to work out why item content (or a change to an item) is not reflected in the browser, here&amp;rsquo;s a quick note-to-self check-list:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;If the item is in a workflow, check it has been submitted and approved&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you&amp;rsquo;re referencing an item using @key (eg. item[@key='fieldname']), make sure the field name is all lower case&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Check the item has been published (do a full publish if changes have been made to templates too)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Do a full publish (or re-save the web.config file) if you suspect Sitecore caching is having an effect&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Check the content of the item is in the web database by using the dbbrowser utility (in the same broswer session as your Sitecore instance, browse to /sitecore/admin/dbbrowser.aspx)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you&amp;rsquo;re using local IIS, do an IIS reset to refresh the cache&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Use the Access Viewer to check the permissions of the item for the extranet anonymous user&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Check the item&amp;rsquo;s rendering is assigned to a valid placeholder key (be particularly careful if you are attaching renderings dynamically)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If applicable, view the HTML source and paste into the W3 validator to check for errors. Something like a self-closing script tag can throw the output.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Have I forgotten anything?&lt;br /&gt;&lt;br /&gt;[Updated 7 Jan 2009; added bullet]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-5653058788864111372?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/5653058788864111372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=5653058788864111372' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5653058788864111372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5653058788864111372'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/04/sitecore-item-content-not-showing.html' title='Sitecore item content not showing'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-3376160411784291656</id><published>2008-04-04T08:01:00.000-07:00</published><updated>2008-04-04T08:13:44.960-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Using ASP.NET Log-in Controls with Sitecore Extranet</title><content type='html'>It is simple to use the log-in controls to sign in to a Sitecore extranet. Having dragged a Login control to the design surface of a layout or sub-layout (ie. web form or user control), go to the control&amp;rsquo;s properties and click the lightning symbol. Double-click the field to the right of the Authenticate item to attach an event handler to the Authenticate event. In the event handler, set the Authenticated property of the AuthenticateEventArgs parameter equal to the success flag of the Sitecore Login() method.&lt;br /&gt;&lt;br /&gt;Your Login control definition will be similar to:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;asp:Login ID="Login1" runat="server"&lt;br /&gt;OnAuthenticate="Login1_Authenticate"&amp;gt;&amp;lt;/asp:Login&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Your event handler will be similar to:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;protected void Login1_Authenticate( object sender,&lt;br /&gt;    AuthenticateEventArgs e )&lt;br /&gt;{&lt;br /&gt;    e.Authenticated = Sitecore.Context.Domain.Login(&lt;br /&gt;        Login1.UserName, Login1.Password).Success;&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/4228744319574131817-3376160411784291656?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3376160411784291656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3376160411784291656' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3376160411784291656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3376160411784291656'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/04/using-aspnet-log-in-controls-with.html' title='Using ASP.NET Log-in Controls with Sitecore Extranet'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-7258214589219085118</id><published>2008-04-04T01:56:00.000-07:00</published><updated>2008-04-04T02:04:34.103-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Web.config'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>The user instance login flag is not supported on this version of SQL Server. The connection will be closed.</title><content type='html'>I got this error this morning when moving from a SQL Express database to SQL Server 2005. The fix was simple: I just needed to remove the "User Instance=True;" in the LocalSqlServer connection string, from:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;add name="LocalSqlServer"&lt;br /&gt;connectionString="Data Source=(local);&lt;br /&gt;Integrated Security=True;User Instance=True;&lt;br /&gt;Initial Catalog=dbname"&lt;br /&gt;providerName="System.Data.SqlClient"/&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;to&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;add name="LocalSqlServer"&lt;br /&gt;connectionString="Data Source=(local);&lt;br /&gt;Integrated Security=True;Initial Catalog=dbname"&lt;br /&gt;providerName="System.Data.SqlClient"/&amp;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/4228744319574131817-7258214589219085118?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/7258214589219085118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=7258214589219085118' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7258214589219085118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7258214589219085118'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/04/user-instance-login-flag-is-not.html' title='The user instance login flag is not supported on this version of SQL Server. The connection will be closed.'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-7069619962031313008</id><published>2008-03-29T13:14:00.000-07:00</published><updated>2008-03-29T13:37:11.954-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Open Visual Studio Project Folder in Windows Explorer</title><content type='html'>Visual Studio 2008 has this feature already built in. If you’re still using VS2005, it’s easy to add:&lt;br /&gt;&lt;br /&gt;Select Tools, External Tools to bring up the External Tools dialogue box. Enter a title in the title field. In the command field, enter the path to the Windows Explorer executable. In the arguments field, enter $(ProjectDir) or select Project Directory from the side menu. Your dialogue should look as follows. Click OK.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1QQHTld1anE/R-6j87lyyGI/AAAAAAAAABc/p_qj-lePkEg/s1600-h/VSExternalTools.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_1QQHTld1anE/R-6j87lyyGI/AAAAAAAAABc/p_qj-lePkEg/s320/VSExternalTools.gif" alt="" id="BLOGGER_PHOTO_ID_5183260488333707362" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You could leave it there. You can now click on a project in Solution Explorer and select Tools, External Tools, and pick the item that you added. Windows Explorer will open at the project&amp;rsquo;s location. To make things even slicker, add the external tool as an item on the tool bar. To do this, right-click on the tool bar and select Customize. In the left-hand pane of the dialogue box, select Tools. In the right-hand pane, select the item you added and drag to the tool bar. This is tricky as the tools are just shown as External Command 1, External Command 2 and so on. You will need to work out the number assigned to yours.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1QQHTld1anE/R-6nO7lyyHI/AAAAAAAAABk/svES53FikaM/s1600-h/VSExternalToolCommand.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_1QQHTld1anE/R-6nO7lyyHI/AAAAAAAAABk/svES53FikaM/s320/VSExternalToolCommand.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5183264096106236018" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Once you&amp;rsquo;ve dragged the right one to the tool bar, you can give it a name and icon as you like by right-clicking on it again (still in Customization mode) and tweaking the settings.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-7069619962031313008?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/7069619962031313008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=7069619962031313008' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7069619962031313008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7069619962031313008'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/03/open-visual-studio-project-folder-in.html' title='Open Visual Studio Project Folder in Windows Explorer'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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://2.bp.blogspot.com/_1QQHTld1anE/R-6j87lyyGI/AAAAAAAAABc/p_qj-lePkEg/s72-c/VSExternalTools.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-8132904413848269703</id><published>2008-03-26T10:22:00.000-07:00</published><updated>2008-08-04T12:31:18.335-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Xml'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>Cannot set a value on node type 'Element'</title><content type='html'>This error occurs if you wrongly use the Value property of XmlNode to change the value of an element.&lt;br /&gt;&lt;pre&gt;XmlDocument xdoc = new XmlDocument();&lt;br /&gt;xdoc.Load( MapPath( "XmlSample.xml" ) );&lt;br /&gt;XmlNode node =&lt;br /&gt;xdoc.SelectSingleNode( "//element[@id=100]" );&lt;br /&gt;&lt;br /&gt;// The following line will lead to&lt;br /&gt;// an InvalidOperationException&lt;br /&gt;node.Value = "New value!!";&lt;br /&gt;&lt;br /&gt;xdoc.Save( MapPath( "XmlSample.xml" ) );&lt;/pre&gt;&lt;br /&gt;Instead, use the InnerText property:&lt;br /&gt;&lt;pre&gt;node.InnerText = "New value!!";&lt;br /&gt;&lt;br /&gt;[Edited: 4 Aug 2008]&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/4228744319574131817-8132904413848269703?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/8132904413848269703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=8132904413848269703' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8132904413848269703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8132904413848269703'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/03/cannot-set-value-on-node-type-element.html' title='Cannot set a value on node type &apos;Element&apos;'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-5972316409075878496</id><published>2008-03-25T04:11:00.000-07:00</published><updated>2008-03-26T10:30:31.733-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Xml'/><title type='text'>Validate XML in IE using JavaScript</title><content type='html'>Slightly off-topic, but as there don&amp;rsquo;t seem to be many good examples on the web of how to validate an XML document in IE using JavaScript, here&amp;rsquo;s a quick snippet. In the event of an XML error, an error message is displayed in the div.&lt;br /&gt;&lt;pre&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;XML Validator&amp;lt;/title&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;        function loadit()&lt;br /&gt;        {&lt;br /&gt;            var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");&lt;br /&gt;            xmlDoc.validateOnParse = true;&lt;br /&gt;            xmlDoc.async="false";&lt;br /&gt;            xmlDoc.load("MyXmlFile.xml");&lt;br /&gt;&lt;br /&gt;            if (xmlDoc.parseError != '0')&lt;br /&gt;            {&lt;br /&gt;                document.getElementById("error").innerHTML&lt;br /&gt;                    = xmlDoc.parseError.reason;&lt;br /&gt;            }&lt;br /&gt;            &lt;br /&gt;}&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body onload="loadit();"&amp;gt;&lt;br /&gt;    &amp;lt;div id="error"&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-5972316409075878496?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/5972316409075878496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=5972316409075878496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5972316409075878496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5972316409075878496'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/03/validate-xml-in-ie-using-javascript.html' title='Validate XML in IE using JavaScript'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-1389441908027913436</id><published>2008-03-19T08:37:00.000-07:00</published><updated>2008-07-18T01:35:19.529-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='funnies'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Windows Firewall has blocked some features of a program</title><content type='html'>Should I keep blocking this program?&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1QQHTld1anE/R-Eze6SOt4I/AAAAAAAAABQ/F8VeD7u8Yyw/s1600-h/vsblock.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_1QQHTld1anE/R-Eze6SOt4I/AAAAAAAAABQ/F8VeD7u8Yyw/s320/vsblock.png" alt="" id="BLOGGER_PHOTO_ID_5179477652587591554" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-1389441908027913436?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/1389441908027913436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=1389441908027913436' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1389441908027913436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1389441908027913436'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/03/windows-firewall-has-blocked-some.html' title='Windows Firewall has blocked some features of a program'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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://1.bp.blogspot.com/_1QQHTld1anE/R-Eze6SOt4I/AAAAAAAAABQ/F8VeD7u8Yyw/s72-c/vsblock.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-3960831918434954728</id><published>2008-03-19T06:20:00.001-07:00</published><updated>2008-03-19T06:28:41.919-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>Unable to find script library '/aspnet_client/ system_web/1_1_4322/WebUIValidation.js'</title><content type='html'>If you get this error using .NET 1.1, try reinstalling the JavaScript file by navigating to your Framework directory (eg. C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322) and running the following command:&lt;br /&gt;&lt;br /&gt;aspnet_regiis -c&lt;br /&gt;&lt;br /&gt;Create a virtual directory under your web site root called &amp;lsquo;aspnet_client&amp;rsquo; with all the default options and point it to the aspnet_client folder under the web root (eg. C:\Inetpub\wwwroot\aspnet_client).&lt;br /&gt;&lt;br /&gt;Make sure you have appropriate backups before attempting these suggestions, in case you need to roll back.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-3960831918434954728?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3960831918434954728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3960831918434954728' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3960831918434954728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3960831918434954728'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/03/unable-to-find-script-library.html' title='Unable to find script library &apos;/aspnet_client/ system_web/1_1_4322/WebUIValidation.js&apos;'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-1774725002579251727</id><published>2008-03-19T06:04:00.000-07:00</published><updated>2008-03-19T06:10:11.889-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>Error Saving a Query String to a Cookie</title><content type='html'>Here&amp;rsquo;s one to note. I have some code that saves the requested URL to a cookie and later retrieves it. The strange thing was that when retrieving the value, anything after an ampersand in the query string was lost. The solution was to encode the Url using UrlEncode() (not HtmlEncode()).&lt;br /&gt;&lt;br /&gt;Response.Cookies["RequestedPage"].Values.Add("Url", HttpUtility.UrlEncode(value))&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-1774725002579251727?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/1774725002579251727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=1774725002579251727' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1774725002579251727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1774725002579251727'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/03/error-saving-query-string-to-cookie.html' title='Error Saving a Query String to a Cookie'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-366645374030382404</id><published>2008-03-12T04:34:00.000-07:00</published><updated>2008-07-18T01:36:04.219-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='funnies'/><title type='text'>The following applications should be closed before continuing with set-up</title><content type='html'>Installing the .NET 3.5 Framework on a server this morning, I got this beauty of an error message:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1QQHTld1anE/R9fAPqSOt3I/AAAAAAAAABI/rxrFFp2nk2E/s1600-h/net35setup.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_1QQHTld1anE/R9fAPqSOt3I/AAAAAAAAABI/rxrFFp2nk2E/s320/net35setup.png" alt="" id="BLOGGER_PHOTO_ID_5176817671966996338" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Superb.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-366645374030382404?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/366645374030382404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=366645374030382404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/366645374030382404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/366645374030382404'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/03/following-applications-should-be-closed.html' title='The following applications should be closed before continuing with set-up'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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://2.bp.blogspot.com/_1QQHTld1anE/R9fAPqSOt3I/AAAAAAAAABI/rxrFFp2nk2E/s72-c/net35setup.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-7715010300514297736</id><published>2008-03-11T07:32:00.000-07:00</published><updated>2008-03-11T07:39:30.185-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Root element is missing</title><content type='html'>This exception arises if you store the Sitecore and Sitecore Modules folders outside of the web root and have forgotten to create virtual directories under the web root that point to them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-7715010300514297736?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/7715010300514297736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=7715010300514297736' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7715010300514297736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7715010300514297736'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/03/root-element-is-missing.html' title='Root element is missing'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-2128513832098635865</id><published>2008-03-11T02:46:00.001-07:00</published><updated>2008-07-18T01:36:28.552-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='funnies'/><title type='text'>How many CMS developers does it take to change a light bulb?</title><content type='html'>None. It's a content issue.&lt;br /&gt;&lt;br /&gt;(Sorry.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-2128513832098635865?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/2128513832098635865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=2128513832098635865' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2128513832098635865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2128513832098635865'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/03/how-many-cms-developers-does-it-take-to.html' title='How many CMS developers does it take to change a light bulb?'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-1358514002431330852</id><published>2008-02-21T03:50:00.000-08:00</published><updated>2008-02-21T04:03:13.382-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Xslt'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Extract the Month from a DateTime Field in Sitecore</title><content type='html'>Using sc:formatdate(), it is a fairly trivial matter to format a date in a Sitecore Xslt rendering. Eg:&lt;br /&gt;&lt;pre&gt;sc:formatdate(sc:fld('MyDateField', .),&lt;br /&gt;'d MMM yyyy @ h:mm')&lt;/pre&gt;&lt;br /&gt;However, extracting just the month as a number without padding is less obvious. Using the format string 'MMM' gives three-letter month names, 'MM' gives months padded with zeros (eg. 02 for Feb), while 'M' curiously gives full month name and date padded with zeros.&lt;br /&gt;&lt;br /&gt;A workaround is to use substring-after in conjunction with the format '/M'. Example:&lt;br /&gt;&lt;pre&gt;substring-after(sc:formatdate(&lt;br /&gt;sc:fld('MyDateField', .), '/M'), '/')&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-1358514002431330852?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/1358514002431330852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=1358514002431330852' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1358514002431330852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1358514002431330852'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/02/extract-month-from-datetime-field-in.html' title='Extract the Month from a DateTime Field in Sitecore'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-4849214839706042949</id><published>2008-02-15T07:58:00.000-08:00</published><updated>2008-02-15T08:03:30.866-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Xslt'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Get the Path of a Sitecore File Field Given a Media Path</title><content type='html'>A file field in Sitecore uses a media path. If you want to get the actual URL to the uploaded file, you need to append the file&amp;rsquo;s media path to the media library path and use this to reference the item in the media library. You can then extract the value of the path field. Example:&lt;br /&gt;&lt;br /&gt;&amp;lt;a href="{sc:fld('Path', sc:item(concat('/sitecore/media library', sc:fld('filefieldname', .)), .))}"&amp;gt;Download file&amp;lt;/a&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-4849214839706042949?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/4849214839706042949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=4849214839706042949' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4849214839706042949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4849214839706042949'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/02/get-path-of-sitecore-file-field-given.html' title='Get the Path of a Sitecore File Field Given a Media Path'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-5225786289283172684</id><published>2008-02-15T00:53:00.000-08:00</published><updated>2008-02-15T01:04:34.597-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>How to Determine Sitecore System Field Names</title><content type='html'>If you want to find out the name of system fields in Sitecore, you need to open the Standard Template in the Template Manager.&lt;br /&gt;&lt;br /&gt;Here are some of the available fields (obtained from version 5.2):&lt;br /&gt;&lt;br /&gt;Workflow:&lt;br /&gt;__Workflow&lt;br /&gt;__Workflow state&lt;br /&gt;__Lock&lt;br /&gt;__Default workflow&lt;br /&gt;&lt;br /&gt;Help:&lt;br /&gt;__Short description&lt;br /&gt;__Long description&lt;br /&gt;__Help link&lt;br /&gt;&lt;br /&gt;Publishing:&lt;br /&gt;__Publish&lt;br /&gt;__Unpublish&lt;br /&gt;__Publishing groups&lt;br /&gt;__Never publish&lt;br /&gt;&lt;br /&gt;Tasks:&lt;br /&gt;__Archive date&lt;br /&gt;__Reminder date&lt;br /&gt;__Reminder recipients&lt;br /&gt;__Reminder text&lt;br /&gt;&lt;br /&gt;Lifetime:&lt;br /&gt;__Valid from&lt;br /&gt;__Valid to&lt;br /&gt;&lt;br /&gt;Statistics:&lt;br /&gt;__Created&lt;br /&gt;__Created by&lt;br /&gt;__Revision&lt;br /&gt;__Updated&lt;br /&gt;__Updated by&lt;br /&gt;&lt;br /&gt;Might be obvious, but I couldn&amp;rsquo;t find a list on SDN.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-5225786289283172684?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/5225786289283172684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=5225786289283172684' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5225786289283172684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5225786289283172684'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/02/how-to-determine-sitecore-system-field.html' title='How to Determine Sitecore System Field Names'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-1016666726998703520</id><published>2008-02-11T04:55:00.001-08:00</published><updated>2008-02-11T05:25:10.767-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Xslt'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Setting Query String Parameters in Xslt</title><content type='html'>In Xslt, adding a new parameter to a query string presents a problem as, without writing your own extension function, you cannot determine whether you should prefix your parameter with &amp;lsquo;?&amp;rsquo; or &amp;lsquo;&amp;amp;&amp;rsquo;. In Sitecore, the Xslt function sc:qs('&lt;em&gt;parametername&lt;/em&gt;') can be used to obtain the value of a named parameter&lt;em&gt; parametername&lt;/em&gt;. Unfortunately, there is no function provided that obtains the entire query string.&lt;br /&gt;&lt;br /&gt;Here&amp;rsquo;s a workaround. Let&amp;rsquo;s say you want to add a parameter called &amp;lsquo;page&amp;rsquo;.&lt;br /&gt;&lt;br /&gt;First, build up the rest of the query string. The following template checks the existence in the query string of parameter names passed to it. You need to know the names of the possible parameters. If they exist, they are written out.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  &amp;lt;xsl:template name="SetQueryParameter"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:param name="name" /&amp;gt;&lt;br /&gt;    &amp;lt;xsl:if test="sc:qs($name)"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:text&amp;gt;&amp;amp;amp;&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;      &amp;lt;xsl:value-of select="$name" /&amp;gt;&lt;br /&gt;      &amp;lt;xsl:text&amp;gt;=&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;      &amp;lt;xsl:value-of select="sc:qs($name)" /&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:if&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This template would typically be called from within a variable definition, therefore saving the created query string. In the following example, we are checking parameters&lt;em&gt; type&lt;/em&gt; and&lt;em&gt; orderby&lt;/em&gt; and saving them if they exist so we can add them back in later:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  &amp;lt;xsl:variable name="RestOfQueryString"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:call-template name="SetQueryParameter"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:with-param name="name"&amp;gt;type&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;    &amp;lt;xsl:call-template name="SetQueryParameter"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:with-param name="name"&amp;gt;orderby&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:variable&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You are then able to append this query string to your newly-added parameter, which you add using a &amp;lsquo;?&amp;rsquo;:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  &amp;lt;a&amp;gt;&lt;br /&gt;    &amp;lt;xsl:attribute name="href"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:text&amp;gt;?page=10&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;      &amp;lt;xsl:value-of select="$RestOfQueryString" /&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:attribute&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;Page 10&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;  &amp;lt;/a&amp;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/4228744319574131817-1016666726998703520?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/1016666726998703520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=1016666726998703520' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1016666726998703520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/1016666726998703520'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/02/setting-query-string-parameters-in-xslt.html' title='Setting Query String Parameters in Xslt'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-2298202695422793053</id><published>2008-02-10T13:20:00.000-08:00</published><updated>2008-02-10T14:53:54.910-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='validation'/><title type='text'>ASP.NET Custom Validator of ISBN Numbers</title><content type='html'>International Standard Book Numbers (ISBNs), like other important numbers, such as credit card numbers, lend themselves to self-validation. The last digit of an ISBN is a check digit. A value found by applying a mathematical formula to other digits of the ISBN can be compared to this check digit. If the values relate to each other in a certain way, the ISBN is taken to be of a valid format.&lt;br /&gt;&lt;br /&gt;To use an ASP.NET custom validator to apply the validation logic, proceed as follows. (The code validates ten-digit ISBN numbers.)&lt;br /&gt;&lt;br /&gt;First, drag a CustomValidator control to the design surface of Visual Studio. Set its ControlToValidate to the ID of the control that is to be validated (eg. a TextBox). Set the ErrorMessage and Text properties as required. Double-click the CustomValidator control and add the following code to the ServerValidate event handler (this is example starter code: you will need to check its suitability against your particular requirements):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;protected void cvISBN_ServerValidate( object source,&lt;br /&gt;ServerValidateEventArgs args )&lt;br /&gt;{&lt;br /&gt;    string strInput = args.Value;&lt;br /&gt;&lt;br /&gt;    if( strInput.Length != 10 )&lt;br /&gt;    {&lt;br /&gt;        args.IsValid = false;&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;        int checksum;&lt;br /&gt;&lt;br /&gt;        if( strInput[9] == 'X' )&lt;br /&gt;        {&lt;br /&gt;            checksum = 10;&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            checksum = (int)strInput[9] - 48;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        int total = 0;&lt;br /&gt;&lt;br /&gt;        for( int i = 0; i &lt; 9; i++ )&lt;br /&gt;        {&lt;br /&gt;            total += ( i + 1 ) * ( (int)strInput[i] - 48 );&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        args.IsValid = ( total % 11 == checksum );&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;To perform client-side validation too, you can write a similar function in JavaScript and attach it to the CustomValidator&amp;rsquo;s ClientValidationFunction property. The function should have the following signature:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;function myvalidationfunction(source, args)&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-2298202695422793053?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/2298202695422793053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=2298202695422793053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2298202695422793053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2298202695422793053'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/02/aspnet-custom-validator-of-isbn-numbers.html' title='ASP.NET Custom Validator of ISBN Numbers'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-628318552780050825</id><published>2008-02-01T07:30:00.000-08:00</published><updated>2008-02-01T07:43:30.584-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Posting back to a page without aspx extension</title><content type='html'>A project I am working on has the requirement for URLs not to have .aspx extensions. Requests are handled by IIS using &lt;a href="http://www.isapirewrite.com/"&gt;ISAPI_Rewrite&lt;/a&gt;, which effectively adds on the extension behind the scenes. Generating the URLs is a fairly simple affair in XSLT using substring-before($url, '.aspx'). However, when using a ASP.NET form, the submit button by default adds an extension. I tried specifying the action attribute explicitly of the form, but this had no effect. The solution is to add a PostBackUrl attribute to the button control. Give it the name of the current page, without the extension. Example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;asp:Button ID="btnSubmit" PostBackUrl="mypage"&lt;br /&gt;runat="server" Text="Submit" OnClick="btnSubmit_Click" /&amp;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/4228744319574131817-628318552780050825?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/628318552780050825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=628318552780050825' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/628318552780050825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/628318552780050825'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/02/posting-back-to-page-without-aspx.html' title='Posting back to a page without aspx extension'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-8587548160447311927</id><published>2008-02-01T02:17:00.000-08:00</published><updated>2008-02-01T02:19:48.763-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>The located assembly's manifest definition does not match the assembly reference</title><content type='html'>I got this message this morning. It occurred in a solution comprising a web site and several class library projects. Both the web site and one the class libraries had a reference to the same assembly name. To resolve the problem, I removed the reference from the web site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-8587548160447311927?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/8587548160447311927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=8587548160447311927' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8587548160447311927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/8587548160447311927'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/02/located-assemblys-manifest-definition.html' title='The located assembly&apos;s manifest definition does not match the assembly reference'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-7070417904934941541</id><published>2008-01-31T01:04:00.000-08:00</published><updated>2008-01-31T01:08:48.433-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Culture 'en' is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread's current culture.</title><content type='html'>The following exception may be thrown when trying to open a log file in the Sitecore Log Viewer:&lt;br /&gt;&lt;br /&gt;&amp;ldquo;Culture &amp;lsquo;en&amp;rsquo; is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread&amp;rsquo;s current culture.&amp;rdquo;&lt;br /&gt;&lt;br /&gt;To overcome this, open the User Manager and add a value in the RegionalIsoCode field for the user affected. For GB English, enter en-GB.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-7070417904934941541?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/7070417904934941541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=7070417904934941541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7070417904934941541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7070417904934941541'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/01/culture-en-is-neutral-culture-it-cannot.html' title='Culture &apos;en&apos; is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread&apos;s current culture.'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-3030392852766484307</id><published>2008-01-30T14:03:00.000-08:00</published><updated>2008-01-30T14:12:25.839-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>Failed to execute the request because the ASP.NET process identity does not have read permissions to the global assembly cache</title><content type='html'>If you get &amp;ldquo;Server Application Unavailable&amp;rdquo; when trying to browse to your development web site, check the Event Log on the host machine. If it contains the message &amp;ldquo;Failed to execute the request because the ASP.NET process identity does not have read permissions to the global assembly cache&amp;rdquo;, navigate to the .NET Framework directory containing the file aspnet_regiis.exe and run the command:&lt;br /&gt;&lt;pre&gt;aspnet_regiis -ga &lt;em&gt;machinename&lt;/em&gt;\ASPNET&lt;/pre&gt; (substituting &lt;em&gt;machinename&lt;/em&gt; as appropriate).&lt;br /&gt;&lt;br /&gt;Ensure also that the web site is an application (create an application in the IIS home directory).&lt;br /&gt;&lt;br /&gt;If the message is simply &amp;ldquo;Service Unavailable&amp;rdquo; and you’re using IIS 6, check the application pool associated with your web site is running.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-3030392852766484307?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3030392852766484307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3030392852766484307' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3030392852766484307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3030392852766484307'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/01/failed-to-execute-request-because.html' title='Failed to execute the request because the ASP.NET process identity does not have read permissions to the global assembly cache'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-5469741543257318029</id><published>2008-01-29T13:13:00.001-08:00</published><updated>2008-01-31T01:09:23.898-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>Type conflicts with the imported type</title><content type='html'>Partial classes were introduced in .NET 2.0 enabling you to create classes spread over several source code files. What&amp;rsquo;s not immediately clear is that you only do this with source code files. You cannot add to a partial class that&amp;rsquo;s already built in a distinct assembly. If you try to do this, you&amp;rsquo;ll get something similar to the following error:&lt;br /&gt;&lt;br /&gt;The type '&lt;em&gt;namespace.class&lt;/em&gt;' in 'C:\MyFolder\Class1.cs' conflicts with the imported type '&lt;em&gt;namespace.class&lt;/em&gt;' in '&lt;em&gt;assemblyfilename.dll&lt;/em&gt;'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-5469741543257318029?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/5469741543257318029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=5469741543257318029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5469741543257318029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/5469741543257318029'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/01/type-conflicts-with-imported-type.html' title='Type conflicts with the imported type'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-6215674748444277936</id><published>2008-01-29T12:16:00.000-08:00</published><updated>2008-01-29T13:02:05.972-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Web.config'/><title type='text'>Generating Custom Configuration Sections in web.config (Part 2)</title><content type='html'>My earlier post about &lt;a href="http://dotnetnutty.blogspot.com/2007/10/generating-custom-configuration-section.html"&gt;creating custom configuration sections in web.config&lt;/a&gt;, referred to a custom tool that can be used to do the leg work.&lt;br /&gt;&lt;br /&gt;If you wish to implement custom sections yourself, here&amp;rsquo;s a simple example of how. This simple example uses standard key/value attributes and data that is not strongly typed. I shall later post a more advanced example, using strongly-typed data.&lt;br /&gt;&lt;br /&gt;First, within the &lt;configuration&gt; element of web.config, add the following &lt;configSections&gt; element exactly as is, replacing &lt;em&gt;MySectionName&lt;/em&gt; with the name you want to give your section:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  &amp;lt;configSections&amp;gt;&lt;br /&gt;    &amp;lt;sectionGroup name="&lt;em&gt;MySectionName&lt;/em&gt;"&amp;gt;&lt;br /&gt;      &amp;lt;section name="Portal"&lt;br /&gt;type="System.Configuration.NameValueSectionHandler,system,&lt;br /&gt;Version=1.0.3300.0,Culture=neutral, &lt;br /&gt;PublicKeyToken=b77a5c561934e089,Custom=null" /&amp;gt;&lt;br /&gt;    &amp;lt;/sectionGroup&amp;gt;&lt;br /&gt;  &amp;lt;/configSections&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This uses the built-in handler. No further development is necessary.&lt;br /&gt;&lt;br /&gt;You can then add keys to your custom section:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  &amp;lt;MySectionName&amp;gt;&lt;br /&gt;    &amp;lt;MyStuff&amp;gt;&lt;br /&gt;      &amp;lt;add key="fruit1" value="apples" /&amp;gt;&lt;br /&gt;      &amp;lt;add key="fruit2" value="oranges" /&amp;gt;&lt;br /&gt;    &amp;lt;/ MyStuff &amp;gt;&lt;br /&gt;  &amp;lt;/MySectionName&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Finally, you extract the keys as follows:&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;br /&gt;&lt;pre style="margin: 0px;"&gt;&lt;br /&gt;&lt;span style="color: #2b91af;"&gt;NameValueCollection&lt;/span&gt; settings =&lt;br /&gt;&lt;span style="color: #2b91af;"&gt;ConfigurationManager&lt;/span&gt;.GetSection(&lt;br /&gt;&lt;span style="color: #a31515;"&gt;"MySectionName/MyStuff"&lt;/span&gt;)&lt;br /&gt;&lt;span style="color: blue;"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;NameValueCollection&lt;/span&gt;;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-6215674748444277936?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/6215674748444277936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=6215674748444277936' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6215674748444277936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6215674748444277936'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/01/generating-custom-configuration.html' title='Generating Custom Configuration Sections in web.config (Part 2)'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-881096426166330752</id><published>2008-01-28T01:33:00.000-08:00</published><updated>2008-01-31T01:10:14.608-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XHTML'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>XHTML-compliant links: There is no attribute "target"</title><content type='html'>The traditional way to open links in a new window was to use target="_blank". This is non-valid XHTML. The error on the W3 validator is &amp;ldquo;there is no attribute "target".&amp;rdquo; The editor in Sitecore 5.2 generates target="_blank". I haven’t yet tried other versions.&lt;br /&gt;&lt;br /&gt;There&amp;rsquo;s an interesting work-around on here:&lt;br /&gt;&lt;a href="http://www.sitepoint.com/article/standards-compliant-world"&gt;&lt;br /&gt;http://www.sitepoint.com/article/standards-compliant-world&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In short, they attach target="_blank" using JavaScript.&lt;br /&gt;&lt;br /&gt;It seems like a fudge just to bypass the check, but the author argues it&amp;rsquo;s perfectly valid approach. The only downside is the reliance on JavaScript.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-881096426166330752?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/881096426166330752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=881096426166330752' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/881096426166330752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/881096426166330752'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/01/xhtml-compliant-links-there-is-no.html' title='XHTML-compliant links: There is no attribute &quot;target&quot;'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-3987855640978469040</id><published>2008-01-18T15:24:00.000-08:00</published><updated>2008-01-18T15:52:39.318-08:00</updated><title type='text'>Introducing MicroScrum!</title><content type='html'>Having attended various sessions at &lt;a href="http://dotnetnutty.blogspot.com/2007/11/reflections-of-week-at-tech-ed.html"&gt;TechEd&lt;/a&gt;, &lt;a href="http://www.developerday.co.uk/ddd/default.asp"&gt;DDD&lt;/a&gt; and &lt;a href="http://www.dotnetdevnet.com/"&gt;DotNetDevNet&lt;/a&gt; on &lt;a href="http://en.wikipedia.org/wiki/Scrum_(development)"&gt;Scrum&lt;/a&gt;, I wanted to try implementing it. Trouble was, the size of the team for my current project is small (2 or 3 developers, including me) and Scrum&amp;rsquo;s intended for larger teams. So, I took the elements of Scrum that I felt still applied and, well, applied them!&lt;br /&gt;&lt;br /&gt;Here&amp;rsquo;s what we are now doing:&lt;br /&gt;&lt;br /&gt;We work in sprints&amp;mdash;the tasks making up each sprint go into &lt;a href="http://msdn2.microsoft.com/en-us/teamsystem/aa718825.aspx"&gt;TFS&lt;/a&gt; as work items (or rather, they will be going into TFS: haven&amp;rsquo;t got around to that bit yet!). Every morning, we have a &amp;ldquo;Scrumlet&amp;rdquo;. We use it to run quickly through the tasks listed and attach estimated remaining times. It&amp;rsquo;s also a chance to re-focus efforts for the day. I keep a burn down chart up to date for my own and team&amp;rsquo;s reference. The chart is a great way to manage time and it keeps my project manager happy. Its visible nature means that the impact of moving someone onto another project is readily apparent.&lt;br /&gt;&lt;br /&gt;I add to each sprint a couple of recurring tasks, namely the running of unit and functional tests, plus the updating of documentation. (I think of the latter as continuous integration for documentation.)&lt;br /&gt;&lt;br /&gt;Early indications are that using &amp;ldquo;MicroScrum&amp;rdquo; is a great way to ensure project delivery remains on track, or at least that problems are seen earlier.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-3987855640978469040?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3987855640978469040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3987855640978469040' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3987855640978469040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3987855640978469040'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/01/introducing-microscrum.html' title='Introducing MicroScrum!'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-4822919726434505699</id><published>2008-01-15T12:01:00.000-08:00</published><updated>2008-01-15T12:32:07.852-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVP'/><category scheme='http://www.blogger.com/atom/ns#' term='Xslt'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Implementing the MVP Pattern in Sitecore XSLT Extension Methods</title><content type='html'>Here&amp;rsquo;s a way of implementing the MVP pattern when creating Sitecore XSLT extension methods. Ideally, you should already have some experience of creating extension methods and be familiar with MVP.&lt;br /&gt;&lt;br /&gt;In the example I use, a &amp;ldquo;for-each&amp;rdquo; loop is used to display a list of makes of car.&lt;br /&gt;&lt;br /&gt;First, create the view interface, defining the property or properties you want to display in the XSLT. As we are returning an array of values, the XPathNodeIterator return type is used:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;interface&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ICarsView&lt;/span&gt;&lt;br /&gt;{&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;XPathNodeIterator&lt;/span&gt; Cars { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;/p&gt;}&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Create an interface defining the method that will get the data or information from store:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;interface&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ICar&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;XPathNodeIterator&lt;/span&gt; GetListOfCars();&lt;/p&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;In your data access layer (DAL), implement the method that gets the data:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;XPathNodeIterator&lt;/span&gt; GetListOfCars()&lt;/p&gt;{&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;var&lt;/span&gt; cars = &lt;span style="color: blue;"&gt;from&lt;/span&gt; c &lt;span style="color: blue;"&gt;in&lt;/span&gt; GetMyData()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;orderby&lt;/span&gt; c.Make&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;select&lt;/span&gt; c;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;XDocument&lt;/span&gt; xdoc = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;XDocument&lt;/span&gt;();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;XElement&lt;/span&gt; xmlTree = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;XElement&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"Cars"&lt;/span&gt;);&lt;/p&gt;&lt;br /&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;foreach&lt;/span&gt;( var car &lt;span style="color: blue;"&gt;in&lt;/span&gt; cars )&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; xmlTree.Add(&lt;span style="color: blue;"&gt;new&lt;/span&gt; XElement(&lt;span style="color: #a31515;"&gt;"Car"&lt;/span&gt;,&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;new&lt;/span&gt; XAttribute(&lt;span style="color: #a31515;"&gt;"Make"&lt;/span&gt;, car.Make)));&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;br /&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xdoc.Add(xmlTree);&lt;/p&gt;&lt;br /&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; xdoc.CreateNavigator().Select(&lt;span style="color: #a31515;"&gt;"/Cars/Car"&lt;/span&gt;);&lt;/p&gt;}&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Create the presenter class, which will store references to the view and DAL method interfaces, and define the method(s) that will set the value of the property or properties on the view:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;CarsPresenter&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ICarsView&lt;/span&gt; _view;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ICar&lt;/span&gt; _icar;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; CarsPresenter( &lt;span style="color: #2b91af;"&gt;ICarsView&lt;/span&gt; view, &lt;span style="color: #2b91af;"&gt;ICar&lt;/span&gt; car )&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _view = view;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _icar = car;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; SetCarsProperty()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _view.Cars = _icar.GetListOfCars();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Create the extension method that implements the view:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;CarsView&lt;/span&gt;: &lt;span style="color: #2b91af;"&gt;ICarsView&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;{&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;XPathNodeIterator&lt;/span&gt; GetListOfCars()&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;CarsPresenter&lt;/span&gt; cp = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;CarsPresenter&lt;/span&gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt;, &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;CarsDal&lt;/span&gt;());&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; cp.SetCarsProperty ();&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; Cars;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #region&lt;/span&gt; IAgreementsView Members&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;XPathNodeIterator&lt;/span&gt; Cars&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endregion&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;In the web.config file, add an extension element to the xslExtensions element that references the concrete view. Use one such element for each namespace:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;extension&lt;/span&gt;&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;mode&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;on&lt;/span&gt;"&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;XsltViews.CarsView, XsltViews&lt;/span&gt;"&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  &lt;/span&gt;&lt;span style="color: red;"&gt;namespace&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt; http://example.com/xsltviews/cars &lt;/span&gt;"&lt;span style="color: blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In your XSLT file, declare the namespace prefix by adding it to the stylesheet element and including the prefix in the exclude-result-prefixes attribute:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;xsl:stylesheet&lt;/span&gt;&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;version&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;1.0&lt;/span&gt;"&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: red;"&gt;xmlns:xsl&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;http://www.w3.org/1999/XSL/Transform&lt;/span&gt;"&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: red;"&gt;xmlns:sc&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;http://www.sitecore.net/sc&lt;/span&gt;"&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: red;"&gt;xmlns:dot&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;http://www.sitecore.net/dot&lt;/span&gt;"&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: red;"&gt;xmlns:view&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;http://example.com/xsltviews/cars&lt;/span&gt;"&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: red;"&gt;exclude-result-prefixes&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;dot sc view&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Finally, you can now call the method from your XSLT:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;xsl:for-each&lt;/span&gt;&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;select&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;view:GetListOfCars()&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;xsl:value-of&lt;/span&gt;&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;select&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;@Make&lt;/span&gt;"&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;xsl:for-each&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-4822919726434505699?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/4822919726434505699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=4822919726434505699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4822919726434505699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4822919726434505699'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/01/implementing-mvp-pattern-in-sitecore.html' title='Implementing the MVP Pattern in Sitecore XSLT Extension Methods'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-3949045134133333883</id><published>2008-01-14T02:42:00.000-08:00</published><updated>2008-06-11T04:24:20.805-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Xslt'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>Creating Simple Loops in XSLT</title><content type='html'>Here's a simple way to create a loop in XSLT. As you might expect, it uses recursion.&lt;br /&gt;&lt;br /&gt;I have defined a template that will do the work of the loop. It checks the value of a variable called 'counter' before calling itself. This is the loop condition. Before this test, you can add whatever it is you need the loop to do. In the following example, I print the letters of the alphabet, followed by "... Hello!":&lt;pre&gt;&lt;br /&gt; &amp;lt;xsl:template name="DoLoop"&amp;gt;&lt;br /&gt;   &amp;lt;xsl:param name="counter" /&amp;gt;&lt;br /&gt;   &amp;lt;xsl:variable name="letter"&lt;br /&gt;select="substring($alphabet, $counter, 1)" /&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;!--Body of loop goes here--&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;xsl:value-of select="$letter" /&amp;gt;... Hello!&lt;br /&gt;   &amp;lt;br/&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;!--End of loop body--&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;xsl:if test="$counter &amp;amp;lt; 26"&amp;gt;&lt;br /&gt;     &amp;lt;xsl:call-template name="DoLoop"&amp;gt;&lt;br /&gt;       &amp;lt;xsl:with-param name="counter"&amp;gt;&lt;br /&gt;         &amp;lt;xsl:value-of select="$counter+1" /&amp;gt;&lt;br /&gt;       &amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;     &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;   &amp;lt;/xsl:if&amp;gt;&lt;br /&gt; &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The loop is then initiated by calling it with the desired starting value:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   &amp;lt;xsl:call-template name="DoLoop"&amp;gt;&lt;br /&gt;     &amp;lt;xsl:with-param name="counter"&amp;gt;1&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;   &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For info, the alphabet variable is simply defined as:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; &amp;lt;xsl:variable name="alphabet"&amp;gt;&lt;br /&gt;   &amp;lt;xsl:text&amp;gt;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;lt;/xsl:text&amp;gt;&lt;br /&gt; &amp;lt;/xsl:variable&amp;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/4228744319574131817-3949045134133333883?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3949045134133333883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3949045134133333883' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3949045134133333883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3949045134133333883'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/01/creating-simple-loops-in-xslt.html' title='Creating Simple Loops in XSLT'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-3429653206157794779</id><published>2008-01-03T07:07:00.000-08:00</published><updated>2008-02-01T07:46:29.463-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Xslt'/><title type='text'>How to Change String Case in XSLT</title><content type='html'>Here's a simple way to convert a string to lower case in XSLT. The snippet takes an input variable inputtext and saves the lower case version to a new variable called lowercasetext.&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:variable name="lowercasetext" select="translate($inputtext, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" /&amp;gt;&lt;br /&gt;&lt;br /&gt;To upper case a string, simply swap the position of the two alphabet literals shown.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-3429653206157794779?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/3429653206157794779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=3429653206157794779' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3429653206157794779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/3429653206157794779'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/01/how-to-change-string-case-in-xslt.html' title='How to Change String Case in XSLT'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-260822653929752417</id><published>2008-01-02T03:43:00.000-08:00</published><updated>2008-01-31T01:10:53.709-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='Sitecore'/><title type='text'>A valid license cannot be granted for the type CuteEditor.Editor</title><content type='html'>If you get this error message in rich text fields of the Sitecore Content Editor, check that your bin folder includes the CuteEditor licence file (CuteEditor.Lic).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-260822653929752417?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/260822653929752417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=260822653929752417' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/260822653929752417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/260822653929752417'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2008/01/valid-license-cannot-be-granted-for.html' title='A valid license cannot be granted for the type CuteEditor.Editor'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-2192467968008329046</id><published>2007-12-07T12:53:00.000-08:00</published><updated>2008-07-18T01:37:45.532-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='funnies'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>LINQ to Everything</title><content type='html'>Last month, as I was leaving the excellent &lt;a href="http://www.dotnetdevnet.com/"&gt;.NET Developer Network&lt;/a&gt; in Bristol, I was considering the various data sources that can be queried using &lt;a href="http://en.wikipedia.org/wiki/Language_Integrated_Query"&gt;LINQ&lt;/a&gt;. There's LINQ to XML, LINQ to objects, LINQ to SQL and so on. As I was just about to leave building, I walked past a sign showing the words "Link to P Block". And suddenly, everything seemed all right with the world.&lt;br /&gt;&lt;br /&gt;Technorati Tags: &lt;a href="http://technorati.com/tag/linq" target="new"&gt;LINQ&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-2192467968008329046?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/2192467968008329046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=2192467968008329046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2192467968008329046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/2192467968008329046'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2007/12/linq-to-everything.html' title='LINQ to Everything'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-4306111537939595731</id><published>2007-11-20T13:00:00.000-08:00</published><updated>2008-02-01T07:46:09.057-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Testing'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SMTP'/><category scheme='http://www.blogger.com/atom/ns#' term='Email'/><title type='text'>How to Test Code that Generates Email</title><content type='html'>If you're writing code that generates emails, you'll probably want to test it on real addresses, external to your office. One solution I've found useful in the past is to use one of the temporary email generators. Try &lt;a href="http://www.guerrillamail.com/"&gt;http://www.guerrillamail.com/&lt;/a&gt; or &lt;a href="http://10minutemail.com/10MinuteMail/index.html"&gt;http://10minutemail.com/10MinuteMail/index.html&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-4306111537939595731?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/4306111537939595731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=4306111537939595731' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4306111537939595731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/4306111537939595731'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2007/11/how-to-test-code-that-generates-email.html' title='How to Test Code that Generates Email'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-7368224416198065615</id><published>2007-11-10T10:49:00.000-08:00</published><updated>2007-11-10T13:14:41.424-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TechEd'/><title type='text'>Reflections of a Week at Tech Ed Developers</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1QQHTld1anE/RzYR6aqNLNI/AAAAAAAAAAc/NdC0cjU-mG4/s1600-h/TechEdEntrance.jpg"&gt;&lt;br /&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_1QQHTld1anE/RzYR6aqNLNI/AAAAAAAAAAc/NdC0cjU-mG4/s200/TechEdEntrance.jpg" alt="" id="BLOGGER_PHOTO_ID_5131308520721689810" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Got back home from Barcelona at about 2 am this morning. It's been an interesting week in many ways:&lt;ul&gt;&lt;li&gt;Flew out on the Sunday, having arrived at the airport just 10 minutes before the check-in desk closed (they closed the M4, resulting in massive delays and forcing us into detours and a few wrong turns)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;White-knuckle ride in the taxi from the airport to the hotel... felt just like we&lt;br /&gt;were living in a computer game!&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Clean hotel within easy walking distance of the conference centre (but why don't&lt;br /&gt;Spanish hotels have tea-making facilities in the rooms?) &lt;/li&gt;&lt;br /&gt;&lt;li&gt;Attended some very interesting and useful sessions, including:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;debugging in a production environment (ie. without Visual Studio)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;hidden gems in ASP.NET 2.0&lt;/li&gt;&lt;br /&gt;&lt;li&gt;how to make phones ring in code&lt;/li&gt;&lt;br /&gt;&lt;li&gt;continuous integration&lt;/li&gt;&lt;br /&gt;&lt;li&gt;top 10 mistakes developers make&lt;/li&gt;&lt;br /&gt;&lt;li&gt;XNA game development&lt;/li&gt;&lt;br /&gt;&lt;li&gt;embedded development (.NET on a chip!)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;how to make your T-SQL code a gazillion times more efficient in certain scenarios&lt;/li&gt;&lt;br /&gt;&lt;li&gt;extreme XSLT&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Got to experience a &lt;a href="http://www.iserializable.com/"&gt;Roy Osherove&lt;/a&gt; ditty first hand :)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1QQHTld1anE/RzYWVaqNLQI/AAAAAAAAAA0/cqOZAfqaRwE/s1600-h/RoyOsheroveGuitar.jpg"&gt;&lt;br /&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_1QQHTld1anE/RzYWVaqNLQI/AAAAAAAAAA0/cqOZAfqaRwE/s200/RoyOsheroveGuitar.jpg" alt="" id="Img1" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Took rather too much advantage of the free bar at the country drinks night and had to miss the first session the following day as a result (whoops)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1QQHTld1anE/RzYUQKqNLOI/AAAAAAAAAAk/FDvtaxdoBc0/s1600-h/PartyTable.jpg"&gt;&lt;br /&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_1QQHTld1anE/RzYUQKqNLOI/AAAAAAAAAAk/FDvtaxdoBc0/s200/PartyTable.jpg" alt="" id="Img2" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Won a remote-controlled helicopter&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Bagged some swag (including four t-shirts, a stack of magazines, various software&lt;br /&gt;goodies, a good book on the security development lifecycle, and, of course, the delegate bag)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Through the week, actually got to hold some real conversation in Spanish&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Flight on the way home delayed due to wranglings between the airline and the Spanish immigration authorities over a deported a passenger&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;On the whole, it was a very worthwhile and genuinely useful event. However, I couldn't help noticing differences between this year's event and the one I attended in 2005. There was less of a wow factor this time (check out the 2005 video, if you can find a copy, to see what I mean). There were also fewer giveaways and leaner facilities (most noticeable was the lack of VOIP, an overall event party and key Microsoft software). I presume these changes are due to the developer event now being separate from the IT professional event and therefore the budget having to be spread more thinly. Additionally, I preferred the old format of four days, plus a pre-conference day. This year, it felt like a four-and-a-half-day event.&lt;br /&gt;&lt;br /&gt;One welcome improvement over the 2005 event is the introduction of proper videos of the sessions. These are likely to be a very useful resource and more engaging than screencasts.&lt;br /&gt;&lt;br /&gt;Adios amigos.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-7368224416198065615?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/7368224416198065615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=7368224416198065615' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7368224416198065615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7368224416198065615'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2007/11/reflections-of-week-at-tech-ed.html' title='Reflections of a Week at Tech Ed Developers'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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://3.bp.blogspot.com/_1QQHTld1anE/RzYR6aqNLNI/AAAAAAAAAAc/NdC0cjU-mG4/s72-c/TechEdEntrance.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-6021428158290099045</id><published>2007-10-11T02:57:00.000-07:00</published><updated>2008-01-30T13:20:14.220-08:00</updated><title type='text'>Generating Custom Configuration Section in web.config</title><content type='html'>The following tool on dmitryr's blog generates the code to implement a custom configuration section in web.config:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/dmitryr/archive/2005/12/07/501365.aspx"&gt;http://blogs.msdn.com/dmitryr/archive/2005/12/07/501365.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It also generates the schema to give you IntelliSense support.&lt;br /&gt;&lt;br /&gt;Not yet used it myself, but looks like it could be useful.&lt;br /&gt;&lt;br /&gt;[&lt;strong&gt;Edit 30/1/2008&lt;/strong&gt;: I&amp;rsquo;ve added a new post detailing how to implement custom sections yourself without needing to use a tool. See: &lt;a href="http://dotnetnutty.blogspot.com/2008/01/generating-custom-configuration.html"&gt;http://dotnetnutty.blogspot.com/2008/01/generating-custom-configuration.html&lt;/a&gt;]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-6021428158290099045?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/6021428158290099045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=6021428158290099045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6021428158290099045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6021428158290099045'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2007/10/generating-custom-configuration-section.html' title='Generating Custom Configuration Section in web.config'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-6744277983642856937</id><published>2007-07-04T12:19:00.000-07:00</published><updated>2008-02-01T07:45:52.128-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='regular expressions'/><category scheme='http://www.blogger.com/atom/ns#' term='validation'/><title type='text'>How to Set the Maximum Length of a MultiLine TextBox</title><content type='html'>The MaxLength property of a TextBox control has no effect when the TextMode is set to MultiLine. The reason for this is that a MultiLine TextBox is rendered as a &amp;lt;textarea&amp;gt; tag, which does not have a maximum length attribute:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;textarea name="txtComments" rows="2" cols="20" id="txtComments"&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In contrast, a TextBox with its TextMode set to SingleLine is rendered as an &amp;lt;input&amp;gt; tag, which has the maxlength attribute:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;input name="txtComments" type="text" maxlength="5" id="txtComments" /&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If you wish to restrict the amount of text in a MultiLine TextBox, the workaround is to use a RegularExpressionValidator control. In the following example, the validation expression allows between 0 and 5 alphanumeric characters to be entered:&lt;br /&gt;&lt;br /&gt;&lt;div    style="background: white none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-family:Courier New;font-size:10pt;color:black;"&gt; &lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;   &lt;/span&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; strMaxLength = &lt;span style="color:maroon;"&gt;"5"&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;   &lt;/span&gt;revComments.ValidationExpression = &lt;span style="color:maroon;"&gt;"\\w{0,"&lt;/span&gt; + strMaxLength + &lt;span style="color:maroon;"&gt;"}$"&lt;/span&gt;;&lt;/p&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-6744277983642856937?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/6744277983642856937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=6744277983642856937' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6744277983642856937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6744277983642856937'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2007/07/how-to-set-maximum-length-of-multiline.html' title='How to Set the Maximum Length of a MultiLine TextBox'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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-4228744319574131817.post-6095814860525438220</id><published>2007-07-01T12:34:00.001-07:00</published><updated>2008-02-01T07:45:27.130-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='authentication'/><title type='text'>Always Use Response.End() After FormsAuthentication.RedirectToLoginPage()</title><content type='html'>Here's something else that wasn't immediately apparent to me:&lt;br /&gt;&lt;br /&gt;If you’re using &lt;span style=";font-family:Courier New;font-size:85%;color:teal;"   &gt;&lt;span style=""&gt;FormsAuthentication&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style=""&gt;.RedirectToLoginPage()&lt;/span&gt;&lt;/span&gt; to direct unauthenticated users to a login page, you &lt;strong&gt;must&lt;/strong&gt; follow that statement with a &lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style=""&gt;Response.End()&lt;/span&gt;&lt;/span&gt; if the page would otherwise continue loading content. Although the code appears to branch, the redirect does not stop the execution of the rest of the page.&lt;br /&gt;&lt;br /&gt;Redirects appear to work fine in a browser (and would pass all UI tests). They issue an “object moved” status, causing the browser to reload a new page. However, this reload relies on the client’s browser taking this action. If you inspect the response (eg. using telnet), you'll see that when browsing to a protected page, which has the redirect in the Page_Load handler, the “object moved” flag is correctly set, but the content following &lt;span style=";font-family:Courier New;font-size:85%;color:teal;"   &gt;&lt;span style=""&gt;FormsAuthentication&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style=""&gt;.RedirectToLoginPage()&lt;/span&gt;&lt;/span&gt; continues to be output, completely negating the purpose of log-in.&lt;br /&gt;&lt;br /&gt;The solution is to add &lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style=""&gt;Response.End()&lt;/span&gt;&lt;/span&gt; after the redirect. The output is then correctly terminated as the following telnet session shows (click on the image to view it in full):&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1QQHTld1anE/RogCItwZAKI/AAAAAAAAAAU/90y7zjrqcw0/s1600-h/responseend.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 367px; height: 168px;" src="http://2.bp.blogspot.com/_1QQHTld1anE/RogCItwZAKI/AAAAAAAAAAU/90y7zjrqcw0/s320/responseend.jpg" alt="Screen shot of a command line telnet session" id="BLOGGER_PHOTO_ID_5082314528232374434" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-6095814860525438220?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/6095814860525438220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=6095814860525438220' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6095814860525438220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/6095814860525438220'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2007/07/always-use-responseend-after.html' title='Always Use Response.End() After FormsAuthentication.RedirectToLoginPage()'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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://2.bp.blogspot.com/_1QQHTld1anE/RogCItwZAKI/AAAAAAAAAAU/90y7zjrqcw0/s72-c/responseend.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4228744319574131817.post-7676142887181795160</id><published>2007-07-01T11:37:00.000-07:00</published><updated>2008-01-31T01:11:37.470-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IE'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='authentication'/><title type='text'>Do Not Use Underscores in Host Names</title><content type='html'>As part of a recent development task, I’d written some code to log users in to an extranet. It worked fine in Firefox, but when used in IE, it kept redirecting users back to the login screen. Debugging showed that users were being successfully authenticated, but that this was being lost as soon as the user tried to navigate to another page. After a long and painful process and the enlisting of help from colleagues, the problem was traced to an underscore in the host name (ie. the hosts file had an entry similar to “127.0.0.1 my_site.com”). Is was only half chance that the culprit was discovered—we tried to add a host header in IIS and it complained about invalid characters.&lt;br /&gt;&lt;br /&gt;It took about three days of project time and much hair-pulling to pin down this obscure issue. One to note!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4228744319574131817-7676142887181795160?l=www.neilpullinger.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.neilpullinger.co.uk/feeds/7676142887181795160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4228744319574131817&amp;postID=7676142887181795160' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7676142887181795160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4228744319574131817/posts/default/7676142887181795160'/><link rel='alternate' type='text/html' href='http://www.neilpullinger.co.uk/2007/07/do-not-use-underscores-in-host-names.html' title='Do Not Use Underscores in Host Names'/><author><name>Neil Pullinger</name><uri>http://www.blogger.com/profile/05857874891020321562</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></feed>
