Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

i want to create dynamic row with a textboxes.
e.g.

i have a row like below:
SR.NO NAME QTY RATE AMOUNT <- these are labels in first row
__ __ ___  ___  __  ____   <- these are textbox in second row  

ADD NEW <- button 

when i press ADD NEW Button, i want to create new row and 6 textboxes.


so,how can i achieve this..
please help me..

Thanks and Regards..
Mitesh
Posted

1 solution

Hi,

You have to create one user control which contains this Labels and Textboxes.
Now there will be one button to add new item. When you click on that you have to add the user user control dynamic.

To maintain the view state of dynamic created user control see the below link.

Retaining State for Dynamically Created Controls in ASP.NET applications[^]

Thanks,
Viprat
 
Share this answer
 
Comments
[no name] 15-Sep-12 4:46am    
but i use HTML table. so it is done as per your link.
VIPR@T 15-Sep-12 5:16am    
I think it doesn`t matter. Just make one user control with all this cotrols. Then load that control dynamically on Add New Button. If you will maintain View States like above link then it using loop you will get values of your user control`s control value.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900