Web 2.0, the big hit. Its everywhere, everyone is doing it. Microsoft has made it very easy for us developers to implment some very cool features of AJAX through the ASP.NET Ajax.NET framework. Simply install, drag and drop and deploy, blammo, you’re done.
But there in lies the problem. What about developers who take this for granted? This turns our profession into a melting pot of people who think they can code but actually can’t do much of anything other than drag and drop. I’m talking about the developers who implement this type of solution and run with it. They have no concern about how it works, why it works the way it does, it just solves the problem. Little did they know, they went through more work getting this done than is required. Continue on…
Introducing the ASP.NET AJAX Confirmation Button Extender…
This extender enhances usability by giving the user a choice of what to do. For example…
I’m all for ease of use, but sometimes even the smartest people can complicate something VERY SIMPLE. We’ve all suffered from Analysis Paralysis at one point in our career and well, I think the Confirmation Button Extender is a product of that symptom.
Why would I want to use the AJAX>NET framework to implement a simple confirmation box when I could use the OnClientClick with a fraction of the code?
Here’s what I’m saying.
AJAX.NET Implementation
<asp:LinkButton runat=”server” id=”LinkButton1″ Text=”test” />
<ajaxToolkit:ConfirmButtonExtender ID=“cbe” runat=“server”
TargetControlID=“LinkButton1”
ConfirmText=“Are you sure you want to click this?” />
ASP.NET Implementation with JavaScript:
<asp:LinkButton runat=“server” ID=“testButton” OnClientClick=“return confirm(‘Are you sure you want to click this?’);” Text=“test” />
These two methods DO THE EXACT same thing. Yes, the markup output is different, but honeslty, the latter of the two is much easier to implement. To implement this in AJAX.NET you have include the dll and js files, blah blah blah.
The problem I have with the AJAX.NET implementation is that its not helping me gain anything. I have to type more code to get the same thing accomplished. I see this as teaching developers its ok to lean heavily on the design time . This is a problem that we’ve been solving for years in web dev. How to send a confirmation to a user, and it seems, just now, a lot of people are just figuring it out due to AJAX.NET and they think its “the only way”, mainly because … well … it worked from a drag/drop perspective. Unfortunately it takes more code than necessary and when the developer finally figures out what it does, they usually say “well why did Microsoft implement it that way? This is soo much eaiser doing by using OnClientClick”.
My answer: “So you could get it to work, quickly. If developers cant figure it out on their own, then its time abstract the problem out into another level, and thats exactly what they did. Removed the knowledge of how and why, and replaced it with an easy to implement solution.”
We call them R.A.D. Tools and sometimes in this industry its a love/hate relationship with them. ๐
Alex says
Tell me about it! Im a web developer and do pretty much anything – But I have never seen the point in aspx – It just completely overcomplicates things that can be done so much quicker and tidier in PHP.