Frustrations with AJAX

Aug 29, 2007 at 9:25 PM
Unfortunately the last month, I got busy... combination of buying a new motorbike, and playing too much BF2 after having upgraded my desktop at home. So I didn't spend the time on this like I would have liked.

One of the things I found frustrating about the project as I've constructed it so far, is the page is a mess and hard to read. So I've started down a path of attempting to use a Model-View-Presenter pattern and breaking content panels into user controls. This is also my first time trying to use a MVP pattern, and that I'm finding very intriguing. I find that I'd already been trying to do something similar with user controls, but only in a fashion to make it easy to setup the user control. The MVP allows better seperation of data/logic/presentation. Once one gets the hang of it, it does seem easier to build an app. It requires more forethought of what your page is going to do ahead of time, but that's not bad.

That being said, the problem I have now with AJAX, is wiring it all up. I have panels, and I have buttons, and when you click this button, this should happen, and when you click this one, this should happen. But because this doesn't work quite like I would like it, I have to wire up this fake button which causes this to postback and then update, and... ARRGH!

I'm trying to build the page in such a way that the user controls don't contain AJAX stuff in them, but rather the .aspx page does all the wiring together of the events. It's going to take me a day to think about it and get my mind straight.