AJAX Hosting with 1and1

28 09 2007

Well actually they don’t! 

As of publishing this blog, the web hosting company that I’ve hosted several projects with has been 1and1, and I’ve used a handful of other web hosting companies.  I really am not sure which hosting companies seem to be the best, its a bit of a minefield.  There are so many factors to consider such as reliability, uptime, available features and one that I think is most important is support.  If support is not great, then when you run into problems this can be a real nightmare.

Recently, I was about to start a new project and wanted to start using AJAX technology to get the project up and running.  Unfortunately the web hosting company 1and1 told me that they don’t support AJAX.  A major company like 1and1 not supporting a major technology like AJAX?

Fair enough, AJAX is a relatively new technology but there are other companies that are supporting it.  So I repeatedly ask them whether they were certain, and I got varying answers.  At one point they said they did, and silly me, trying to be optimistic, went ahead building my website using AJAX.  When it came to deploy to the server, low and behold none of my AJAX pages worked!  So I shouldn’t have believed them after all!!  I had to rip out all my AJAX components from the pages to get it working.

So for my next project I’ve learnt my lesson.  Only believe they support a technology if they explicitly state it on their list of supported features on their packages.

In fact I’m going to try a different web hosting company this time.  2 other companies I’ve had quite good experience with are Hosting UK and Fast Hosts.  Both have quite reasonable support and both support AJAX.

I’ll let you know how I get on!





Overlay images onto a page using LightBox2

26 09 2007

A friend recently asked me to produce a photo album of his recent wedding.  I thought ‘why not just use Picassa Web Album?’.

Well I was already hosting his web site, and he actually suggested me hosting his album too.  Simply by adding a obfuscated URL path to his current website address and then providing a few HTML pages with the thumbnails of his pictures, I could quite easily achieve that.

First thing I had to do is upload smaller versions of the photos, and I did this using Adobe Photoshop, using the Automated Batch facility to resize the files to 20% of their original size.

I then set out to produce the HTML & CSS, which was basically some very simple headers, a dark background and a special ‘Thumbnail’ DIV to hold each image, all floated left to ensure they all aligned next to each other.

Now I’ve seen this particular technique before on quite a few web pages and especially other galleries, sometimes used by professional photographers.  The technique is to click on a thumbnail and overlay the thumbnail with a larger pop-up of the image.  This is all achieved using HTML, CSS and JavaScript.  I’m not a JavaScript guru, but there is quite a simple process to get this going.  Try this bit of kit at LightBox2!





FindControl on a CreateUserWizard template

26 09 2007

I wanted to be able to customise the CreateUserWizard control by adding some components onto the CreatedUser template such as a few labels, and then display the username and password in these labels.

The first thing is to ensure the code for this goes in the following event stub:

CreateUserWizard1_CreatedUser

You then need to access your labels on the template. Heres how:

Dim lbl As Label
lbl = CreateUserWizard1.CompleteStep.ContentTemplateContainer.FindControl("lblUsername")
lbl.Text = etc....

As easy as that!





First time using wordpress!

26 09 2007

Well I’ve been meaning to try out a blogging tool out for ages but just haven’t got round to it. So I’m going to try out the tool on a ‘trial-basis’ to see if I like it!

So here goes…





GetPassword exception in ASP.NET membership

26 09 2007

I tried a new method call today on ASP.NET MembershipUser.

Dim thisUser As MembershipUser = Membership.GetUser(thisUserName)

Then I called the following:

lbl.Text = thisUser.GetPassword

and got the following exception:

This Membership Provider has not been configured to support password retrieval.

After some investigation I noticed I needed the following in my web.config (Notice those in RED are the attributes that are required and were added in order to support the GetPassword method):

<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
connectionStringName="247Db"
minRequiredPasswordLength="4"
minRequiredNonalphanumericCharacters="0"
type="System.Web.Security.SqlMembershipProvider"
applicationName="/247App"
enablePasswordRetrieval="true"
requiresQuestionAndAnswer="false"
passwordFormat="Encrypted"
requiresUniqueEmail="false" />
</providers>
</membership>

Following these additions, you need to add the following to web.config. There is a automatic key generator at the following: machineKey Generator

<machineKey validationKey="11D7D8362528F04266ACACDDEA7..."
decryptionKey="4C0..."
validation="SHA1"/>

You should then be able to support the GetPassword method().

If you don’t add the machineKey then you’ll get a different error as follows:

You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.

Nice error hey? This is part & parcel of understanding a lot of the ASP.NET membership framework, you fix something somewhere, and you end up with a different error somewhere else. Its a big learning curve but a worthwhile one at that!





Renaming/Changing username in ASP.NET

24 09 2007

I came across a situation today where I wanted to change usernames of a set of users within my web app. I created a list of around 20-30 administrative users all with usernames based on the location of their office. However, I’ve now been advised that these usernames would be better stored as 2 letters. This would certainly make login easier for the administrative users, but I now have the task of either deleting them all and starting again or finding some other way of renaming the usernames.

After a quick google, I’ve noticed there is no quick way of doing this apart from this method described here:

Change username in ASP.NET

Maybe this will be something that will be added in future versions of ASP.NET?!

Today, I had to go through all the usernames and change them, and all I ended up doing was using the Database editor (in t his case myLittleAdmin) provided by my web hosting company.

It was as simple as clicking on the aspnet_Users table and then modifying each row, in particular the UserName and  LoweredUserName fieldsYou could even create some SQL to go and update each row based on some other piece of data perhaps?





An online mp3 tagger

19 09 2007

I’ve been thinking recently about starting my own little web development project away from work and I’ve had several ideas, one of which one is an online mp3 tagger. Now I realise that for quite a while there has been the CDDB application from GraceNote which recognises a CD from the CD’s unique ID. Basically it carries out a check on their own database over the Internet.

Recently I’ve noticed that within my own mp3 library I have hundreds of ‘orphaned’ mp3s, with no mp3 tag information within my digital library. No track information on the mp3. Most of the time mp3s have their track information included because they have that information included when downloaded from a mp3 site or when an album is ripped. My problem has been due to ripping my own CD compliations, or albums that haven’t been recognised by CDDB when they have been ripped.

I thought, what if I could develop my own software which takes a checksum of the first few bytes of the song and compares it to a database? Surely that would be a unique way of identifying an mp3 song? Two problems, first by designing my own recognition s/w I would have to ensure I also maintain a massive database of tracks & information along with their unique IDs. Not the ideal situation!

After some investigation I realised that a few companies have already done this using acousting fingerprinting. They use an algorithm which generates a unique ID for an mp3 or other audio track which isn’t effected by the quality of the track (since mp3’s come in a variety of different formats).

One organisation which might provide enough of the cogs to get this idea going is MusicBrainz. They already provide a few tools which allow recognition of mp3 tracks. They also use this acoustic fingerprinting technique so their s/w no doubt would be much more reliable at detecting different mp3 tracks than anything I write!! Also, they have an online database of music which is constantly being updated including editors of the BBC.

My idea would basically be to provide the same thing as their downloadable mp3 tag repairing applications, but provide this through a web front-end. Basically you just feed in your orphaned mp3 track and it squirts it back at you complete with the tag information included!