I have been up in Orange County these past few days doing one-on-one training and consulting with an individual wanting to take his .NET skills to the next level. In any event, he showed me a neat little shortcut he uses for creating his ASP.NET Web pages and code-behind classes. In his job as an independent contractor, he is working for a company that needs a lot of data entry Web Forms, all of which are gargantuous in the amount of data needed to be collected. For example, he'll get sent an Excel spreadsheet listing over 200 fields they want to capture in a Web Form.
Clearly creating a Web Form with 200 Web controls could take all day; adding the code to insert the data into the table could take another full day. And, to top it off, both tasks are extremely repetitive and boring. This gentleman's solution, I thought, was rather clever. He creates an Excel spreadsheet and copies over the names and descriptions of the fields they want. He then specifies the database fields these various entries refer to. Then, for each row in the spreadsheet, he has a few columns that essentially piece together the values in the other columns along with code or HTML/Web control markup. The end result? After he has copied over the 200 fields and descriptions and has specified the database fields the input fields relate to, he can literally just cut and paste the generated HTML into the HTML view in VS.NET and his UI is done. He can then cut and paste the database updating/inserting code into his code-behind class, and he's just about finished the Web Form.
Granted, he should be using a DAL and business objects, and a tool specifically designed for code generation, like CodeSmith or LLBL Gen, but, regardless, I had never thought of Excel as a tool one would use to generate HTML and source code. Neat.