Saturday, 15 January 2011

Integrating jQuery and ASP.NET

We have started to achieve some really good results by integrating jQuery and ASP.NET. I wrote a post back in August 2010 that described my confusion about how best to make the two work together. After some more work we have found that the two technologies complement each other very well - it's possible to create a slick UI and also rely on the data management capabilities of the .NET framework.

It has also begun to alter the way that we work as a team. There is a definite seperation of duties between the UI design and the data transaction design. So now we can have one person working on the look and feel, and when they're happy someone else can follow on behind them and fill in the data 'blanks' - such as making sure that the login process works OK, or making sure that grid views of data are displaying properly. That sort of thing. The division of labour also leads to increased productivity - Adam Smith was right.

The switch to jQuery also means that we can do away with the .NET AJAX control toolkit. I'm really glad to see the back of it. It was inflexible and rigid - the total opposite of the jQuery library.

Thursday, 13 January 2011

Who are you? Who are you? (2)

One of my colleagues solved this and it had nothing to do with using Ping as I suggested in the original post on this subject. Instead we're using something called the 'winmgmts' object, which is actually linked to to SVCHOST process that runs on the Windows OS.

We sent the following command to this object:

"SELECT * From Win32_PingStatus WHERE Address='" _
& HttpContext.Current.Request.UserHostAddress & "' AND ResolveAddressNames=TRUE")

passing in the IP address of the computer connecting to the application on the server and received a collection of results back which we iterated through to find the hostname.

I would never have thought of this in a million years, kudos to my colleague for discovering it.

Friday, 7 January 2011

Using Wordpress as a Content Management System (2)

I got in touch with the Ridgway Ramblers and asked about their experience of using Wordpress as a CMS. Got a nice reply from them:

"I find wordpress quite easy to use as I have no background in this kind of thing. Loading photos etc basically work on the same basis as microsoft word so is very easy. I actually use the very minimum of the tools available on wordpress as I am so inexperienced. I am sure someone with more computer skills could do a lot more with the site than me."

This gives a bit more weight to my argument - it is possible for someone with a basic level of skills to use Wordpress as a CMS and develop an attractive and detailed website.

Thursday, 6 January 2011

Volunteering with Community Groups (3)

I have had a pretty overwhelming response. After receiving little to no interest from organisations advertising on the IT4Communities website my mailshot has brought at least a dozen different requests for help. The work ranges from some simple IT support (uploading a YouTube video and installing Publisher) to improving website design or rankings to teaching some ASP.NET skills.

The response has shown there is a real appetite amongst community groups for IT support that they simply can't afford to buy in. I'm thinking about whether my time might be better spent trying to develop some sort of local network that hooks in IT companies in the area and increases the number of hours available. But maybe that's a step too far.

Who are you? Who are you?

One small problem that we have hit in the last couple of days is figuring out the hostname of the computer that is connecting to our web app. We need this information because we have a queueing system in our One Stop Shops that sends customers to a specific desk when next customer service officer is free.

All our efforts so far have failed because we have only been able to get the hostname of the server that the app is deployed on. There is a libary within the .NET framework that gives you this info and there are plenty of examples on forums that tell you how to extract the value - Environment.MachineName, DNS.GetHostName, Request.UserHostName are three examples that don't work.

One of my colleagues had the idea of doing a reverse DNS lookup so we gave that a shot. Microsoft themselves recommend that you start monkeying around with the settings on IIS but I don't want to do that because I have no idea what effects it may have down the line. Rich Czyzewski suggests a few lines of code in this blog post which we tried out. Unfortunately this failed - we could see the hostname of the server when we browsed to the web page on the server itself. But when we browsed to the web page from our desktops no hostname showed up, and there were no errors being reported through Try / Catch either.

A bit more reading suggested that we try looking at the Request.Server variables collection. This is an array of values that get passed through from the browser. While no hostname was included this does look like a reliable way of picking up the IP Address of the client which is a start. The majority of desktops that will be connecting to our app have dynamic IP addresses so we can't guarantee the same one every time and therefore can't build a lookup table. So I hit on the idea of trying to do something with PING - i.e. get the IP Address of the client and ping back to it to pick up the hostname. I know that if you run the command "ping -a 111.222.333.444" on the Windows command prompt you get a hostname back. So the next step is to try and figure out if I can do something similar from the web server without crashing the application.

Monday, 3 January 2011

Using Wordpress as a Content Management System?

I was contacted by the North and Mid - Cheshire Ramblers Association after my name was forwarded to them by one of the community groups included in my original mail shot last month. They have already have a pretty good site but are concerned about keeping it running; the vast majority of the work has been done by one person and they don't want to end up with a single point of failure.

One of the common themes I noticed when I was having a look through the list of organisations seeking volunteers in the IT4Communities database was that a good percentage were all looking for help with Content Management Systems. This would either involve guidance on choosing the right one to use, or implementing one they have chosen, or making some changes to an content created through an existing CMS. I don't have much experience working with these types of packages and it's definitely something I want to explore further. But my initial thought was this: 'why not use Wordpress'.

After all, many modern sites are centered around blogs and everything else is arranged around the edges. And Wordpress is the biggest (and maybe even the best) blogging tool around. Because it's built on PHP / MySQL it's free, it's simple to install (hey, even a PHP novice like me can set it up). Many web hosting packages already have the option to install Wordpress onto a domain that you register (this is an option available to the NMCRA).

It comes with everything you need to create content out of the box - all the admin forms and security controls. Wordpress has thousands of themes that will make a site look professional, modern, stylish and colourful straight away. Lots of people use it so help is pretty much only a forum post away. And I'm sure with a bit of tinkering (either through widgets, or through some manual coding) one could modify the blog to include any other content necessary.

It looks like the Ridgway Ramblers in South Africa have taken this approach and developed a useful site chock full of photos and information. Hopefully NMCRA can achieve something similar - and maybe other community groups that are looking for a suitable content management system will consider this as a solution too.