I’ve been delving into ASP.NET programming lately and one thing that immediately struck me as odd is just how many controls end up on an ASP page.
A typical data entry page consists of, generally, lots of labels and textboxes, a few option buttons or check boxes, even fewer combo boxes and list boxes, a grid maybe, and few buttons (buttons, links, whatever they happen to look like).
Granted, depending on the application, you may have a few particular screens that are more complicated (say, a scheduling screen), but by and large, for general data input, that about sums it up.
But when I look at what’s involved in ASP.NET to make that happen, it’s almost mind boggling.
Of course, you have a label control for a particular field, you have the field itself, but then you have separate validator controls for each kind of validation you might want to perform. Add in tables to get things to line up nicely
To me, it seems much more logical to have one “data input” control, that can handle all (or rather the most common) data entry tasks via properties.
Want a caption above the input box, rather than to the left of it; set a property. Want the text to be validated a alpha numeric, but only including A-F, and it must be > 4 chars, less than 10, blah blah; set a property (or two). What this field to be a choice between True/False; set a property to make it a radio button group, a list, or a drop down combo box.
Ages ago, there was a UI package called SmartUI. Looks like it’s now sold by Xceed. No idea whether it’s any good now. It was ok back then, although it had it’s share of issues. But I always thought the idea was right. One control that could do all sorts of the most common data input type tasks, just by dropping it on a form and setting a few properties.
I completely understand the idea of “modularizing” functionality and the ASP control model definitely does that.
So my question is, is that the best way?
All those controls eventually just render HTML anyway, so is there a penalty for one big control vs lots of little ones rendering that html?
Does it make the page easier for the user to work with?
Do separate little controls make it easier for the developer?
Microsoft used to say that INI files were the absolute best way to store your application settings. Then it became the registry, and INI files were passe. Now, it’s back to INI files…albeit with a lot more tag stuff, funny angle brackets and often terrible formatting…oh, right, I mean XML files.
My point is, I’m not one to just accept Microsoft’s take on a topic, no matter how much framework they’ve thrown at it.
And I’m wondering if their control model might be another one of those reasons to break with the pack.