Thanks for the prompt response and example code.
Being a newbie I was making a silly mistake I think. I'd come up with much the same code and could not get it to work on my development machine using the Visual Studio Development Server. When I published the little test application to my test server it
I must have my development environment and/or priject files configured incorrectly, but I'm not sure where I've gone wrong.
I assume I should be able to debug and deploy the same code and it work ok, so the fact that it works on the web server but not my development machine indicates a mistake on my part?
Many thanks for your help,