dynamic textbox postback
-
hi.. I created dynamic textboxes in repeater control... on post back how do i store values of textboxes
-
i had add button which adds textboxes how do i get all the text box values as text boxs are in repeater control
You can use a counter to generate the ids of the textbox. Every time you generate a text box increment the counter by one and store the value back to session or viewstate. Your code that generates the text box will look something like this.
TextBox newTextBox = new TextBox();
newTextBox.ID = "repeaterTextBox" + Viewstate[“COUNTER”].ToString();
//Add one to counter present in the viewstate and save it back to the viewstate.At the time of retrieving just loop till the value of counter, you can generate all the ids back, by which you can get the values.
Regards, Prakash Kalakoti
-
hi.. I created dynamic textboxes in repeater control... on post back how do i store values of textboxes
you can try the options provided or need to create dynamic controls at on init of the page.
It is Good to be Important but! it is more Important to be Good