Last post Oct 02, 2008 05:00 PM by alex2go
Oct 01, 2008 11:50 PM|alex2go|LINK
I need to have one <INPUT type="hidden"> for each item in a cart. Can I use C# to create tags dynamically based on the number of items in my cart?
My cart page if needed:
Your Shopping Cart is empty.
Oct 02, 2008 02:16 AM|Jones0878|LINK
Of course you can. You would just want to place named placeholders in the areas in which you would want to add either your controls or your html that you are looking to 'inject'. Then simply use some code behind something like the following ....
// phHolder is our named placeholder on our page.
phHolder.Controls.Add( new LiteralControl(html) );
Hope this helps!
Oct 02, 2008 03:08 AM|barrybritanico|LINK
For an alternative you can also write the tag using Response.Write, put it in a loop and increment the control properties. But AJ's approach is much more simple.
Oct 02, 2008 05:35 AM|ajaykhedekar|LINK
Kindly checkout follwoing link
Oct 02, 2008 05:00 PM|alex2go|LINK
I used AJ's method - works great.