I want to present details of a shopping cart in a .aspx page using an HTML table with columns that show product code, description and price and show quantity as an adjustable dropdown box. The number of rows will depend upon the number of products purchased.
I have got this working using a text substitution mechanism where a template file is used to control the table format, headings and columns and I substitute the appropriate text as data at run-time. Generating the dropdown showing the correct quantity selected is a little awkward but manageable. I end up with a large chunk of HTML that I place in the text property of an ASP.NET label control. It works but I have yet to start dealing with changes the user may make to the quantity dropdowns.
I am aware that I could achieve something similar using an ASP.NET table control and dynamically add rows, cells and controls at runtime. I expect this might make it easier to manipulate the changes in quantity but it all seems a bit like a hammer to crack a nut.
I'm not sure which is the "best" approach nor indeed whether I may have missed any options. I can't see a way, for example, to fix the columns of the ASP.Net table at design time which might make things a bit easier.
Any thoughts and ideas would be appreciated.
I have got this working using a text substitution mechanism where a template file is used to control the table format, headings and columns and I substitute the appropriate text as data at run-time. Generating the dropdown showing the correct quantity selected is a little awkward but manageable. I end up with a large chunk of HTML that I place in the text property of an ASP.NET label control. It works but I have yet to start dealing with changes the user may make to the quantity dropdowns.
I am aware that I could achieve something similar using an ASP.NET table control and dynamically add rows, cells and controls at runtime. I expect this might make it easier to manipulate the changes in quantity but it all seems a bit like a hammer to crack a nut.
I'm not sure which is the "best" approach nor indeed whether I may have missed any options. I can't see a way, for example, to fix the columns of the ASP.Net table at design time which might make things a bit easier.
Any thoughts and ideas would be appreciated.