Solved

Dynamically copy and create html table

Posted on 2010-11-21
5
762 Views
Last Modified: 2012-05-10
Hi

I have a small table within a CollapsiblePanelExtender.  It has two dropdowns and a few textboxes.

When a user clicks a button, I would like to copy this table and controls and then place the copy underneath the current table.

How would I do this?

Thanks
0
Comment
Question by:Sheritlw
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:meispisces
ID: 34186794
Please explain in detail. What do you mean by "copy"?
0
 
LVL 11

Expert Comment

by:madgino
ID: 34188589
Beside copying the content the question is how would you use the new section as if you want to post the data the controls will have to have different id's for the dropdowns and comboboxes.

So I think the solution is not to 'copy' the content but to manually construct it using html code and new controls.
Here's an example on how to add controls to a panel:
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_22765581.html
0
 

Author Comment

by:Sheritlw
ID: 34190857

Since I have given up on the gridview and users will only add 1-4 records, I created a table with the fields I need and thought I would copy the format etc from the existing table and append a number ie. id = txtDescribe & "1"
I'm sure I can figure out how to recreate the table, but how do I place it below the other table?
The table is in a panel, so there should be a way to add the table below the one being copied.
Thanks
0
 
LVL 11

Accepted Solution

by:
madgino earned 500 total points
ID: 34200784
You should create an user control with your table and fields and dynamically add it to the page.
Here are some helpfull links:
http://www.codeproject.com/KB/user-controls/DynamicUC.aspx
http://www.4guysfromrolla.com/articles/092904-1.aspx
0
 

Author Closing Comment

by:Sheritlw
ID: 34202827
That is a good idea
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now