<?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-1459592328824472712</id><updated>2011-12-12T10:12:20.843-08:00</updated><category term='images'/><category term='Printing'/><category term='DataGridView'/><category term='dll'/><category term='Rijndael'/><category term='Wordpress'/><category term='AES'/><category term='Lucene'/><category term='SQL'/><category term='Email'/><category term='Outlook'/><category term='SQL Server'/><category term='Visual Studio 2005'/><category term='command prompt'/><category term='AJAX'/><category term='TinyMCE'/><category term='file comparison'/><category term='modalpopupextender'/><category term='Skype'/><category term='ASP.NET'/><category term='c#'/><category term='Web Development'/><category term='Flash'/><category term='Mathematics'/><category term='IFrame'/><category term='Virus'/><category term='HTML Name Attribute'/><category term='FileInfo'/><category term='List'/><category term='.net'/><category term='dumb moments'/><category term='.htaccess'/><category term='CompareValidator'/><category term='xp'/><category term='comments'/><category term='checkbox'/><category term='MySQL'/><category term='phpBB'/><category term='Opticians'/><category term='deployment'/><category term='web crawling'/><category term='PHP.INI'/><category term='lambda'/><category term='file system'/><category term='IIS'/><category term='book'/><category term='wpa'/><category term='webservice'/><category term='regex'/><category term='PHP'/><category term='etag'/><category term='tags'/><category term='Sothink'/><category term='WCF'/><category term='XPath'/><category term='System Hanging'/><category term='IsNumeric'/><category term='HTML'/><category term='wep'/><category term='IE'/><category term='JavaScript'/><category term='XML Error'/><category term='masterpages'/><title type='text'>Things that make you go "Hmmmm"</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>53</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-6795739306525656699</id><published>2011-11-22T10:33:00.000-08:00</published><updated>2011-11-22T10:37:01.798-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wordpress'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP.INI'/><title type='text'>Wordpress php.ini settings to load external url</title><content type='html'>A friend of mine had an issue with a vanilla wordpress install that he had that was using a premium theme. &lt;br /&gt;&lt;br /&gt;Upon loading the theme, the page showed many errors relating to servers security setting would not allow the loading of data from external urls.&lt;br /&gt;&lt;br /&gt;The information we were given was to set the php.ini in the directory of the calling page, so that the setting could be overridden - so we did, no change.&lt;br /&gt;&lt;br /&gt;The solution is that the php.ini file in the wp-admin folder needs setting, not in the calling page, because the calling page in this case is a settings page itself that is being imported into the wp-admin/index.php file.&lt;br /&gt;&lt;br /&gt;The settings in php.ini are then:&lt;br /&gt;&lt;br /&gt;allow_url_fopen = 1&lt;br /&gt;allow_url_include = 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-6795739306525656699?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/6795739306525656699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2011/11/wordpress-phpini-settings-to-load.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/6795739306525656699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/6795739306525656699'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2011/11/wordpress-phpini-settings-to-load.html' title='Wordpress php.ini settings to load external url'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-3877503023770914079</id><published>2011-05-04T06:35:00.000-07:00</published><updated>2011-05-04T06:47:17.281-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Opticians'/><category scheme='http://www.blogger.com/atom/ns#' term='.htaccess'/><title type='text'>PHP .htaccess redirect</title><content type='html'>I have been helping a neighbour of mine who is an Optician in Spalding, and he was trying to make sure that when people were searching for "&lt;a href="http://www.molsom.co.uk" title="Molsom Associates, Opticians in Spalding"&gt;Opticians in Spalding&lt;/a&gt;" they would make sure that the old pages on his website that were already listed in Google, would still link through to his new site that he's spent ages on.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Being a windows server man, I know how to do this in IIS, but as his new website is hosted on a linux server, it needed to be compatible with that. So anyway, I found out that you can do 301 redirects on Apache using a .htaccess file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this case, it was real simple, create a blank file called .htaccess and the place an entry for each for each file that needs redirecting, i.e:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Redirect 301 /HTML/Consultations.htm &lt;a href="http://www.molsom.co.uk/eye-tests.htm" title="Eye tests in Spalding"&gt;http://www.molsom.co.uk/eye-tests.htm&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Excellent, and I now know that visitors to my &lt;a href="http://www.molsom.co.uk/about-us.htm" title="Molsom Associates"&gt;local Optician in Spalding&lt;/a&gt; will still get there from any old bookmarks!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-3877503023770914079?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/3877503023770914079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2011/05/php-htaccess-redirect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3877503023770914079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3877503023770914079'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2011/05/php-htaccess-redirect.html' title='PHP .htaccess redirect'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-546707416508971138</id><published>2011-03-01T08:27:00.000-08:00</published><updated>2011-03-01T08:31:16.506-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='deployment'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='dll'/><title type='text'>EventType clr20r3 system.io.filenotfoundexception</title><content type='html'>I had this error today when trying to launch a .net application on a remote host machine. The file io exception threw me somewhat as it made me think that the issue was with loading a config file.&lt;br /&gt;&lt;br /&gt;In fact the culprit of this error was not the config files, it was in fact missing dlls that are normally referenced from the GAC.&lt;br /&gt;&lt;br /&gt;As I had no idea which dll it didn't know about, I just set each dlls reference to say copy to local = true, and then deployed the whole contents.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-546707416508971138?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/546707416508971138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2011/03/eventtype-clr20r3-systemiofilenotfounde.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/546707416508971138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/546707416508971138'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2011/03/eventtype-clr20r3-systemiofilenotfounde.html' title='EventType clr20r3 system.io.filenotfoundexception'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-1779490054438821717</id><published>2010-12-22T04:47:00.000-08:00</published><updated>2010-12-22T04:50:47.469-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lambda'/><category scheme='http://www.blogger.com/atom/ns#' term='List'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>List.Sort() alphabetically</title><content type='html'>I was faced with the challenge today of sorting a list of objects, where one of the properties was a string. My objects were lists of keywords, and I wanted to sort the keywords alphabetically.&lt;br /&gt;&lt;br /&gt;I came across some example of lambda expressions, and found that rather than having to write complicated sort methods for my class, I could just do the following:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;keywords.Sort((a,b) =&gt; String.Compare(a.keyword, b.keyword)):&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Awesome, works a treat!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-1779490054438821717?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/1779490054438821717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2010/12/list-sort-alphabetically.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/1779490054438821717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/1779490054438821717'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2010/12/list-sort-alphabetically.html' title='List&lt;T&gt;.Sort() alphabetically'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-2708370241941501833</id><published>2010-11-24T01:08:00.000-08:00</published><updated>2010-11-24T01:11:55.786-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.</title><content type='html'>I encountered this error this morning when my SQL Server instance wouldn't start after I made some connection changes yesterday. I had to make the changes because a needed an ODBC connection, and that would only seem to work if I configured it to use named pipes.&lt;br /&gt;&lt;br /&gt;After checking the logs, I received the error "SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.".&lt;br /&gt;&lt;br /&gt;So, I went back to undo each change I had made, and noticed that the last change I made was to enable VIA as a protocol for my SQL Server instance. Disabled that, and hey presto, SQL Server now starts fine.&lt;br /&gt;&lt;br /&gt;The strange thing is that enabling VIA in my SQL Express instance didn't seem to cause the same issue on that server though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-2708370241941501833?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/2708370241941501833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2010/11/sql-server-could-not-spawn-fruncm.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2708370241941501833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2708370241941501833'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2010/11/sql-server-could-not-spawn-fruncm.html' title='SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-1647447737849381631</id><published>2010-04-27T04:45:00.001-07:00</published><updated>2010-04-27T04:51:30.438-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='checkbox'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='modalpopupextender'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>asp.net checkbox modalpopupextender checkbox doesn't check or uncheck</title><content type='html'>There is an apparent bug in asp.net that when you have a checkbox inside a panel that is acting as a modal popup with the modalpopupextender, that when you try to check or uncheck it, it doesn't work!&lt;br /&gt;&lt;br /&gt;I found the &lt;a href="http://forums.asp.net/p/1072619/1568169.aspx"&gt;following thread&lt;/a&gt;, and it seems that quite a few people have had this very same problem.&lt;br /&gt;&lt;br /&gt;From reading many posts, it seems that this happens if you do not set the TargetControlID property of the extender correctly.&lt;br /&gt;&lt;br /&gt;However, this becomes an issue if you have multiple links, all that show the same extender. To get round this, you can simply create a fake button:&lt;br /&gt;&lt;br /&gt;&lt;asp:button id="btnFakeButton" runat="server" style="display:none;"&gt;&lt;br /&gt;&lt;br /&gt;And then in your modal extender, set TargetControlID="btnFakeButton". With your links / buttons to active this, simply in the code behind for the event for each link / button, do mdlExample.Show() to display the modal.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-1647447737849381631?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/1647447737849381631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2010/04/aspnet-checkbox-modalpopupextender.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/1647447737849381631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/1647447737849381631'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2010/04/aspnet-checkbox-modalpopupextender.html' title='asp.net checkbox modalpopupextender checkbox doesn&apos;t check or uncheck'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-8802798908226937268</id><published>2010-04-27T03:33:00.000-07:00</published><updated>2010-04-27T03:40:20.087-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>asp.net button not posting back</title><content type='html'>I have a modalpopup extender attached to a panel, inside which resides two asp.net buttons. Each of these had the normal "Onclick" attribute assigned to them. However, when they were clicked, no postback was occuring.&lt;br /&gt;&lt;br /&gt;From some reading around, it appears that this is by design, and that the buttons are there for this to be closed.&lt;br /&gt;&lt;br /&gt;So how do you get round this?&lt;br /&gt;&lt;br /&gt;You can attach a javscript client side event that mimmicks the behaviour of what happens with asp anyway, by forcing the postback to take place.&lt;br /&gt;&lt;br /&gt;Firstly, in the head of your page, define a function that ensures that the page is valid first, and then causes the postback to take place (the validation part is crucial for this to work.&lt;br /&gt;&lt;br /&gt;function doPostback(sender,e)&lt;br /&gt;{&lt;br /&gt;if(Page_IsValid)&lt;br /&gt;{&lt;br /&gt;__doPostback(sender,e);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now in your code behind, tell your buttons to call this:&lt;br /&gt;&lt;br /&gt;btnSaveUserDetails.OnClientClick = "javascript:return doPostback('" + btnSaveUserDetails.UniqueID + "');";&lt;br /&gt;&lt;br /&gt;It is important here that the uniqueID is used, as this ensures that any controls that are nested pass the right details to the postback function.&lt;br /&gt;&lt;br /&gt;And ta da, they now work!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-8802798908226937268?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/8802798908226937268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2010/04/aspnet-button-not-posting-back.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/8802798908226937268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/8802798908226937268'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2010/04/aspnet-button-not-posting-back.html' title='asp.net button not posting back'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-3704946670829636600</id><published>2010-04-26T06:35:00.000-07:00</published><updated>2010-04-26T06:37:23.903-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='modalpopupextender'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>modalpopupextender event fires but does not show</title><content type='html'>I lost half a day of my life to this silly mistake today.&lt;br /&gt;&lt;br /&gt;I had on my page a panel, with a modal popupextender. When I clicked a link that ran a serverside mdlPopup.show() or a client side $('mdlPopup').show(), the events fired, but no modal popup showed.&lt;br /&gt;&lt;br /&gt;The reason for this was because I had set the "visible" attribute of my panel to "false", rather than setting the style of it to "display:none"!&lt;br /&gt;&lt;br /&gt;Silly....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-3704946670829636600?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/3704946670829636600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2010/04/modalpopupextender-event-fires-but-does.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3704946670829636600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3704946670829636600'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2010/04/modalpopupextender-event-fires-but-does.html' title='modalpopupextender event fires but does not show'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-3420398396172437233</id><published>2010-03-30T04:37:00.001-07:00</published><updated>2010-03-30T04:41:40.918-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Skype'/><title type='text'>The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)</title><content type='html'>When starting IIS 7 under Vista or Windows 7, you receive the error from the IIS Manager saying "The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)"&lt;br /&gt;&lt;br /&gt;The reason for this is well documented, and it is because you have another site setup with the same binding - in english, this means you have two sites setup that are configured to use the same port (probably 80).&lt;br /&gt;&lt;br /&gt;In my circumstances, this was confusing because I had only one IIS instance and this was bound to port 80, but wouldn't start.&lt;br /&gt;&lt;br /&gt;So, to find out what was conflicting, I went to the command prompt and typed:&lt;br /&gt;&lt;br /&gt;NETSTAT -ano&lt;br /&gt;&lt;br /&gt;This showed an entry of address 0.0.0.0 using port 80 up!&lt;br /&gt;&lt;br /&gt;This also showed the process ID of 4400, so I looked in task manager and found that this was Skype.exe&lt;br /&gt;&lt;br /&gt;After digging through the advanced settings in Skype, it appears that by default, Skype decides to listen on ports 80 and 443 for incoming connections (probably to appeas firewalls), so unticking this allowed my IIS to start.&lt;br /&gt;&lt;br /&gt;Useful to find out, but it took a while!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-3420398396172437233?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/3420398396172437233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2010/03/process-cannot-access-file-because-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3420398396172437233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3420398396172437233'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2010/03/process-cannot-access-file-because-it.html' title='The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-1175020413549348179</id><published>2010-01-05T05:53:00.000-08:00</published><updated>2010-01-05T05:55:08.746-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IE'/><category scheme='http://www.blogger.com/atom/ns#' term='Printing'/><title type='text'>ie don't print filename</title><content type='html'>I needed to convert a webpage into a pdf today, and using PDFCreator, this is normally a doddle.&lt;br /&gt;&lt;br /&gt;However, whenever I did, it printed the address to the footer of the page.&lt;br /&gt;&lt;br /&gt;After much faffing around, I found that under the page setup are "headers" and "footers". If you delete what is in those fields, it stop ie and firefox printing the filenames and page numbers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-1175020413549348179?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/1175020413549348179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2010/01/ie-dont-print-filename.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/1175020413549348179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/1175020413549348179'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2010/01/ie-dont-print-filename.html' title='ie don&apos;t print filename'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-2150092188906555774</id><published>2010-01-04T05:25:00.001-08:00</published><updated>2010-01-04T05:28:26.430-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XPath'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>XPath select attributes containing a string</title><content type='html'>I needed to find a way to use XPath to select items from within a html document, that would return back to me all UL tags that had an id that contained the word "menu".&lt;br /&gt;&lt;br /&gt;To find all the UL's, it is simple enough to do:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;//UL&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;However, to select the id of "menu", I then found:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;//ul[@id='menu']&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;What I ended up with, to find any ULs that contained the word "menu" in the id attribute was:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;//ul[contains(@id,'menu')]&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-2150092188906555774?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/2150092188906555774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2010/01/xpath-select-attributes-containing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2150092188906555774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2150092188906555774'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2010/01/xpath-select-attributes-containing.html' title='XPath select attributes containing a string'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-199038350970954576</id><published>2009-12-31T03:01:00.000-08:00</published><updated>2009-12-31T03:03:55.022-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Reset AutoIncrement Number in MySQL</title><content type='html'>To reset your autoincrement number, you can simply run the following SQL:&lt;br /&gt;&lt;br /&gt;ALTER TABLE 'table_name' AUTO_INCREMENT = X&lt;br /&gt;&lt;br /&gt;Where X is the ID number you want to set the increment start point to, so running &lt;br /&gt;&lt;br /&gt;ALTER TABLE 'table_name' AUTO_INCREMENT = 0&lt;br /&gt;&lt;br /&gt;resets the ID increment process, and&lt;br /&gt;&lt;br /&gt;ALTER TABLE 'table_name' AUTO_INCREMENT = 1023&lt;br /&gt;&lt;br /&gt;Would set the start seed to 1023 - sometimes useful for making things looked "used", for example with order systems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-199038350970954576?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/199038350970954576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/12/reset-autoincrement-number-in-mysql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/199038350970954576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/199038350970954576'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/12/reset-autoincrement-number-in-mysql.html' title='Reset AutoIncrement Number in MySQL'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-3480476753590325906</id><published>2009-12-31T02:40:00.001-08:00</published><updated>2009-12-31T02:43:34.161-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='phpBB'/><title type='text'>Making changes to overall_header.php in phpBB do not take effect</title><content type='html'>I have been, for some time, trying to make changes to the code in the header file for phpBB. These were not changes for functionality, rather links required to other parts of the site.&lt;br /&gt;&lt;br /&gt;Anyway, I had made the changes locally in my local copy of the overall_header.php file of the prosilver theme, but I ftp'd them up, the changes didn't happen.&lt;br /&gt;&lt;br /&gt;Frustrated, I spent some time checking what phpBBs admin area said was in the file using the built in editor, and it said my changes were done.&lt;br /&gt;&lt;br /&gt;However, what it doesn't say is that once you've made any changes to page files or style documents, you have to run the PURGE ALL feature from the admin control panel to flush out cached copies!&lt;br /&gt;&lt;br /&gt;Ran that, and hey presto, fixed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-3480476753590325906?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/3480476753590325906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/12/making-changes-to-overallheaderphp-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3480476753590325906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3480476753590325906'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/12/making-changes-to-overallheaderphp-in.html' title='Making changes to overall_header.php in phpBB do not take effect'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-5359387813493385674</id><published>2009-12-17T07:00:00.000-08:00</published><updated>2009-12-17T08:23:39.069-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Email'/><title type='text'>Person [user@example.com] on behalf of Another Person [user@otherexample.com]</title><content type='html'>Today I had a query whereby a user was sending emails after outlook had been reinstalled, and was getting this in the emails he was sending, even if it was from his normal account.&lt;br /&gt;&lt;br /&gt;The problem seemed to be that the default email being sent from was incorrect, so setting the correct mailbox cured it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-5359387813493385674?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/5359387813493385674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/12/person-userexamplecom-on-behalf-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5359387813493385674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5359387813493385674'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/12/person-userexamplecom-on-behalf-of.html' title='Person [user@example.com] on behalf of Another Person [user@otherexample.com]'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-2940121030261718790</id><published>2009-11-17T07:58:00.000-08:00</published><updated>2009-11-17T08:14:53.585-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='AES'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='Rijndael'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>PHP C# WCF Rijndael</title><content type='html'>I have been working with .NET and webservices for some time, but a colleague of mine has now moved over to using WCF instead of basic webservices.&lt;br /&gt;&lt;br /&gt;After many, many problems dealing with simple soap message exchanges, we finally got our WCF service to talk to PHP (using NuSOAP) by setting the encoding to UTF8 and the binding to type basicHttpBinding.&lt;br /&gt;&lt;br /&gt;My next problem was why when I was encoding data using Rijndael, was the encoded data returned from WCF not being decoded by mcrypt in PHP correctly.&lt;br /&gt;&lt;br /&gt;Eventually, after some digging around, I found a really good article at http://benvanmol.blogspot.com/2009/10/secure-communication-between-net-and.html that summises the following points:&lt;br /&gt;&lt;br /&gt;• You need to enable padding in the .net rijndael class. This ensures any blocks are padded with 0’s to fill them. This is done with Padding.Zeros&lt;br /&gt;• Specifically set Cipher Block Chaining in the .Net class.&lt;br /&gt;• The Initialisation Vector (IV) needs to be 16 bytes.&lt;br /&gt;• You need to specifically set the encryption to the MD5 Hash algorithm, and change this to return the 32 character hash.&lt;br /&gt;• Setup base64 encoding either end.&lt;br /&gt;&lt;br /&gt;So, from this article by Ben van Mol I was able to produce a class from his code as follows:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public class PhpRijndael&lt;br /&gt;    {&lt;br /&gt;         System.Security.Cryptography.Rijndael r = null;&lt;br /&gt;&lt;br /&gt;        public void InitializePhpRijndael(string iv, string key,int blockSize)&lt;br /&gt;        {&lt;br /&gt;            byte[] keyBytes = Encoding.ASCII.GetBytes(EncodeTo64(key));&lt;br /&gt;            byte[] hash = MD5.Create().ComputeHash(keyBytes);&lt;br /&gt;            string ret = "";&lt;br /&gt;            foreach (byte a in hash)&lt;br /&gt;            {&lt;br /&gt;                ret += a.ToString("x2");&lt;br /&gt;            }&lt;br /&gt;            string iv64 = EncodeTo64(iv);&lt;br /&gt;            byte[] ivBytes = Convert.FromBase64String(iv64);&lt;br /&gt;&lt;br /&gt;            r = System.Security.Cryptography.Rijndael.Create();&lt;br /&gt;&lt;br /&gt;            r.Padding = PaddingMode.Zeros;&lt;br /&gt;            r.BlockSize = blockSize;&lt;br /&gt;            r.Key = Encoding.ASCII.GetBytes(ret);&lt;br /&gt;            r.IV = ivBytes;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public string Decrypt(string str)&lt;br /&gt;        {&lt;br /&gt;            byte[] encryptedBytes = Convert.FromBase64String(str);&lt;br /&gt;            byte[] decryptedBytes = transformBytes(&lt;br /&gt;                r.CreateDecryptor(), encryptedBytes);&lt;br /&gt;&lt;br /&gt;            string plaintext = Encoding.ASCII.GetString(decryptedBytes);&lt;br /&gt;            int idx = plaintext.IndexOf("\0");&lt;br /&gt;            if (idx &gt; -1)&lt;br /&gt;                plaintext = plaintext.Substring(0, idx);&lt;br /&gt;&lt;br /&gt;            return plaintext;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public string Encrypt(string plaintext)&lt;br /&gt;        {&lt;br /&gt;            byte[] plainBytes = Encoding.ASCII.GetBytes(plaintext);&lt;br /&gt;            byte[] encryptedBytes = transformBytes(&lt;br /&gt;                r.CreateEncryptor(), plainBytes);&lt;br /&gt;&lt;br /&gt;            return Convert.ToBase64String(encryptedBytes);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private byte[] transformBytes(ICryptoTransform transform,&lt;br /&gt;            byte[] plainBytes)&lt;br /&gt;        {&lt;br /&gt;            MemoryStream memStream = new MemoryStream();&lt;br /&gt;            CryptoStream cryptStream =&lt;br /&gt;                new CryptoStream(memStream, transform,&lt;br /&gt;                CryptoStreamMode.Write);&lt;br /&gt;            cryptStream.Write(plainBytes, 0, plainBytes.Length);&lt;br /&gt;            cryptStream.Close();&lt;br /&gt;            byte[] encryptedBytes = memStream.ToArray();&lt;br /&gt;            memStream.Close();&lt;br /&gt;&lt;br /&gt;            return encryptedBytes;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private string EncodeTo64(string toEncode)&lt;br /&gt;        {&lt;br /&gt;            byte[] toEncodeAsBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(toEncode);&lt;br /&gt;            string returnValue = System.Convert.ToBase64String(toEncodeAsBytes);&lt;br /&gt;&lt;br /&gt;            return returnValue;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In WCF I expose this in my endpoint as:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;private string passPhrase = "secret";                &lt;br /&gt;private string initVector = "ujkrtadxcfrzpj1Bs5fpM18doZQDGYS4";        &lt;br /&gt;private int keySize = 256;&lt;br /&gt;&lt;br /&gt;public string EncryptData(string value)&lt;br /&gt;        {&lt;br /&gt;            &lt;br /&gt;           PhpRijndael r = new PhpRijndael();&lt;br /&gt;           r.InitializePhpRijndael(initVector, passPhrase, keySize);&lt;br /&gt;           string ret = "";&lt;br /&gt;           ret = r.Encrypt(value);&lt;br /&gt;           return ret;&lt;br /&gt;        }&lt;br /&gt;        public string ReturnTestData()&lt;br /&gt;        {&lt;br /&gt;            return EncryptData("Test Encrypted Data");&lt;br /&gt;        }&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Note: Both of these are expose on the interface as OperationContracts inside the ServiceContract.&lt;br /&gt;&lt;br /&gt;Now, in the PHP world, we need to create a page to call this, so inside a normal html form, we do the following:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;if( isset($_POST['Submit']) )&lt;br /&gt;{&lt;br /&gt;//Show me all errors please&lt;br /&gt;error_reporting(E_ALL);&lt;br /&gt;ini_set('display_errors', '1');&lt;br /&gt;//load nusoap&lt;br /&gt;require_once('../lib/nusoap.php');&lt;br /&gt;//client config to CZ&lt;br /&gt;$client = new nusoap_client('http://example/Service?wsdl',true);&lt;br /&gt;$client-&gt;setEndpoint("http://example/Service/EndpointName");&lt;br /&gt;$client-&gt;setUseCurl(0);&lt;br /&gt;//set utf-8, or else it breaks.&lt;br /&gt;$client-&gt;soap_defencoding='UTF-8';&lt;br /&gt;$client-&gt;setDebugLevel( 1 );&lt;br /&gt;//any errors?&lt;br /&gt;$err = $client-&gt;getError();&lt;br /&gt;if ($err) {&lt;br /&gt; echo '&lt;h2&gt;Constructor error&lt;/h2&gt;&lt;pre&gt;' . $err . '&lt;/pre&gt;';&lt;br /&gt; echo '&lt;h2&gt;Debug&lt;/h2&gt;&lt;pre&gt;' . htmlspecialchars($client-&gt;getDebug(), ENT_QUOTES) . '&lt;/pre&gt;';&lt;br /&gt; exit();&lt;br /&gt;}&lt;br /&gt;// This is a paramter list that can be used later, but not used at the moment&lt;br /&gt;$params = array(&lt;br /&gt;    'value' =&gt; "666"&lt;br /&gt;);&lt;br /&gt;//Call dummy method for some test info&lt;br /&gt;$result = $client-&gt;call('ReturnTestData',$params);&lt;br /&gt;//is there a fault?&lt;br /&gt;if ($client-&gt;fault) {&lt;br /&gt; echo '&lt;h2&gt;Fault&lt;/h2&gt;&lt;pre&gt;'; print_r($result); echo '&lt;/pre&gt;';&lt;br /&gt;} else {&lt;br /&gt; $err = $client-&gt;getError();&lt;br /&gt; if ($err) {&lt;br /&gt;  echo '&lt;h2&gt;Error&lt;/h2&gt;&lt;pre&gt;' . $err . '&lt;/pre&gt;';&lt;br /&gt; } else {&lt;br /&gt;  echo '&lt;h2&gt;Result&lt;/h2&gt;&lt;pre&gt;'; print_r($result); echo '&lt;/pre&gt;';&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//decode the base sixty four encoded data returned &lt;br /&gt;$bsf = base64_decode(trim($result["ReturnTestDataResult"]));&lt;br /&gt;&lt;br /&gt;//setup auth&lt;br /&gt;$key = 'secret';   &lt;br /&gt;$iv='ujkrtadxcfrzpj1Bs5fpM18doZQDGYS4';  &lt;br /&gt;&lt;br /&gt;//a function to configure Rijndael from the afforementioned article &lt;br /&gt;function init_rijndael ($key,$iv) {   &lt;br /&gt; $rj = mcrypt_module_open('rijndael-256', '', 'cbc', '');   &lt;br /&gt; if ($rj !== FALSE)   &lt;br /&gt; {   &lt;br /&gt;   $expected_key_size = mcrypt_enc_get_key_size($rj);   &lt;br /&gt;     &lt;br /&gt;   $key = substr(md5(base64_encode($key)), 0, $expected_key_size);   &lt;br /&gt;      &lt;br /&gt;   mcrypt_generic_init($rj, $key, $iv);   &lt;br /&gt; }   &lt;br /&gt; return $rj;   &lt;br /&gt;}&lt;br /&gt;//setup Rijndael&lt;br /&gt;$rj = init_rijndael($key,$iv);   &lt;br /&gt;  &lt;br /&gt;//decrypt result&lt;br /&gt;$decryptedResult = mdecrypt_generic($rj, $bsf);&lt;br /&gt;//print out.&lt;br /&gt;echo '&lt;h2&gt;Result&lt;/h2&gt;&lt;pre&gt;'; echo($decryptedResult); echo '&lt;/pre&gt;';  &lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And hey presto - finally! a working php to WCF communication in Rijndael!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-2940121030261718790?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/2940121030261718790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/11/php-c-wcf-rijndael.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2940121030261718790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2940121030261718790'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/11/php-c-wcf-rijndael.html' title='PHP C# WCF Rijndael'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-2920455450455375181</id><published>2009-11-06T04:34:00.000-08:00</published><updated>2009-11-06T06:58:36.148-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Virus'/><title type='text'>203.117.91.73 sdra64.exe</title><content type='html'>My eset firewall started complaining last night about connections going outbound to the IP address 203.117.91.73&lt;br /&gt;&lt;br /&gt;After a call to ESET, I found out that that I had a trojan virus called sdra64.exe on my machine!&lt;br /&gt;&lt;br /&gt;How do you get rid of it?&lt;br /&gt;&lt;br /&gt;The guy from ESET firstly check for the virus using a program called RootAlyzer. This confirmed the infection. Next he downloaded procexp.exe from Microsoft to see what dependancies sdra64.exe had. Using another program called Process Unloader, he then closed the handles to sdra64.exe, and all files located in c:\windows\system32\lowsec. Once this was done, he created blank executable from notepad, and overwrote sdra64.exe, then deleted the lowsec folder.&lt;br /&gt;&lt;br /&gt;Finally, in the registry under windowsnt\winlogon, he removed the reference to sdra64.exe in the userinit key.&lt;br /&gt;&lt;br /&gt;A nasty little beast of a virus, and apparently acquired randomly from visiting a website!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-2920455450455375181?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/2920455450455375181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/11/2031179173-sdra64exe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2920455450455375181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2920455450455375181'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/11/2031179173-sdra64exe.html' title='203.117.91.73 sdra64.exe'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-4686465027861655455</id><published>2009-10-22T05:14:00.000-07:00</published><updated>2009-10-22T05:24:20.485-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='command prompt'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Error: CryptCertStrToNameW failed =&gt; 0x80092023 (-2146885597)</title><content type='html'>I was following a guide today on WCF and using makecert to create self signed certificates e.g. makecert –n "CN-FakeRootCA” –r –sv FakeRootCA.pvk FakeRootCA.cer&lt;br /&gt;&lt;br /&gt;Whenever I tried to create the certificate, I got the error &lt;br /&gt;Error: CryptCertStrToNameW failed =&gt; 0x80092023 (-2146885597)&lt;br /&gt;&lt;br /&gt;The reason for this was the version of makecert being used was an old version. Even though I was running it from the visual studio 2008 command prompt, the environment mappings were causing it to run version 5.1, instead of version 6.&lt;br /&gt;&lt;br /&gt;Using windows search I found that the latest version is at:&lt;br /&gt;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin&lt;br /&gt;&lt;br /&gt;So you can either makecert from this directory, or alter you path variables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-4686465027861655455?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/4686465027861655455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/10/error-cryptcertstrtonamew-failed.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4686465027861655455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4686465027861655455'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/10/error-cryptcertstrtonamew-failed.html' title='Error: CryptCertStrToNameW failed =&gt; 0x80092023 (-2146885597)'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-3104129760735537661</id><published>2009-10-16T06:46:00.000-07:00</published><updated>2009-10-16T06:52:55.912-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.FormatException: Invalid character</title><content type='html'>I started receiving these errors a couple of weeks ago, very randomly, and always reporting a fault with ScriptResource.axd and a strange parameter being passed as "d" as a querystring to it.&lt;br /&gt;&lt;br /&gt;After some reading around, I eventually came across the following thread that was dicussing the issue.&lt;br /&gt;&lt;br /&gt;https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=434997&lt;br /&gt;&lt;br /&gt;The end of the thread, dated 12/10/09 states that this is a bug in IE8 that is hopefully going to be fixed soon, and that it doesn't affect the end users view of the site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-3104129760735537661?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/3104129760735537661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/10/systemreflectiontargetinvocationexcepti.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3104129760735537661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3104129760735537661'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/10/systemreflectiontargetinvocationexcepti.html' title='System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.FormatException: Invalid character'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-3165546278308390721</id><published>2009-06-29T01:12:00.000-07:00</published><updated>2009-06-29T01:28:14.552-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='comments'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>ASP.NET Ajax document.getElementById is null or not an object</title><content type='html'>This has taken me three days to figure out. For what seemed like absolutely no reason, my ajax enabled application just stopped working. I went back through all my changes to see what it could have possibly have been to make the application start throwing the javascript document.getElementById('') is null or not an object error, and specifically, why it was doing this on document.getElementById('HEAD[0]').&lt;br /&gt;&lt;br /&gt;I eventually found a secton of html that I had commented out with &lt;!-- --&gt; html comments, and I had included in this an asp.net ajax &lt;asp:CompareValidator&gt; tag.&lt;br /&gt;&lt;br /&gt;Removing these comments fixed the problem!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-3165546278308390721?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/3165546278308390721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/06/aspnet-ajax-documentgetelementbyid-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3165546278308390721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3165546278308390721'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/06/aspnet-ajax-documentgetelementbyid-is.html' title='ASP.NET Ajax document.getElementById is null or not an object'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-3000764410808708461</id><published>2009-06-24T08:21:00.000-07:00</published><updated>2009-06-24T08:25:49.232-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL Server Cannot resolve collation conflict for equal to operation.</title><content type='html'>Today I migrated an exisiting set of tables from one database, to a new database, to isolate their work.&lt;br /&gt;&lt;br /&gt;After copying all the stored procs, views, tables and data, one of my stored procs wouldn't run.&lt;br /&gt;&lt;br /&gt;Everytime I tried to execute it, I got the error:&lt;br /&gt;&lt;br /&gt;"Cannot resolve collation conflict for equal to operation."&lt;br /&gt;&lt;br /&gt;It transpires that this error can be caused by many different problems, butt he main one being that the collation types for the columns being joined in the sql statement is different.&lt;br /&gt;&lt;br /&gt;In my instance this was not the case, but by telling the columns to use the databases default collation on either side of the join fixed the problem - e.g.&lt;br /&gt;&lt;br /&gt;SELECT table1.*, table2.* FROM table1&lt;br /&gt;INNER JOIN table2 ON table1.column1 COLLATE DATABASE_DEFAULT = table2.column1 COLLATE DATABASE_DEFAULT&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-3000764410808708461?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/3000764410808708461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/06/sql-server-cannot-resolve-collation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3000764410808708461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3000764410808708461'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/06/sql-server-cannot-resolve-collation.html' title='SQL Server Cannot resolve collation conflict for equal to operation.'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-8332934015824960762</id><published>2009-06-11T04:38:00.000-07:00</published><updated>2009-06-11T04:44:36.856-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><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='CompareValidator'/><title type='text'>CompareValidator doesn't fire</title><content type='html'>I have an application where I am using a CompareValidator on a field that is acting as a CAPTCHA, therefore I am comparing the value that is entered.&lt;br /&gt;&lt;br /&gt;When testing the page, I was clicking the submit button on the form, before entering any text, but when I did this, it was submitting the form! Why, when the value couldn't possibly be the same?&lt;br /&gt;&lt;br /&gt;The reason for it is the depths of the AJAX js files:&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;&lt;br /&gt;function CompareValidatorEvaluateIsValid(val) {&lt;br /&gt;    var value = ValidatorGetValue(val.controltovalidate);&lt;br /&gt;    if (ValidatorTrim(value).length == 0)&lt;br /&gt;        return true;&lt;br /&gt;    var compareTo = "";&lt;br /&gt;    if ((typeof(val.controltocompare) != "string") ||&lt;br /&gt;        (typeof(document.getElementById(val.controltocompare)) == "undefined") ||&lt;br /&gt;        (null == document.getElementById(val.controltocompare))) {&lt;br /&gt;        if (typeof(val.valuetocompare) == "string") {&lt;br /&gt;            compareTo = val.valuetocompare;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;        compareTo = ValidatorGetValue(val.controltocompare);&lt;br /&gt;    }&lt;br /&gt;    var operator = "Equal";&lt;br /&gt;    if (typeof(val.operator) == "string") {&lt;br /&gt;        operator = val.operator;&lt;br /&gt;    }&lt;br /&gt;    return ValidatorCompare(value, compareTo, operator, val);&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The following line is the culprit:&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;&lt;br /&gt;if (ValidatorTrim(value).length == 0)&lt;br /&gt;        return true;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;If the length of the information input into the box being validated is 0, i.e. nothing entered, then this validates as true. This means that if you compare something to nothing, that is valid....   stupid, but valid.&lt;br /&gt;&lt;br /&gt;The solution to this is to add a RequiredFieldValidator as well, which then forces the length to be greater than 0, an thus makes it all work&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-8332934015824960762?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/8332934015824960762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/06/comparevalidator-doesnt-fire.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/8332934015824960762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/8332934015824960762'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/06/comparevalidator-doesnt-fire.html' title='CompareValidator doesn&apos;t fire'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-5210577589099473403</id><published>2009-06-04T07:20:00.001-07:00</published><updated>2009-06-04T07:24:40.607-07:00</updated><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='masterpages'/><title type='text'>Compiler Error Message: CS0115: 'ASP.pagename_aspx.GetTypeHashCode()': no suitable method found to override</title><content type='html'>I came accross this problem today when converting a set of application pages into master pages.&lt;br /&gt;&lt;br /&gt;My initial problem was that I had set CodeFile attribute of the @Page directive, rather than the CodeBehind attribute.&lt;br /&gt;&lt;br /&gt;The second problem was that my page was inheriting from the Masterpage, rather than from System.Web.Ui.Page.&lt;br /&gt;&lt;br /&gt;When I fixed these it worked.&lt;br /&gt;&lt;br /&gt;It essence, if you get this error, check out what, and where your page is inheriting from.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-5210577589099473403?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/5210577589099473403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/06/compiler-error-message-cs0115.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5210577589099473403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5210577589099473403'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/06/compiler-error-message-cs0115.html' title='Compiler Error Message: CS0115: &apos;ASP.pagename_aspx.GetTypeHashCode()&apos;: no suitable method found to override'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-9079087571952645741</id><published>2009-06-02T06:49:00.000-07:00</published><updated>2009-06-02T06:51:27.437-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Outlook'/><category scheme='http://www.blogger.com/atom/ns#' term='Email'/><title type='text'>Outlook 2007 Email Headers</title><content type='html'>I keep forgetting where to find this one....&lt;br /&gt;&lt;br /&gt;When you wish to see the header, right click on the message in your inbox and choose "Message Options".  The window that pops up has the headers showing in it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-9079087571952645741?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/9079087571952645741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/06/outlook-2007-email-headers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/9079087571952645741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/9079087571952645741'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/06/outlook-2007-email-headers.html' title='Outlook 2007 Email Headers'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-747674802937228086</id><published>2009-05-19T09:14:00.000-07:00</published><updated>2009-05-19T09:27:38.761-07:00</updated><title type='text'>TinyMCE ListBox Plugin for Merge Tags</title><content type='html'>Well, today I finally managed to cobble together the following solution for a problem I had whereby I wanted a plugin for TinyMCE whereby I could select a value from a drop down / listbox, and have it inserted into TinyMCE.&lt;br /&gt;&lt;br /&gt;So here's how I did it:&lt;br /&gt;&lt;br /&gt;First define a javascript array BEFORE initialising the TinyMCE editor. This allows you to create this array server side if you want (by writing a response stream declaring it if necessary), or allows you to control it per page. E.g:&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;var arrUserTags = new Array('{{Name}}','{{Address}}','{{Company}}');&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I created a new plugin in tiny_mce/plugins/usertags/editor_plugin.js as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;&lt;br /&gt;(function() {&lt;br /&gt;tinymce.create('tinymce.plugins.usertags', {  &lt;br /&gt;init : function(ed, url) {&lt;br /&gt;},  &lt;br /&gt;createControl: function(n, cm) {      &lt;br /&gt;switch (n) {          &lt;br /&gt;case 'usertags':              &lt;br /&gt;var mlb = cm.createListBox('usertags', {                   &lt;br /&gt;title : 'Insert details    ',                   &lt;br /&gt;onselect : function(v) {                        &lt;br /&gt;tinyMCE.activeEditor.selection.setContent(v);                   &lt;br /&gt;}              &lt;br /&gt;});&lt;br /&gt;        &lt;br /&gt;//The array arrUserTags, must be defined before the editor is added!!! Or if you prefer, just ignore the array idea, and just do multiple mlb.add() statements.                             &lt;br /&gt;for(i=0;i&lt;arrusertags.length;i++) the="" new="" listbox="" instance="" return="" register="" plugin="" with="" a="" short="" usertags=""&gt;&lt;/arrusertags.length;i++)&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This you can then register as a plugin in tinymce.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-747674802937228086?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/747674802937228086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/05/tinymce-listbox-plugin-for-merge-tags.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/747674802937228086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/747674802937228086'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/05/tinymce-listbox-plugin-for-merge-tags.html' title='TinyMCE ListBox Plugin for Merge Tags'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-5468387669024223836</id><published>2009-05-19T09:12:00.000-07:00</published><updated>2009-05-19T09:14:52.496-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>CompareValidator doesn't compare numeric amounts correctly</title><content type='html'>Well at least that is what I thought today!&lt;br /&gt;&lt;br /&gt;I had a compare validator set on two text boxes that were used to enter monetary amounts. The validator was to ensure that box B was greater than Box A.&lt;br /&gt;&lt;br /&gt;In this scenario, it worked:&lt;br /&gt;&lt;br /&gt;Box A = 100, Box B = 200 = Fine&lt;br /&gt;&lt;br /&gt;But...&lt;br /&gt;&lt;br /&gt;Box A = 500, Box B = 1000 = Invalid&lt;br /&gt;&lt;br /&gt;Why? Because I hadn't set the TYPE attribute of the validator to CURRENCY&lt;br /&gt;&lt;br /&gt;D'oh!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-5468387669024223836?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/5468387669024223836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/05/comparevalidator-doesnt-compare-numeric.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5468387669024223836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5468387669024223836'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/05/comparevalidator-doesnt-compare-numeric.html' title='CompareValidator doesn&apos;t compare numeric amounts correctly'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-4433109467075484673</id><published>2009-05-14T05:06:00.001-07:00</published><updated>2009-05-14T05:15:28.613-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='TinyMCE'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>TinyMCE UpdatePanel Javascript errors</title><content type='html'>I have spent days on this one, and it took myself and a colleague both working on it to find a solution that actually worked!&lt;br /&gt;&lt;br /&gt;Here's the scenario.... you want to use TinyMCE, and have it working in an UpdatePanel. It sounds simple enough.&lt;br /&gt;&lt;br /&gt;What I did was add the TinyMCE editor script, setup my tinyMCE.init() method, and hey presto, I got my editors. I set my code behind for my save button, and it fired fine when pressed, however, the editor disappeared! So, I moved my init function into the code behind, and registered it with the scriptmanager.registerclientscript method. This was fine, and when svaing my content, the editor did not disappear anymore - however, when I clicked the save button for a second time, I got a javascript error on the editor trying to access it's content.&lt;br /&gt;&lt;br /&gt;The specific part of the javascript from tiny_mce.js was erroring on "return this.bodyElementthis.getDoc().body"&lt;br /&gt;&lt;br /&gt;Anyway, I searched through many examples of how to solve this, including remove the editors before performing the postback, and eventually found a downloadable example that worked:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://codeodyssey.com/archive/2007/7/18/updatepanel-tinymce-demo-with-project-zip-file"&gt;http://codeodyssey.com/archive/2007/7/18/updatepanel-tinymce-demo-with-project-zip-file&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;However, when I tried to use this in my application, with TinyMCE version 3.2.3, it didn't work. I copied over the version from this download, and then it seemed to fix the problem - but I lost some of the TinyMCE functionality!&lt;br /&gt;&lt;br /&gt;Eventually, my colleague stumbled upon this absoluetly brilliant .NET extender, that handles everything for you, and allows you customise each editor independantly:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/cjdevos/archive/2008/06/19/ajax-extender-for-tinymce-continued.aspx"&gt;http://weblogs.asp.net/cjdevos/archive/2008/06/19/ajax-extender-for-tinymce-continued.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So, if your having problems with TinyMCE and updatepanels - download it and use it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-4433109467075484673?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/4433109467075484673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/05/tinymce-updatepanel-javascript-errors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4433109467075484673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4433109467075484673'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/05/tinymce-updatepanel-javascript-errors.html' title='TinyMCE UpdatePanel Javascript errors'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-8931917227915220089</id><published>2009-04-15T03:12:00.000-07:00</published><updated>2009-04-15T03:14:47.895-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Mathematics'/><title type='text'>Math.Log in VBScript</title><content type='html'>Today I was working on an old Classic ASP project, and I was converting some JavaScript code to ASP.&lt;br /&gt;&lt;br /&gt;Part of the code used the JavaScript Math.Pow function, e.g. Math.Pow(4,3), and I needed to do this in classic ASP.&lt;br /&gt;&lt;br /&gt;I found that the ^ operator in VBScript does this, but it wasn't easy to transpose into my code, so I just added the following function to the page:&lt;br /&gt;&lt;br /&gt;FUNCTION Pow(val, val2) &lt;br /&gt;    Pow = val ^ val2&lt;br /&gt;END FUNCTION&lt;br /&gt;&lt;br /&gt;Added called it as needed, e.g. Pow(4,3)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-8931917227915220089?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/8931917227915220089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/04/mathlog-in-vbscript.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/8931917227915220089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/8931917227915220089'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/04/mathlog-in-vbscript.html' title='Math.Log in VBScript'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-1770531651520319311</id><published>2009-02-12T06:34:00.000-08:00</published><updated>2009-02-12T06:41:34.370-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>SWFObject and LightBox2 - IE Errors</title><content type='html'>Today a colleague of mine had a problem whereby he was trying to use LightBox 2 in a webpage, but on that page, we received the "Internet explorer cannot open the internet site XXX Operation Aborted" message, and the page doesn't load.&lt;br /&gt;&lt;br /&gt;After a lot of debugging, nothing was apparent, and it didn't happen in Firefox.&lt;br /&gt;&lt;br /&gt;After reading around a bit, it seems that IE has a few issues with DOM commands, and as such, the SWFObject and Lightbox2 scripts both try to access the DOM at the same time.&lt;br /&gt;&lt;br /&gt;So, all I did was move the SWFObject script to the foot of the page, and keep the div that it is written into in its normal place.&lt;br /&gt;&lt;br /&gt;Sorted.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-1770531651520319311?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/1770531651520319311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/02/swfobject-and-lightbox2-ie-errors.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/1770531651520319311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/1770531651520319311'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/02/swfobject-and-lightbox2-ie-errors.html' title='SWFObject and LightBox2 - IE Errors'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-4360277514107618141</id><published>2009-01-05T08:58:00.000-08:00</published><updated>2009-01-05T09:01:59.345-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wpa'/><category scheme='http://www.blogger.com/atom/ns#' term='xp'/><category scheme='http://www.blogger.com/atom/ns#' term='wep'/><title type='text'>Wireless stops working after XP SP3 installation</title><content type='html'>A friend brought her laptop round to mine yesterday, as after xp had done an update and installed xp sp3, the wireless was showing as connected, but no page would load. When wired in, all was fine.&lt;br /&gt;&lt;br /&gt;I tried connecting it to my WPA enabled network, and all was fine. After googlin the problem, I found that there were some issues that some people had had with WPA after xp sp3, but not with WEP - in fact, they were recommending switching to WEP (Not a good idea).&lt;br /&gt;&lt;br /&gt;Anyway, I did the alternative, changed their laptop and belkin router over to wpa2 psk, and it's fine now!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-4360277514107618141?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/4360277514107618141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2009/01/wireless-stops-working-after-xp-sp3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4360277514107618141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4360277514107618141'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2009/01/wireless-stops-working-after-xp-sp3.html' title='Wireless stops working after XP SP3 installation'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-5306781218101483577</id><published>2008-12-17T08:13:00.000-08:00</published><updated>2008-12-17T08:16:21.434-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Mathematics'/><title type='text'>Javascript parseInt, parseFloat, decide on data type</title><content type='html'>I was facing an issue today whereby I need to accept a value from an input control, but not knowing what it contained - i.e. a number, a floating point number (decimal) or a string, but I needed to perform maths on it.&lt;br /&gt;&lt;br /&gt;With some help of some friends over at forums.asp.net, I came up with the following. You pass it your value, and it will send back the right data type to use on mathematical operations like "+" which normally concatenates strings instead of adding numbers as strings.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function parseValues(aValue)&lt;br /&gt;{&lt;br /&gt;if(isNaN(aValue))&lt;br /&gt;{&lt;br /&gt;return aValue;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;if(aValue.indexOf(".")&gt;0)&lt;br /&gt;{&lt;br /&gt;return parseFloat(aValue);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;return parseInt(aValue);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-5306781218101483577?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/5306781218101483577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/12/javascript-parseint-parsefloat-decide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5306781218101483577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5306781218101483577'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/12/javascript-parseint-parsefloat-decide.html' title='Javascript parseInt, parseFloat, decide on data type'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-6714637908657276186</id><published>2008-12-10T03:56:00.000-08:00</published><updated>2008-12-10T04:02:53.625-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>ScriptResource.axd - if(!a._events) error</title><content type='html'>I was getting this error today, for some unknown reason, and obviously debugging it is of no use, as the brightspark that declared everything as "a", "b" or "c" obviously didn't want us to!&lt;br /&gt;&lt;br /&gt;Anyway, after some searching around on my page, I found that a modalpopupextender that I have added to my page, had an invalidad cancelcontrolid, I had mis-spelled it, and therefore this error must be because "a" in this instance was the control that was to be used to close (cancel) the popup.&lt;br /&gt;&lt;br /&gt;The joys of using other peoples code....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-6714637908657276186?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/6714637908657276186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/12/scriptresourceaxd-ifaevents-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/6714637908657276186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/6714637908657276186'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/12/scriptresourceaxd-ifaevents-error.html' title='ScriptResource.axd - if(!a._events) error'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-4388844676589323812</id><published>2008-11-06T07:03:00.000-08:00</published><updated>2008-11-06T07:07:09.445-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='dumb moments'/><title type='text'>ASP Buttons not firing events</title><content type='html'>How stupid did I feel today? Very, that's what.&lt;br /&gt;&lt;br /&gt;In my perfectly working application, I add a new tab to the tabcontainer, and add some link buttons in it, but when running, the buttons would not work - they wouldn't run the code behind - I was completely perplexed as to why this was happening.&lt;br /&gt;&lt;br /&gt;Eventually a colleague said to me "are you using the CausesValidation" - AH!!! Somewhere else on the application there is a requiredfieldvalidator, and that was telling the page that navigation couldn't take place, but the field was required - but in this case, it was allowed to happen. So, setting the property of CausesValidation = false, solved the problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-4388844676589323812?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/4388844676589323812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/11/asp-buttons-not-firing-events.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4388844676589323812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4388844676589323812'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/11/asp-buttons-not-firing-events.html' title='ASP Buttons not firing events'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-6577922929887834913</id><published>2008-11-05T03:39:00.000-08:00</published><updated>2008-11-05T03:41:40.242-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sothink'/><title type='text'>Sothink DHTML fails to install on DHTMLmenu.dll</title><content type='html'>I've had this problem twice now, and here's how I got round it to make it work under win xp sp2.&lt;br /&gt;&lt;br /&gt;Start the installation, when it fails to register the file, click ignore. The installation will complete, but the program won't work.&lt;br /&gt;&lt;br /&gt;Start the uninstall for it, again it will hang. Go into task manager, and kill the uninstall process. A temp file is produced, so kill that process also (it's the only one beginning with _tmp).&lt;br /&gt;&lt;br /&gt;Do the install again, and it works!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-6577922929887834913?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/6577922929887834913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/11/sothink-dhtml-fails-to-install-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/6577922929887834913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/6577922929887834913'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/11/sothink-dhtml-fails-to-install-on.html' title='Sothink DHTML fails to install on DHTMLmenu.dll'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-6192576498243794286</id><published>2008-10-20T02:50:00.000-07:00</published><updated>2008-10-20T02:52:21.701-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>AJAX NumericUpDown extender hides textbox</title><content type='html'>I couldn't for the life of me figure out why my nicely styled textbox was being hidden when I added an numeric up down extender to it.&lt;br /&gt;&lt;br /&gt;The reason, you have to explicitly add a width attribute to the extender so that it knows how big the parent box is!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-6192576498243794286?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/6192576498243794286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/10/ajax-numericupdown-extender-hides.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/6192576498243794286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/6192576498243794286'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/10/ajax-numericupdown-extender-hides.html' title='AJAX NumericUpDown extender hides textbox'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-3773846525419321212</id><published>2008-09-19T02:11:00.001-07:00</published><updated>2008-09-19T02:40:11.383-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='file system'/><category scheme='http://www.blogger.com/atom/ns#' term='file comparison'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Comparing two files, one on a hard drive, and one from a web site</title><content type='html'>In my quest to create an effective and lean search engine service for the company I work for, I used to crawl all of our websites and download every file from them, and write them to a local cache. When the cache was detected as updated, my indexing system (based on Lucene.Net) detects the changes, and reindexes those sites.&lt;br /&gt;&lt;br /&gt;You may well be able to imagine, that with over 800 sites, this is an awfully large amount of data to writing to the cache, and then an even bigger job for the index to reindex all these files!&lt;br /&gt;&lt;br /&gt;So, what I wanted was a mechanism whereby I could compare the local copy, to a streamed copy of the file from the server into the local memory, and see there were any changes.&lt;br /&gt;&lt;br /&gt;To do this, I immediate thought of looking for something like a checksum check, but a colleague recommended looking at doing a MD5 hash on them, using a tool like CipherLite by Obivex. Looking into this, i found an easier way, by using a webrespone to download a memory stream, opening the local file using a filestream, and performing hash on them to see whether the contents were the same:&lt;br /&gt;&lt;br /&gt;//get a memory stream to hold the data that is downloaded&lt;br /&gt;MemoryStream msFile = new MemoryStream();&lt;br /&gt;writer = new BinaryWriter(msFile);&lt;br /&gt;byte[] RecvBuffer = new byte[10240];&lt;br /&gt;int nBytes, nTotalBytes = 0;&lt;br /&gt;// loop to receive response buffer&lt;br /&gt;while((nBytes = response.socket.Receive(RecvBuffer, 0, 10240, SocketFlags.None)) &gt; 0)&lt;br /&gt;{&lt;br /&gt;// increment total received bytes&lt;br /&gt;nTotalBytes += nBytes;&lt;br /&gt;// write received buffer to file&lt;br /&gt;writer.Write(RecvBuffer, 0, nBytes);&lt;br /&gt;// check if the uri type not binary to can be parsed for refs&lt;br /&gt;if(bParse == true)&lt;br /&gt;// add received buffer to response string&lt;br /&gt;strResponse += Encoding.ASCII.GetString(RecvBuffer, 0, nBytes);&lt;br /&gt;// update view text&lt;br /&gt;// check if connection Keep-Alive to can break the loop if response completed&lt;br /&gt;if(response.KeepAlive &amp;amp;&amp;amp; nTotalBytes &gt;= response.ContentLength &amp;amp;&amp;amp; response.ContentLength &gt; 0)&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;bool bContinue = false;&lt;br /&gt;FileStream fStream = null;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;//check to see if the file exists on the local file system&lt;br /&gt;if(File.Exists(PathName))&lt;br /&gt;{&lt;br /&gt;//open the file, and read in the stream&lt;br /&gt;fStream = File.Open(PathName, FileMode.Open,FileAccess.Read,FileShare.Read);&lt;br /&gt;&lt;br /&gt;//compare the two streams, to see if they are the same (see later)&lt;br /&gt;bContinue = compareFiles(msFile,fStream);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;//file doesn't exist, download anyway&lt;br /&gt;bContinue = true;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch(Exception ex)&lt;br /&gt;{&lt;br /&gt;bContinue = true;&lt;br /&gt;LogError(ex.Message,"");&lt;br /&gt;}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;if(fStream!=null)&lt;br /&gt;fStream.Close();&lt;br /&gt;fStream = null;&lt;br /&gt;}&lt;br /&gt;if(bContinue)&lt;br /&gt;{&lt;br /&gt;//create a stream to create the new file&lt;br /&gt;streamOut = File.Open(PathName, FileMode.Create, FileAccess.Write, FileShare.ReadWrite);&lt;br /&gt;//create the new copy&lt;br /&gt;msFile.WriteTo(streamOut);&lt;br /&gt;//close up&lt;br /&gt;streamOut.Close();&lt;br /&gt;}&lt;br /&gt;msFile.Close();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, to how the streams are compared. I adapted my solution to one I found via a google search on hashing:&lt;br /&gt;&lt;br /&gt;bool compareFiles(MemoryStream file1, FileStream file2)&lt;br /&gt;{&lt;br /&gt;using (HashAlgorithm hashAlg = HashAlgorithm.Create())&lt;br /&gt;{&lt;br /&gt;// Calculate the hash for the files.&lt;br /&gt;byte[] hashBytesA = hashAlg.ComputeHash(file1);&lt;br /&gt;byte[] hashBytesB = hashAlg.ComputeHash(file2);&lt;br /&gt;// Compare the hashes.&lt;br /&gt;if (BitConverter.ToString(hashBytesA) == BitConverter.ToString(hashBytesB))&lt;br /&gt;{&lt;br /&gt;//they are the same&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;//they are different&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Hope this helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-3773846525419321212?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/3773846525419321212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/09/comparing-two-files-one-on-hard-drive.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3773846525419321212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/3773846525419321212'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/09/comparing-two-files-one-on-hard-drive.html' title='Comparing two files, one on a hard drive, and one from a web site'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-5589308977114830406</id><published>2008-09-19T02:11:00.000-07:00</published><updated>2008-09-19T02:19:33.274-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Detecting an enter key press on an asp.net form (but when using AJAX as well!)</title><content type='html'>I've been more than familiar with detecting key presses in javascript for quite some time, and used to do it all the time in classic asp, but this time when I came to do it in the .net world, in was a little more involved.&lt;br /&gt;&lt;br /&gt;This setup was also the first time I had to cope with Masterpages using AJAX inside them.&lt;br /&gt;&lt;br /&gt;So, I have a simple content placeholder, inside this a textbox and these themselves are inside an updatepanel. I also have a modalpopup extender that shows whenever the page causes an update (asyncpostback).&lt;br /&gt;&lt;br /&gt;So, to get this to work, I had to tie up my javascript with the ScriptManager.RegisterClientScriptBlock() method and placing the script into a LiteralControl that I had to place on the form also:&lt;br /&gt;&lt;br /&gt;if(!Page.IsPostBack)&lt;br /&gt;{&lt;br /&gt;this.textBoxQuery.Attributes.Add("onkeypress", "javascript:return checkEnter(event);");&lt;br /&gt;Page.RegisterHiddenField("__EVENTTARGET", textBoxQuery.ClientID);&lt;br /&gt;string strScript = "function checkEnter(e){ " +&lt;br /&gt;"var characterCode; " +&lt;br /&gt;"if(e &amp;amp;&amp;amp; e.which){ " +&lt;br /&gt;"e = e; " +&lt;br /&gt;"characterCode = e.which; " +&lt;br /&gt;"} " +&lt;br /&gt;"else { " +&lt;br /&gt;"e = event; " +&lt;br /&gt;"characterCode = e.keyCode; " +&lt;br /&gt;"} " +&lt;br /&gt;"if (characterCode == 13) " +&lt;br /&gt;"{ " +&lt;br /&gt;" " +&lt;br /&gt;" document.getElementById('" + ButtonSearch.UniqueID + "').click(); " +&lt;br /&gt;" return false; " +&lt;br /&gt;"} " +&lt;br /&gt;"else " +&lt;br /&gt;"{ " +&lt;br /&gt;" return true; " +&lt;br /&gt;"}" +&lt;br /&gt;"}";&lt;br /&gt;&lt;br /&gt;ScriptManager.RegisterClientScriptBlock(LitScript, this.GetType(), "regScripts", strScript, true);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This now captures the enter key, and handles it as a normal button click event.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-5589308977114830406?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/5589308977114830406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/09/detecting-enter-key-press-on-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5589308977114830406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5589308977114830406'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/09/detecting-enter-key-press-on-aspnet.html' title='Detecting an enter key press on an asp.net form (but when using AJAX as well!)'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-9106373163958806967</id><published>2008-09-11T06:33:00.000-07:00</published><updated>2008-09-15T03:56:59.254-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webservice'/><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='XML Error'/><title type='text'>Error messages "There is an error in XML document (1, 1994)." or inner exception of "DataTable does not match to any DataTable in source."</title><content type='html'>Today I have spent nearly 5 hours trying to get to the bottom of why I was receiving these errors.&lt;br /&gt;&lt;br /&gt;The first error made me think that this was caused by an invalid character in my data, which was being returned from a webservice to my data in my program.&lt;br /&gt;&lt;br /&gt;I took a copy of what was being returned using "fiddler" to see what was going on in my browser - it showed the xml being returned was fine. I even validated the XML to check.&lt;br /&gt;&lt;br /&gt;The interesting thing was the inner exception of "DataTable does not match to any DataTable in source." thrown in Visual Studio. Looking at this, it was telling me that the datatable being returned from the webservice, was not the same as the datatable I had in Visual Studio. The strange this was, they were both typed datatables! so how could they be wrong.... well, they weren't.&lt;br /&gt;&lt;br /&gt;The source of the problem was the following which was at position 1994 in the XML:&lt;br /&gt;&lt;br /&gt;"diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" "&lt;br /&gt;&lt;br /&gt;This was telling me that there was a difference in the schema of the dataset... &lt;- Note here, a difference in the DATASET. I was not returning a dataset, I was returning a datatable! Anyway, a quick google brought up a nice little link from the good boys at Microsoft:&lt;br /&gt;&lt;?xml:namespace prefix = diffgr /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;&lt;u&gt;&lt;span style="color:#0000ff;"&gt;&lt;a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=105642"&gt;http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=105642&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;&lt;u&gt;&lt;span style="color:#0000ff;"&gt;&lt;/span&gt;&lt;/u&gt;&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;It turns out, you can't return a datatable from a webservice, you have to return a DATASET. What a load of pants.&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;So, to solve this, I had to alter the webservice method to return a fake dataset, that contained the datatable that I wanted, e.g:&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;[WebMethod]&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;public MyTypedDataSet(string someparams)&lt;br /&gt;{&lt;br /&gt;MyTypedDataSet ds = new MyTypedDataSet();&lt;br /&gt;MyTypedDataTable dt = aFunctionThatGetsTheData(someparams);&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;ds.Tables.Add(dt.Copy());&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;return ds;&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;}&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;private MyTypedDataSet.MyTypedDataTable(string someinfo)&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;{&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;MyTypedDataSet.MyTypedDataTable dt;&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;//The work that gets the data is here&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;return dt;&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;}&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;I hope this helps someone if they have the same problem too!!!&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;&lt;/diffgr:diffgram&gt;&lt;br /&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;Jamie.&lt;br /&gt;&lt;/diffgr:diffgram&gt;&lt;diffgr:diffgram msdata="urn:schemas-microsoft-com:xml-msdata" diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;&lt;/diffgr:diffgram&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-9106373163958806967?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/9106373163958806967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/09/error-messages-there-is-error-in-xml.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/9106373163958806967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/9106373163958806967'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/09/error-messages-there-is-error-in-xml.html' title='Error messages &quot;There is an error in XML document (1, 1994).&quot; or inner exception of &quot;DataTable does not match to any DataTable in source.&quot;'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-4210268351846567139</id><published>2008-09-08T08:49:00.000-07:00</published><updated>2008-09-08T08:51:56.376-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IsNumeric'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>IsNumeric in C#</title><content type='html'>IsNumeric doesn't exist in c#, it's VB specific, but i've found to work today is the following:&lt;br /&gt;&lt;br /&gt;int result;&lt;br /&gt;Int32.TryParse(value_to_try, out result);&lt;br /&gt;&lt;br /&gt;If it can parse an Int, it returns the value to the result variable, if it fails, it returns 0.&lt;br /&gt;&lt;br /&gt;Brilliant!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-4210268351846567139?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/4210268351846567139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/09/isnumeric-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4210268351846567139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4210268351846567139'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/09/isnumeric-in-c.html' title='IsNumeric in C#'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-4593479884914345062</id><published>2008-07-29T07:52:00.000-07:00</published><updated>2008-07-29T07:56:29.782-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='images'/><category scheme='http://www.blogger.com/atom/ns#' term='regex'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Regex to find images in HTML</title><content type='html'>The other day I wanted to find a way to extract the image urls from some HTML, so I found the following to work quite nicely:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Regex rgxFiles = new Regex(@"[\w/:.]+\.(?:jpg|bmp|gif|png)");&lt;br /&gt;MatchCollection mtcFiles = Regex.Matches(strSourceString,@"[\w/:.]+\.(?:jpg|bmp|gif|png)",RegexOptions.IgnoreCase);&lt;br /&gt;&lt;br /&gt;foreach (Match mFile in mtcFiles)&lt;br /&gt;{&lt;br /&gt;     &lt;br /&gt;  //mFile.Value will contain the image address that we can work with&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-4593479884914345062?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/4593479884914345062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/07/regex-to-find-images-in-html.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4593479884914345062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4593479884914345062'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/07/regex-to-find-images-in-html.html' title='Regex to find images in HTML'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-2916627487245323585</id><published>2008-07-29T07:49:00.000-07:00</published><updated>2008-07-29T07:52:07.401-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tags'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>The HTTP verb POST used to access path ''Path' is not allowed</title><content type='html'>This is probably one of the most stupid mistakes I have made in months. I kept this message when transferring data from one website page to another, and I couldn't understand why.....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hmmmm.....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It helped when I gave the webpage an aspx extension!!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;One problem here, if you try and post data to a page that is not asp or aspx, IIS and .NET does NOT like it!&lt;br /&gt;&lt;br /&gt;Hope this helps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-2916627487245323585?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/2916627487245323585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/07/http-verb-post-used-to-access-path-path.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2916627487245323585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2916627487245323585'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/07/http-verb-post-used-to-access-path-path.html' title='The HTTP verb POST used to access path &apos;&apos;Path&apos; is not allowed'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-2604787460857803437</id><published>2008-07-24T00:56:00.001-07:00</published><updated>2008-07-24T00:57:29.342-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='regex'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>REGEX to remove HTML formatting</title><content type='html'>I've seen a few ways of using Regex to remove HTML formatting, but the following seems to work fine for me!:&lt;br /&gt;&lt;br /&gt;public string Strip(string text)&lt;br /&gt;{&lt;br /&gt;    string sReturn = System.Text.RegularExpressions.Regex.Replace(text, @"&lt;(.|\n)*?&gt;", string.Empty);&lt;br /&gt;    sReturn = System.Text.RegularExpressions.Regex.Replace(text, @"(&amp;\w*;)", string.Empty);&lt;br /&gt;    return sReturn;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-2604787460857803437?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/2604787460857803437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/07/regex-to-remove-html-formatting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2604787460857803437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2604787460857803437'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/07/regex-to-remove-html-formatting.html' title='REGEX to remove HTML formatting'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-1575189774133461222</id><published>2008-07-11T05:59:00.000-07:00</published><updated>2008-07-11T07:28:15.701-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='DataGridView'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>ModalPopupExtender for deleting DataGridView rows</title><content type='html'>In the words of Little Britain, "What a caffuffle"!&lt;br /&gt;&lt;br /&gt;How difficult does it have to be to delete a row from a datagrid, and use an AJAX ModalPopupExtender to provide a nice UI for it? The answer, very!&lt;br /&gt;&lt;br /&gt;For all those who are trying to do it, i'm not going to re-invent the wheel, simply take yourself over to Matt Berseths' blog, where he has managed to do it (and now have I!)&lt;br /&gt;&lt;br /&gt;http://mattberseth.com/blog/2007/07/confirm_gridview_deletes_with.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-1575189774133461222?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/1575189774133461222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/07/modalpopupextender-for-deleting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/1575189774133461222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/1575189774133461222'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/07/modalpopupextender-for-deleting.html' title='ModalPopupExtender for deleting DataGridView rows'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-719413683396889217</id><published>2008-07-10T05:27:00.001-07:00</published><updated>2008-07-10T05:30:50.363-07:00</updated><title type='text'>Seekafile Server - not removing indexed documents</title><content type='html'>I've noticed that on a particular Windows XP machine, that when seekafile server is running, it does detect that a file has changed, but it does not remove the old one from the index.&lt;br /&gt;&lt;br /&gt;So, what I am having to do, is modify the crawler application to delete the folder containing the site files, to force seekafile to remove the folder (and it's contents) from the index.&lt;br /&gt;&lt;br /&gt;When the crawler then downloads the files from the site again, it create a new index - in fact, this way is better as it ensures that the site data is correct!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-719413683396889217?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/719413683396889217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/07/seekafile-server-not-removing-indexed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/719413683396889217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/719413683396889217'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/07/seekafile-server-not-removing-indexed.html' title='Seekafile Server - not removing indexed documents'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-7788501341927268694</id><published>2008-07-10T04:56:00.000-07:00</published><updated>2008-07-10T05:09:51.087-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML Name Attribute'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Chaning the ASP.NET Name attribute</title><content type='html'>This had be frustrated for days - you can change the ID property of a dynamically created control, but you can't change the NAME attribute!&lt;br /&gt;&lt;br /&gt;Why do I care? Simple, I wanted to use the ID property for use in JavaScript calls, and the NAME attribute for when I was posting the form data - for example, I wanted two textboxes, one with an ID of 12, but a name of "Name", and another with an ID of 13, but a name of "Age", so that when I submitted the form data, I could get a friendly name for it.&lt;br /&gt;&lt;br /&gt;(Before anyone harps on about "the .NET framework uses the NAME property in postbacks" - I do know this, but it is not required in this scenario.)&lt;br /&gt;&lt;br /&gt;So, how did I do it? I created a class that inherits from TextBox, and then created an property within it called Name. I then overrided the render method to render the box as I needed it to be done in HTML:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public class MTextBox : TextBox&lt;br /&gt;{&lt;br /&gt;private string _mName;&lt;br /&gt;public string Name&lt;br /&gt;{&lt;br /&gt;get { return _mName; }&lt;br /&gt;set { _mName = value; }&lt;br /&gt;}&lt;br /&gt;//overriden to print name attribute correctly&lt;br /&gt;protected override void Render(HtmlTextWriter writer)&lt;br /&gt;{&lt;br /&gt;string sOutput = "";&lt;br /&gt;//Here you can squirt out your HTML in whatever format you want, e.g. you can&lt;br /&gt;//squirt out the HTML of Name=\" + __mName + "\" etc&lt;br /&gt;writer.Write(sOutput);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Sorry I can't give a more complete example, but blogger treats the code sample as HTML!!! Contact me if you want the code.&lt;br /&gt;&lt;br /&gt;In my application, I can then just do this:&lt;br /&gt;&lt;br /&gt;MTextBox textBox = new MTextBox();&lt;br /&gt;textBox.Name = "Something I want it to be!!!";&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-7788501341927268694?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/7788501341927268694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/07/chaning-aspnet-name-attribute.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/7788501341927268694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/7788501341927268694'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/07/chaning-aspnet-name-attribute.html' title='Chaning the ASP.NET Name attribute'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-6652832108795747462</id><published>2008-06-23T07:29:00.000-07:00</published><updated>2008-06-23T07:31:31.335-07:00</updated><title type='text'>Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.</title><content type='html'>Well, this was a fun error I received today, and after banging my head against a brick wall, the solution was simple.&lt;br /&gt;&lt;br /&gt;The typed dataset that I had created in Visual Studio, was not a direct match to the table that I was accessing on the development SQL DB. I updated the dataset, and hey-presto, we are all fine again now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-6652832108795747462?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/6652832108795747462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/06/failed-to-enable-constraints-one-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/6652832108795747462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/6652832108795747462'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/06/failed-to-enable-constraints-one-or.html' title='Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-8567369539347084530</id><published>2008-05-14T06:44:00.000-07:00</published><updated>2008-05-14T06:52:58.524-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='file system'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='FileInfo'/><title type='text'>FileInfo FullName returns case insensitive results</title><content type='html'>I had a problem the other day whereby I was trying to record urls that contained encoded information as a querystring parameter, e.g. file.asp?param=4H4tTy7u&lt;br /&gt;&lt;br /&gt;The problem was that even though I could see the files in case sensitive manner, when I saved the file to the filesystem, they were being read as case insensitive, e.g. file.asp?param=4h4tty7u&lt;br /&gt;&lt;br /&gt;This caused major problems, as when I then unencoded the information in the querystring, I was getting completely the wrong information.&lt;br /&gt;&lt;br /&gt;Upon tracing, it became apparent that although I could see the mixed cases in windows explorer, the underlying filesystem was case insensitive, and returned all results in lowercase - something which was causing the major problem.&lt;br /&gt;&lt;br /&gt;To get round this, &lt;a href="http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.aspnet/2004-04/0617.html"&gt;I first found an MS article &lt;/a&gt;that said it was caused by a .NET 2 framework bug from 2006 that set a registry value to indicate case insensitivity to the filesystem. After I changed this value and restarted, still it did not work.&lt;br /&gt;&lt;br /&gt;After a bit of googling, &lt;a href="http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.aspnet/2004-04/0617.html"&gt;I found the following article&lt;/a&gt;, which proved to solve the problem for me eventually - quite why such an elaborate solution is required is beyond me, but hey! of you have the same problem, at least here is the solution!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//within your code....&lt;br /&gt;string sFileToProcess = fi.FullName;&lt;br /&gt;&lt;br /&gt;string dir = Path.GetDirectoryName(sFileToProcess);&lt;br /&gt;dir = ReplaceDirsWithExactCase(&lt;br /&gt;dir,&lt;br /&gt;Path.GetPathRoot(dir).ToUpper());&lt;br /&gt;string filename =&lt;br /&gt;Path.GetFileName(GetExactCaseForFilename(sFileToProcess));&lt;br /&gt;Console.WriteLine(dir + "\\" + filename);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//methods needed for the above to work.&lt;br /&gt;public static string ReplaceDirsWithExactCase(string fullpath, string parent)&lt;br /&gt;{&lt;br /&gt;if (fullpath.LastIndexOf(@"\") != fullpath.Length - 1)&lt;br /&gt;fullpath += @"\";&lt;br /&gt;if (parent.LastIndexOf(@"\") != parent.Length - 1)&lt;br /&gt;parent += @"\";&lt;br /&gt;string lookfor =&lt;br /&gt;fullpath.ToLower().Replace(parent.ToLower(), "");&lt;br /&gt;lookfor =&lt;br /&gt;(parent + lookfor.Substring(0,&lt;br /&gt;lookfor.IndexOf(@"\"))).ToLower();&lt;br /&gt;string[] dirs =&lt;br /&gt;Directory.GetDirectories(parent);&lt;br /&gt;foreach (string dir in dirs)&lt;br /&gt;if (dir.ToLower() == lookfor)&lt;br /&gt;{&lt;br /&gt;if (lookfor + @"\" == fullpath.ToLower())&lt;br /&gt;return dir;&lt;br /&gt;else&lt;br /&gt;return ReplaceDirsWithExactCase(fullpath, dir);&lt;br /&gt;}&lt;br /&gt;return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public static string GetExactCaseForFilename(string file)&lt;br /&gt;{&lt;br /&gt;string[] files =&lt;br /&gt;Directory.GetFiles(Path.GetDirectoryName(file));&lt;br /&gt;foreach (string f in files)&lt;br /&gt;if (f.ToLower() == file.ToLower())&lt;br /&gt;return f;&lt;br /&gt;return null;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-8567369539347084530?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/8567369539347084530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/05/fileinfo-fullname-returns-case.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/8567369539347084530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/8567369539347084530'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/05/fileinfo-fullname-returns-case.html' title='FileInfo FullName returns case insensitive results'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-2689376801163600917</id><published>2008-04-24T07:17:00.000-07:00</published><updated>2008-04-24T08:28:49.419-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='IFrame'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Development'/><title type='text'>Automatically resizing an IFRAME based on it's content size</title><content type='html'>I had a case today when I must have spent 3 or 4 hours trying various elaborate exaples to try and get an IFrame to resize based upon the size of the target page of that IFrame. Many examples were suggesting have a method in the parent frame, that was to be called by the child frame, and in all instances it would just not work for me.&lt;br /&gt;&lt;br /&gt;I found the following to work, and fortunately, it required no ammendments to the target page, just changes to the page that contained the IFRAME.&lt;br /&gt;&lt;br /&gt;Firstly, a little snippet of JavaScript was need within the HEAD tags, as shown below:&lt;br /&gt;&lt;br /&gt;function resizeMe(obj)&lt;br /&gt;{&lt;br /&gt;   var docHeight = dynFrame.document.body.scrollHeight;&lt;br /&gt;   obj.style.height = docHeight + 'px';&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Note that in &lt; IE5.5, you should use offsetHeight rather than scrollHeight.&lt;br /&gt;&lt;br /&gt;Then in an IFrame, add the attribute to trigger the resize when the iframe has loaded, as such:&lt;br /&gt;&lt;br /&gt;onload="resizeMe(this);"&lt;br /&gt;&lt;br /&gt;You should now have a resizing IFrame based on its content.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-2689376801163600917?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/2689376801163600917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/04/automatically-resizing-iframe-based-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2689376801163600917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2689376801163600917'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/04/automatically-resizing-iframe-based-on.html' title='Automatically resizing an IFRAME based on it&apos;s content size'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-4557139166667422291</id><published>2008-04-17T02:35:00.000-07:00</published><updated>2008-04-17T02:39:22.712-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='System Hanging'/><title type='text'>Visual Studio .Net 2005 Hangs on Startup</title><content type='html'>Well, the subject of this post if what has been happening to me today. For no apparent reason, VS.NET 2005 would just hang at the splash screen. After trying to reinstall, it still would not load.&lt;br /&gt;&lt;br /&gt;Here are some suggestions, collated from a morning of googling the forums:&lt;br /&gt;&lt;br /&gt;1) Check that your harddrive has at least 1GB of space free&lt;br /&gt;2) Try holding the shift key down when starting VS, so that you disable any addons that may have been corrupt.&lt;br /&gt;3) Try installing the lastest .NET runtime, i.e. at present 3.5&lt;br /&gt;4) As a last resort, trying clearing out the user environment settings - WARNING! This will erase all settings you have made in VS, so make a backup if you really need them, and only do this as a last resort. Go to the command prompt, and type "devenv.exe /resetuserdata"&lt;br /&gt;&lt;br /&gt;If none of those work, you're pretty much stuffed I think! However, number 2 worked for me!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-4557139166667422291?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/4557139166667422291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/04/visual-studio-net-2005-hangs-on-startup.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4557139166667422291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/4557139166667422291'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/04/visual-studio-net-2005-hangs-on-startup.html' title='Visual Studio .Net 2005 Hangs on Startup'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-7970824761746987586</id><published>2008-04-17T02:18:00.000-07:00</published><updated>2008-04-17T02:35:09.072-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene'/><title type='text'>C# Lucene.NET - Sorting</title><content type='html'>I needed to perform a non-standard search in Lucene, basically a search that allowed me to order by something other than relevance - why? well, because the Boss wanted me to!&lt;br /&gt;&lt;br /&gt;So, first of all, if you've been using Seekafile, you'll need to be aware that "out of the box", it comes with version 1.4 of Lucene. Verion 1.4 does not have the overloaded search method you need to supply a search to Lucene.&lt;br /&gt;&lt;br /&gt;Firstly then, download the latest version of Lucene, which can be accessed by going the long way round of visiting the old www.dotlucene.net website, and then following the links to version 2.0 or greater. You will then be able to download a newer version of Lucene.&lt;br /&gt;&lt;br /&gt;You will find then, that the search() method of the IndexSearcher will then expect a sort of some description. If you run search(query, Sort.RELEVANCE) that will perform a search the same as in old version 1.4 days. However, if you do a search such as search(query, new Sort("Fullname")) this will perform an alphabetic search on the fullname field!&lt;br /&gt;&lt;br /&gt;There are loads more options, you can do other than just that - check out the Sort.cs class for options.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-7970824761746987586?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/7970824761746987586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/04/c-lucenenet-sorting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/7970824761746987586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/7970824761746987586'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/04/c-lucenenet-sorting.html' title='C# Lucene.NET - Sorting'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-7248870947450499821</id><published>2008-04-11T01:57:00.000-07:00</published><updated>2008-04-11T02:03:12.796-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='Lucene'/><category scheme='http://www.blogger.com/atom/ns#' term='book'/><title type='text'>C# Lucene.NET - Part 3</title><content type='html'>&lt;strong&gt;&lt;em&gt;Part 3 - I need a book, dagnamit!&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This is a really short post.&lt;br /&gt;&lt;br /&gt;Basically, I needed to know more about Lucene, so I found out that there was a &lt;a href="http://www.amazon.co.uk/dp/1932394281?tag=jamesvickers-21&amp;amp;camp=2206&amp;amp;creative=7802&amp;amp;linkCode=op1&amp;amp;creativeASIN=1932394281&amp;amp;adid=1C555ATM4Q346SRAP1W5&amp;amp;"&gt;book about Lucene, called "Lucene in Action"&lt;/a&gt;. The books author really knows his stuff, and if you are new to Lucene, it is an absolute must for you to buy it.&lt;br /&gt;&lt;br /&gt;The book is well structured, and explains Lucene from a ground up approach, starting with the basics. The book does not cover, however, the theories behind search algorithms, proximity, &lt;a href="http://en.wikipedia.org/wiki/Tf-idf"&gt;Tf-idf&lt;/a&gt; or the &lt;a href="http://en.wikipedia.org/wiki/Vector_Space_Model"&gt;vector space model&lt;/a&gt;, so if you are after that information, use the links I have provided.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-7248870947450499821?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/7248870947450499821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/04/c-lucene-part-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/7248870947450499821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/7248870947450499821'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/04/c-lucene-part-3.html' title='C# Lucene.NET - Part 3'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-5051990409513125852</id><published>2008-04-11T01:08:00.000-07:00</published><updated>2008-04-11T02:14:26.585-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='Lucene'/><title type='text'>C# Lucene.NET - Part 2</title><content type='html'>&lt;strong&gt;&lt;em&gt;Part 2 - Revenge of the HTML IFilter&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;So here's me, sat at my desk, happily indexing away using my nice little indexing server, and the Boss says - "all our html page titles are the same, and I don't want the file name to be shown as the title in the search results, but we do use the meta descripions a lot to detail what the page is about, can we use that?", "of course we can" I replied.&lt;br /&gt;&lt;br /&gt;So, I go back into my indexing program, and implement a HTML Parser, and I add a new field to my Lucene document indexes when they are created, and I want to save the Meta tag called "content". I set my indexer off again, and great, no errors. I perform a search, but results come back for that field. I run it debug mode, and sure enough, when indexing, my HTML Parser couldn't pickup the HTML tag. Looking at the raw body of what the IFilters were doing, the HTML files were being passed into nlhtml.dll for filtering. Having read previously about IFilters and especially nlhtml.dll being used predominently for indexing HTML pages, I was really bemused as to why I couldn't gain access to the HTML tags - why it wouldn't let me get at them.&lt;br /&gt;&lt;br /&gt;After two days, it dawned on me - that is exactly what an IFilter was supposed to do! the nlhtml.dll IFilter removed the "unnecessary" formatting from around the HTML Page, and only returned back to me what it thought was necessary, the content from within the tags - damn it! I need the META tags!&lt;br /&gt;&lt;br /&gt;How did I overcome this you may ask (if you're interested that is) - well, I decided that I would supply a list to my search engine of files that I wanted to be considered as Plaintext - i.e. they needed to some "other" processing done on them in addition to being passed to a body content filtering process (in hindsight, I wish i'd called them html documents, rather than Plaintext, as it is more correct).&lt;br /&gt;&lt;br /&gt;So here is what I cam up with - maybe not the most elegant, but by god it works! When it finds a file with the extension of a known Plaintext file, it still does the normal content body search, but it also does some specific searches for known html tags:&lt;br /&gt;&lt;br /&gt;public Document LuceneDocument&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;Document doc = new Document();&lt;br /&gt;doc.Add(Field.Keyword("name", fi.Name));&lt;br /&gt;doc.Add(Field.Keyword("fullname", fi.FullName));&lt;br /&gt;DirectoryInfo di = fi.Directory;&lt;br /&gt;doc.Add(Field.Keyword("directparent", di.FullName));&lt;br /&gt;while (di != null)&lt;br /&gt;{&lt;br /&gt;doc.Add(Field.Keyword("parent", di.FullName));&lt;br /&gt;di = di.Parent;&lt;br /&gt;}&lt;br /&gt;doc.Add(Field.Keyword("created", DateField.DateToString(fi.CreationTime)));&lt;br /&gt;doc.Add(Field.Keyword("modified", DateField.DateToString(fi.LastWriteTime)));&lt;br /&gt;doc.Add(Field.Keyword("accessed", DateField.DateToString(fi.LastAccessTime)));&lt;br /&gt;doc.Add(Field.Keyword("length", fi.Length.ToString()));&lt;br /&gt;doc.Add(Field.UnIndexed("extension", fi.Extension));&lt;br /&gt;&lt;br /&gt;//We need to know if this is a plaintextfile search - looking for meta info etc&lt;br /&gt;//mainly used for htm, html, and asp files. This is set in config.xml&lt;br /&gt;ArrayList sPlainTextFiles = new ArrayList(0);&lt;br /&gt;SearchConfiguration cfg = null;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;cfg = SearchConfiguration.Load(Directory.GetParent(Assembly.GetExecutingAssembly().Location) + "/config.xml");&lt;br /&gt;if (cfg == null)&lt;br /&gt;{&lt;br /&gt;Log.Debug("Config file not found.");&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;sPlainTextFiles = cfg.PlainTextFiles;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch (Exception e)&lt;br /&gt;{&lt;br /&gt;Log.Debug("Error loading the config file: " + e);&lt;br /&gt;}&lt;br /&gt;bool bPlainTextRequired = false;&lt;br /&gt;for (int i = 0; i &lt; extension ="=" bplaintextrequired =" true;" rawtext =" getBody();" plaintext = "" metacontent = "" metadescription = "" htmltitle = "" htmlh1 = "" plaintext =" getPlainBody();" metacontent =" getMetaContent(plainText);" metadescription =" getMetaDescription(plainText);" htmltitle =" getHtmlTitle(plainText);" htmlh1 =" getHtmlH1(plainText);" ret = ""&gt; metaList = MetaParser.Parse(sText);&lt;br /&gt;foreach (HtmlMeta meta in metaList)&lt;br /&gt;{&lt;br /&gt;if ((meta.Name.ToLower() == "title") &amp;amp;&amp;amp; (meta.Content.Length &gt; 0))&lt;br /&gt;{&lt;br /&gt;ret = meta.Content;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;return ret;&lt;br /&gt;}&lt;br /&gt;private string getMetaDescription(string sText)&lt;br /&gt;{&lt;br /&gt;string ret = "";&lt;br /&gt;List&lt;htmlmeta&gt; metaList = MetaParser.Parse(sText);&lt;br /&gt;foreach (HtmlMeta meta in metaList)&lt;br /&gt;{&lt;br /&gt;if ((meta.Name.ToLower() == "description") &amp;amp;&amp;amp; (meta.Content.Length &gt; 0))&lt;br /&gt;{&lt;br /&gt;ret = meta.Content;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;return ret;&lt;br /&gt;}&lt;br /&gt;private string getHtmlTitle(string sText)&lt;br /&gt;{&lt;br /&gt;string strOut = Regex.Match(sText,"(?&lt;=title).*?(?=/title)", RegexOptions.IgnoreCase).Groups[0].Value; return strOut; } private string getHtmlH1(string sText) { string strOut = Regex.Match(sText, "(?&lt;= h1).*?(?=/h1)", RegexOptions.IgnoreCase).Groups[0].Value;&lt;br /&gt;Regex rx = new Regex(@"&lt;[^\&gt;]+\&gt;");&lt;br /&gt;return rx.Replace(strOut, "");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Please note that in the above regex, i've had to remove the &lt;&gt; from around the h1 and title tags, as it made the document go skew-wiff when published!&lt;br /&gt;&lt;br /&gt;Did I miss something? Yes - getPlainBody() - well again, not very elegant, but after all, all we need if the plain text isn't it? So here is getPlainBody():&lt;br /&gt;&lt;br /&gt;private string getPlainBody()&lt;br /&gt;{&lt;br /&gt;//If we need plain text, i.e. No IFiltering, then do this.&lt;br /&gt;Log.Echo("Calling default parser for " + fi.FullName);&lt;br /&gt;return PlainTextParser.Extract(fi.FullName);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;And all the PlainTextParser is, is:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class PlainTextParser&lt;br /&gt;{&lt;br /&gt;public PlainTextParser()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public static string Extract(string path)&lt;br /&gt;{&lt;br /&gt;string strRet = "";&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;StreamReader sr = new StreamReader(path);&lt;br /&gt;strRet = sr.ReadToEnd();&lt;br /&gt;//Remove carriage returns...&lt;br /&gt;strRet.Replace("\r\n", "");&lt;br /&gt;sr.Close();&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;Log.Echo("Plain Text Parser failed - " + ex.Message + ". Invoking default parser.");&lt;br /&gt;strRet = DefaultParser.Extract(path);&lt;br /&gt;}&lt;br /&gt;return strRet;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Simple huh?&lt;br /&gt;&lt;br /&gt;Well, if you have had the same problems as me, I hope this helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-5051990409513125852?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/5051990409513125852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/04/c-lucenenet-part-2.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5051990409513125852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/5051990409513125852'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/04/c-lucenenet-part-2.html' title='C# Lucene.NET - Part 2'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-2115103170342953447</id><published>2008-04-11T00:46:00.000-07:00</published><updated>2008-04-11T02:03:34.687-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='Lucene'/><title type='text'>C# Lucene.NET - Part 1</title><content type='html'>A few weeks ago I was asked to implement a new website search system, as our current Microsoft Indexing Server was becoming a little unreliable, and was frequently not updating documents when they had been saved. After a little searching around, I came accross Lucene.&lt;br /&gt;&lt;br /&gt;Lucene was originally designed in Java, but since has been ported to several other langauges including perl, php, c++ and of course, .NET - however, the support and documentation for it in .NET is dire to say the least.&lt;br /&gt;&lt;br /&gt;Lucene is purely the engine to allow you to Index files, and then peform searches against it, however, you will have to write all that yourself. Whilst looking for help, I came accross another open source project, called &lt;a href="http://www.codeproject.com/KB/IP/seekafile.aspx"&gt;Seekafile&lt;/a&gt;, but again, all support for this has been revoked. I perservered with Seekafile though, as it was a useful tool. If you are looking for the basics of Lucene, you are probably going to want to look here, at the most&lt;a href="http://www.seek8.cn/dotlucene/index.html"&gt; .NET documentation for Lucene&lt;/a&gt; I was able to find (and prepare to be horrified).&lt;br /&gt;&lt;br /&gt;My intention is to use this Blog to detail my trails and tribulations with Seekafile and Lucene, so if you are just starting out with it, I really hope that some of this will be of assistance to you!&lt;br /&gt;&lt;br /&gt;So, &lt;strong&gt;part 1!&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;What is an IFilter...... and why should I care?&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Seekafile is really useful, don't get me wrong, but I had problems from day 1 getting my head around what an IFilter was, and why the hell Seekafile needed them. Well, in simple terms, an IFilter is an interface to a component that has been pre-written for you, that is able to read a file of a certain type, and return back to you the text content that has been stripped of all the formatting and file nonsense that the host application requires. For example, a MS Word document has plenty of formatting around it, that tells word where, how, and why you have created a pretty looking table in the document for example. When indexing, and searching for that matter, are you interested in that pretty table? no, you just want to know what is inside it, so that is where the IFilter comes in.&lt;br /&gt;&lt;br /&gt;You must know this, Indexing Service uses IFilters for everything, so I assuming, that pretty much all Indexing technology does as well.&lt;br /&gt;&lt;br /&gt;So, IFilters are great huh? Yes, and no. Indeed they have many benefits, such as the fact that Windows natively only supports IFiltering of several key documents (effectively), and if you want to Index something more obscure you simply get another IFilter to help you do this. However, the disadvantage is that you have no control over how the IFilter does this, unless you write your own :-&lt;br /&gt;&lt;br /&gt;If you are looking at IFilters, go here first &lt;a href="http://msdn2.microsoft.com/en-us/library/ms692488(VS.85).aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms692488(VS.85).aspx&lt;/a&gt; where you can find a really useful insight into how Windows decides what IFilter to use for what file type. Obviously, if you follow this, it simply shows you where the IFilter is located, and that then tells you what DLL is going to be used. A more useful tool is from &lt;a href="http://www.citeknet.com/"&gt;Citeknet&lt;/a&gt;, which allows you to take an abstract view of IFilters, as it shows you what you have installed on your system, and which will filter which type of file - a useful overview if you ask me. Microsoft, specifically aimed at Indexing Service, do provide a little info on IFilters in articles &lt;a href="http://msdn2.microsoft.com/en-us/library/ms692540(VS.85).aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms692540(VS.85).aspx&lt;/a&gt; and &lt;a href="http://msdn2.microsoft.com/en-us/library/ms692582(VS.85).aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms692582(VS.85).aspx&lt;/a&gt; and from this, you will see that the good folks at Microsoft help you filter pretty much all their own stuff. Checkout the Citeknet site for some more obscure IFilters.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-2115103170342953447?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/2115103170342953447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/04/c-lucenenet-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2115103170342953447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/2115103170342953447'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/04/c-lucenenet-part-1.html' title='C# Lucene.NET - Part 1'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1459592328824472712.post-8409116106439130536</id><published>2008-04-10T02:11:00.001-07:00</published><updated>2008-04-10T08:43:59.227-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='etag'/><category scheme='http://www.blogger.com/atom/ns#' term='web crawling'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>C# Web Crawling - Knowing when to download a new page</title><content type='html'>I have been using a c# web crawler written by Hatem Mostafa, which is &lt;a href="http://www.codeproject.com/KB/IP/Crawler.aspx"&gt;available on code project&lt;/a&gt;, and I have found extremely useful.&lt;br /&gt;&lt;br /&gt;I have altered this now to work with our database of websites, and hey-presto, I can now crawl all our websites as if I were a user in the external world.&lt;br /&gt;&lt;br /&gt;However, the limitation is this - it is all well and good crawling thousands of pages, but downloading them is costly. So how can you overcome this? use the HTTP Header &lt;a href="http://en.wikipedia.org/wiki/HTTP_ETag"&gt;Entity Tag&lt;/a&gt; which is a hash to identify changes in the file. Check the ETag against a record of files already downloaded, and see if the Etag has changed, if it has, proceed to download. Simple really, and reduces a lot of external traffic on the server as well.&lt;br /&gt;&lt;br /&gt;Of course, this presumes that the web server is configured to send ETag headers, and that the pages aren't so dynamic, the the ETag becomes irrelevant, or is ommitted!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1459592328824472712-8409116106439130536?l=wyerarch.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wyerarch.blogspot.com/feeds/8409116106439130536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://wyerarch.blogspot.com/2008/04/cc-web-crawling-knowing-when-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/8409116106439130536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1459592328824472712/posts/default/8409116106439130536'/><link rel='alternate' type='text/html' href='http://wyerarch.blogspot.com/2008/04/cc-web-crawling-knowing-when-to.html' title='C# Web Crawling - Knowing when to download a new page'/><author><name>Wyerarch</name><uri>http://www.blogger.com/profile/06385205639792101496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://bp3.blogger.com/_8xqZXi9ARMs/R_8qTO6e1OI/AAAAAAAAAAM/prtSddmqiNY/S220/jamie_head.png'/></author><thr:total>0</thr:total></entry></feed>
