Hi
I've recently upgraded from classic ASP to ASP.NET, and have been quite impressed by all the ready-to-use server controls available that you can just drop on your page, customize, and use. It really cuts down the amount of code in your page, or your code-behind page. Or so I thought...
I've been building a few websites and getting stuck quite frequently on what I would think are fairly simple things, like binding a checkbox in a gridview to a datasource, as the control is a True/False text and the DB column is a bit, or Using the footer of the gridview to insert records, which doesn't work when there are no records in the table - to name just a few.
Whenever I search online for help, most examples use AMPLE code in the codebehind. Most binding or data retrieval or general logic is actually done in the code behind. To me, this seems wrong as the whole point of .NET was to reduce the amount of code required for common web functionality.
Another classic example is that I can easily set up validation on the client side for blank fields, regular expressions, etc. But then as soon as I have a unique column on a table, there is no way in the HTML controls to validate this, so I have to use server-side (or rather, custom-written hand coded) validation in any case!!
But the more I hit little snags & bugs, the more I'm tempted to go this way myself and claim back the control that I had in class ASP. (In fact, the more this goes on, the more I'm tempted to teach myself PHP!!!)
What I want to know is, from an experienced developers perspective, is it better to code it yourself in the code-behind, using (for example) datasets and datatables and connections, rather than just dropping the server controls on the page & customizing?
I'm trying to decide on which way is better as whichever path I go down now, if it's the wrong one, it will no doubt cost me a LOT of time to change later.
Thanks for any input.
Sean