Andrew Rowland Is it a bird? Is it a plane? No he's a developer. Andrew Rowland W3C validation of ASP.Net output Thu, 25 Jun 2009 13:01:01 UTC

A while ago I had to make certain that a CMS driven site built in .Net met some validation criteria. Specifically the XHTML markup. Running it by the W3C validator service, the markup always failed.

I fixed the obvious within the web.config. For example, the following is needed to force the application to render XHTML:

<configuration>
	...
	<system.web>
		...
		<xhtmlConformance mode="Strict" />
		...
	</system.web>
	...
</configuration>

If I painfully cut and pasted the HTML into the Validator’s form field, it passed. The problem is, is that the service is not recognised by the Web server, and so a helper file in the application is required.

Tridion Business Connector client Sun, 18 Jan 2009 23:08:14 UTC

A bit of a niche entry this one. Will only be of interest to those who use Tridion, one of the more ‘heavyweight’ CMS solutions.

I generally have a number of repetitive tasks that are extremely tedious to accomplish using the browser based GUI. So I constructed a simple command line tool that allows me to script tasks using a SOAP interface known as the Tridion Business Connector.

The client takes the following arguments:

bcclient.exe /h [hostname] /u [user] /p [password] /d [domain] /x "[request XML]"

Why did I build this? Very useful when called via scripting tools. In my case, Perl.

Happy Christmas Tue, 23 Dec 2008 19:04:41 UTC

I’ve finally got some time off from work. Not managed to update the blog for a few months, which is a shame, because I quite enjoy doing it. I’ve also had a few emails from satisfied customers. Some of you out there actually take the time to post feedback. Much appreciated. Though I had to code a spam filter for naughty stuff that had been submitted. Thankfully I now don’t have to go into the database, and bulk delete entries.

Now that I’ve got the time, I’m going to start writing again. I start work again in the new year, and I’m looking forward to it. As things never stand still in development, it’ll be time to pick up a few books, and gain some new skills.

More Content Management integration coming up for me next year (Tridion, possibly Immediacy), and more ASP.Net work. Also going to brush up on my jQuery, and CodeIgniter knowledge. Really would like to do more Open Source based project work, as I’ve been mainly using proprietary applications during the pass few months. With the economy lower than a fat kids self esteem, I can’t be choosy, just glad to be working.

Have a great Christmas, and I’ll see you a few pounds heavier in the new year.

Validation groups in .Net Sun, 24 Aug 2008 17:52:11 UTC

Evening all. Not posted in a while as I’ve plenty going on in the ‘real’ world. Anyway, last week I was building a search form whereby you could either search by reference code, or by using full search criteria.

The problem I had is that both search ‘forms’ existed on one Web Form, and I was using Validation controls to check each. So when using either submit button, both search groups were validated together. Not useful when I wanted to submit each set of controls independently of each other. So there I was, coding to disable either set of validation controls when a submit button is clicked.

“Validation groups!” I hear you cry. Yes, I know that now.

Using the Zend framework Lucene library - Part 2 Fri, 4 Jul 2008 15:02:41 UTC

In a previous article I talked about using a library from the Zend framework to create a site search. As you try out this functionality using the search box, above right.

I never finished the article, so I’ll explain here how I implemented this using CodeIgniter. I’ll also detail how I built the ‘quick results’ tool (click in the search box).

Linux Mint 5 Elyssa Thu, 12 Jun 2008 21:54:24 UTC

I’ve been using Ubuntu for the past couple of years now, and have found it a perfectly viable alternative to Windows. As I mentioned in my very first post, I’m not a Linux zealot taking a political stance. It’s just a simple preference. If I was a zealot I’d be using a distribution like Gentoo, Slackware, or Linux From Scatch. One for the hard nuts, I just want something that works on my five year old laptop. I’m too tight to upgrade, so that rules out Vista. Now there’s an OS that drives Linux fundamentalism.

In an attempt to challenge my OS of choice, but still keeping within my Ubuntu comfort zone, I installed Linux Mint last week. Once slated as just a friendly, sexier version of Ubuntu, it now seems to be gaining in popularity.

Mint desktop

