473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Datalist adding Dynamic controls

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
2 2069
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Yan Wang | last post by:
Hi!: I encounter this problem when I do some tests: I have one user control with datalist in it. The ID for datalist is "dlTest". Then in this control code behind class, I declare a protected...
1
by: Scott Schluer | last post by:
Hello, I've got myself a small problem and I'm hoping someone can help. I have a DataList called dlProducts (displays products from a database). Within the <ItemTemplate> container of the...
4
by: V. Jenks | last post by:
What seems like a simple thing is apparently not so straightforward? I have a datalist. Inside of that datalist is an <itemtemplate> secion which contains other server controls such as a...
3
by: anon | last post by:
Hi All, I would like to make a datalist which takes new information by allowing users(with some button or link) to add new rows to a datalist with some information and save the information.....is...
0
by: bryanp10 | last post by:
I have a DataList on my page which contains multiple DropDownLists. My page defaults to showing six rows in the DataList. I want the ability to dynamically add rows if needed. Right now I'm just...
0
by: KT | last post by:
Hi Everybody I'm hoping that someone can help me as I'm totally stumped. I am trying to populate a datalist using the dynamic templates. I have used the example on Microsofts site, I can't get...
3
by: Jon Paal | last post by:
how do I load controls to the templates for the DataList control. <asp:datalist id="dl1" runat="server" > <ItemTemplate> " how to load control(s) here ????" </ItemTemplate>...
1
by: rn5a | last post by:
An ASP.NET Form has different server controls like Panels, Labels, TextBoxes, HiddenFields etc. The Form has a DataList as well. This is how the DataList looks: <form runat="server">...
0
by: =?Utf-8?B?Y2luZHk=?= | last post by:
I have am dynamically loading a web user control based on the click of a tab strip I load the default control for the first tab in the page load event after checking page is not postback. After...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.