Wednesday, 26 August 2009

OnRowCommand fires when GridView sorting

When sorting is enabled in a GridView, OnRowCommand is fired for the column headers prior to the sorting event. This seems odd to me as I don't see the header row as a proper row, but I guess that's the way it is. The upshot of this is that if you add a functional button to your rows you need to specify a specific CommandName for it, so that the handler for OnRowCommand knows not only what to do, but when to (and when not to) do it:

Sub onRowCommandActioner(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)

If e.CommandName = "SpecialFunction" Then
'do your special stuff
End If

End Sub

And for this you'd add the following parameter to your button field:


This means that your special stuff will only be fired for your specific command and sorting will be fired as normal. I was today however scratching my head for a little while today as it still wouldn't sort for me. This was resolved by putting my GridView into an UpdatePanel.

Monday, 24 August 2009

Function keys on my laptop

Visual Studio developers use their function keys a lot, particularly when debugging, and it was becoming a pain for me having to hold down the blue Fn key on my Dell Inspiron when stepping through code. It turns out that the only way of locking this button on (I had hoped for a 'Fn Lock' setting) is by going into the BIOS on startup (F2) and changing it in there. It's pretty obvious once you're there, but I'm amazed this had to be a BIOS setting rather than something a little more accessible.

Having done this I can now step through code with one finger, but I now have to use the Fn key to access my wireless, battery and multimedia keys. No problemo.

Monday, 17 August 2009

Dell chat support - what a pleasure

My DVD drive disappeared from my Inspiron laptop today, just when I needed it. I tried restarting, uninstalling and re-installing the drivers from Dell etc., but my machine just wouldn't recognise it, with errors in the Device Manaager telling me that the drivers weren't installed properly.

This is when I was relieved I had bought a Dell, because within a few clicks I was chatting online to a Dell support specialist called Sarafaraz (in the Americas - not sure where, it could have been Bolivia for all I know) who logged into my machine using GoToAssist.

I sat back and watched the action - they tried exactly what I had done, and it didn't work. Then after a few registry edits and a remote restart it was all working again. Apparently a documented issue caused by multiple disc-burning software. Very odd, but Sarafaraz sent me a link with instructions to do the same fix if it happens again.

All in all a great experience; I didn't have to queue to wait for attention, and I could get on with some work on my other machine in between our exchanges. Brilliant!

Tuesday, 11 August 2009

Grammar, detail and OTT SEO

I was looking into online payment solutions (Payment Service Providers, don't you know) and ended up drifting a bit via the Protx (sorry, Sage Pay) website to have a cheeky look at their 'Web Developers' page. This is how I ended up on a digital agency's website to be confronted by the following grammatical clanger, on the home page, right at the top.
working with clients from small start-ups through to large corporate's has given us a great perspective

If I were a potential client I may be worried by this lack of attention to detail, but to be fair I've seen this kind of thing before. When a digital agency builds their own website often the same processes aren't followed as would be for client work, content is subject to less scrutiny, and the apostrophe-abusers have free reign.

And then I found another PSP, whose name you can see below. They also have a grammatical error (independant) but amazingly they feature an offer on their homepage that expired 9 months ago. Is anybody actually there?

I didn't stay long enough to find out.

And then, onto another well-known PSP, Netbanx. They've been in this business for a long time; I recall using them several years ago for an entertainment ecomms site that I built. But their website now is a big disappointment - it feels like it was written entirely by an SEO (Search Engine Optimisation) expert. It says lots of the same thing over and over again in lots of different ways, with lots of links to the same things said in a different way yet again, all in the pursuit of a good position on Google. And it actually manages to provide me with absolutely none of the information I need!

Monday, 3 August 2009

Creating a new app pool in IIS

This is one of those things I do so infrequently that I keep having to re-learn it every time. This is made more difficult by the fact that I find the IIS interface so completely unintuitive; I always end up going round the houses and then pronouncing "ah, that's it!" when I finally remember what I did last time.

The thing I always struggle with is the fact that the 'Application Pools' branch seen in the image below doesn't really do what I expect it to do.

I start by right-clicking on the Application Pools folder and choosing to create a new App Pool. then I call it whatever I want, and then it appears in the list of Application Pools. now what?

Well, the Eureka moment comes later in the 'Web Sites' folder. Select your web site, or a directory within it, right-click on properties, and select the 'Home Directory' tab. You'll see this:

At the bottom is an 'Application Settings' interface - it is here that you setup your web-site (or part of it) as an application (call it whatever you want), and it is in the last drop-down called 'Application pool' that you will the App Pool that you created earlier. Hey Presto.

For some final tweaks you'll want to set the Execute permissions to something more than 'None', and you'll want to go into the ASP.NET tab in the Properties window to set the version. Sorted.