I’m very impressed. I installed the OS, development IDE (Eclipse based Aptana), Apache, PHP, MySQL, and had the development version of this site up and running within a couple of hours. No messing around getting Flash, RealPlayer, and various audio/video codecs running. Anything I did need to install was a simple apt-get away in the Ubuntu repositories.

jQuery UI Date Picker control issue with .Net Wed, 11 Jun 2008 13:51:34 UTC

Aye, I do whitter on about jQuery. It’s ace. The newly released jQuery UI is pretty special too. One of the many great widgets is the Date Picker control.

I build many .net applications that require date entry, so I implement the Date Picker control often. Unfortunately, there is a problem when it is used on a field that is validated using a .Net validation control. Upon clicking on a date, I get the following error:

length is null or not an object
This only occurs when using Internet Explorer. Currently, my only solution is to edit the source code. Locate the following code in jquery-ui.js or ui.datepicker.js:
inst.input.trigger('change')
Replace it with:
if (!$.browser.msie){inst.input.trigger('change')}

This prevents the change event firing in IE.

I wouldn’t normally advocate changing source code in this manner, as it makes future upgrades tedious. Hopefully it will be addressed in a future release.

Using jQuery selectors to reference .Net controls Wed, 4 Jun 2008 11:40:12 UTC

You place a control onto your page:

<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
	<asp:TextBox Id="Firstname" Runat="Server" />
</asp:Content>
The output is rendered as:
<input name="ctl00$Content$FirstName" type="text" id="ctl00_Content_FirstName" />

In the example above, the disparity in the rendered id attribute occurs because the TextBox control has been placed within a Content control, as the Page object inherits a MasterPage.

So how can you robustly reference the control using client-side JavaScript, regardless where the control resides? Using jQuery it’s fairly trivial:

var $firstname = $("[id$=FirstName]");

This little snippet makes use of the jQuery attributeEndsWith selector, as documented here. Bare in mind that an array is returned, as any control with an id that ends in FirstName will be selected.

Using the Zend framework Lucene library Fri, 23 May 2008 18:20:34 UTC

I know, only a few articles in, so I don’t really need a site search function. But you never know, I might actually keep writing (even if no-one is reading) and so I’ve been looking around for some solutions.

I’ve looked at a few, for example: Swish-e, and Sphider. Nothing really float my boat, until I had a look at the Zend Framework. It’s another MVC based PHP framework, though it looks a little heavier than CodeIgniter. The documentation is not as good either, but it did have a Lucene library.

JavaScript event delegation Sun, 18 May 2008 5:19:58 UTC

As I’ve mentioned previously I’m creating a dashboard to represent the components in the exchange that I work for. Each component widget on the page has a number of events associated with it. This has become less manageable, the more I add. So I thought about using one delegate to handle all events, and pass on a component reference, and parameters to other functions.

A quick google led me to this article by Dan Webb. Looks like a common technique. Very useful article, though I needed to be able to pass parameters to the functions. There may be a better to way to do this, but this is how I achieved it.

Consume .Net Web service using jQuery Tue, 29 Apr 2008 13:55:24 UTC

The JavaScript functionality that is injected into .Net pages seems limited when compared to jQuery.

Whilst looking for a way to use jQuery instead of the stock Microsoft client library, I came across this excellent article.

There doesn’t seem to be too much on Web about this subject. Maybe most .Net developers stick to Microsoft tools, but I like using jQuery for all my client scripting, and would rather not use more than one library. So as it look me a while to get example code working, I’ve included my efforts.

CodeIgniter and Ajax Sat, 26 Apr 2008 21:47:01 UTC

I’ve been asked to create a dashboard for many devices across our network. To display real-time information on each component, I’m thinking of using Web services, and AJAX. Like most aspects of coding, using a framework to do all the heavy lifting, rather than developing your own, is a sensible approach.

So today I took a look at jQuery, a JavaScript framework. I have to admit, I’m pretty impressed. It did not take me long to come up with some example code, that degrades well when JavaScript is disabled in the browser.

Welcome... Sat, 26 Apr 2008 21:46:28 UTC

Evening all. This is the first post of what is sure to be many. Well, I say many, as I suspect I’ll get bored with my new toy at some point.

The main point of this site has been completed. I’ve stumbled upon one of the best lightweight frameworks I have ever used, and decided to build an application.

The framework is CodeIgniter. It uses the MVC design pattern methodology.