|
fwiw- As Old Pedant stated, his code is a hack.... it can be refined a h*** of a lot more, but (and I assume he posted it so it would be on your playing field of understanding) there are many ways of doing this- and it all depends on your style of coding (or if you are working for someone their requirements/style of coding). For example if I were doing this I would (in the code behind) on page load (!postback) hit the db and populate a collection (maybe a datatable, if needed a custom class) and then create the appropriate html objects and litterally add them to the page at runtime. This allows you to seperate your data access layer and buisiness layers from your presentation layer. But that is a waaaaaay to much to dump on someone learning.
|