By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,876 Members | 1,410 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,876 IT Pros & Developers. It's quick & easy.

Datalist adding Dynamic controls

P: n/a
Hello

I have a Datalist, that I fill with the PopulateList() method. This method
selects all Items from Database and binds the Dataset to the DataLilst. Now,
when clicking Edit, in the Editcommand I add some dynamic TextBoxes to a
PlaceHolder in the EditItemTemplate.

So fare, all fine - now, when I select Update, in the UpdateCommand-Event I
want to get the Value of these added TextBoxes. My Problem is now, when I
just search for the PlaceHolder and check all controls inside, it is empty.
So I run the PopulatePlaceHolder method also in the UpdateCommand and i find
the controls, but they don't have any values inside.

Can someone help me

Thanks
Patrick
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jos
"Patrick" <pa********@bluemail.ch> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello

I have a Datalist, that I fill with the PopulateList() method. This method
selects all Items from Database and binds the Dataset to the DataLilst. Now, when clicking Edit, in the Editcommand I add some dynamic TextBoxes to a
PlaceHolder in the EditItemTemplate.

So fare, all fine - now, when I select Update, in the UpdateCommand-Event I want to get the Value of these added TextBoxes. My Problem is now, when I
just search for the PlaceHolder and check all controls inside, it is empty. So I run the PopulatePlaceHolder method also in the UpdateCommand and i find the controls, but they don't have any values inside.


You need to run the PopulatePlaceHolder method in Page_Init instead,
so that the controls are already in place when they are filled with their
viewstate information (this happens after Page_Init and before Page_Load).

--

Jos Branders
Nov 18 '05 #2

P: n/a
Hi Jos
You need to run the PopulatePlaceHolder method in Page_Init instead,
so that the controls are already in place when they are filled with their
viewstate information (this happens after Page_Init and before Page_Load).


Thanks for your answer. This is a good Idea, but the problem is, I add this
TextBoxes to the EditItemTemplate, so on the PageInit there is nothing in
Edit, so it won't add anything. And afterwards, when I edit something, that
code won't be executed.

any other good ideas?
Thnx
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.