How to dynamically generate textboxes when record is edited?

Posted by Laghaterohan under ASP.NET on 6/25/2011 | Points: 10 | Views : 1329 | Status : [Member] | Replies : 2
Hello,

I have a textbox in which i enter a count of the no of textboxes i want to generate(Using JQUERY)...say 5.
I save the values entered in these textboxes and display them in the grid...However on editing i want to show all these values again in the textbox.
My question is how to generate these textboxes again dynamically depending upon the records???

Thanks!

Best Regards,
Rohan Laghate



Responses

Posted by: Bugwee on: 6/26/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

I think you need to use an asp.net repeater control to generate the textboxes depending upon the records.
http://www.codeproject.com/KB/database/repeater_in_gridview.aspx
http://www.c-sharpcorner.com/UploadFile/navin.cp/N1006232008050100AM/N10.aspx

Regards,
Bugwee

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 6/27/2011 [Member] Starter | Points: 25

Up
0
Down
try this

textbox tb;

for(int i=0;i< gridview1.column.count -1; i++)
{
tb=new textbox;
tb.id=i.tostring();
}
panel1.controls.add(tb);
or
placeholder1.controls.add(tb);


Thanks&Regards
LakshmiNarayana Nalluri.

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response