Stefan Says

Opinions on ASP.NET, ASP, databases etc
posts - 34, comments - 25, trackbacks - 23

Ajax - not always the best solution

Right now I am creating what might look like the classic schoolexample of Ajax:

 

Basically we are talking about three linked dropdown boxes -  when selecting a value in the first box the second one should be enabled and filled and when selecting a value in the second box (Serie) the third box should be filled with values - depending on what's selected in the two other boxes.

First I created a Ajax solution for this. I.e when selecting a value in box 1 (År) I made a Ajax callback and retrieved values to fill in box 2 (serie). However, soon it struck me - when considering the total number of values in my specific scenario (about six values in the first box ,  max two in second box and about 3 in the third ) I felt I was overworking it making use of Ajax.

It makes sense to use Ajax for linked selectboxes when datasets are either large or extermely volatile, but in my cause: for my limited set of data I ended up generating (from my asp.net code) the Javascript needed for each scenarios - therefore I got NO postbacks at all. 

 

Print | posted on Monday, November 06, 2006 9:41 AM