Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generate table at run-time

Status
Not open for further replies.

Glasgow

IS-IT--Management
Jul 30, 2001
1,669
GB
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.
 
OK I'll take a look at those thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top