datalist control ID problem

W

Wee Bubba

when i click to edit a row within my dataList i can update a textbox
within that row by doing this in the event handler:

public void EditRowHandler (Object src, DataListCommandEventArgs e)
{
// put the selected row into edit mode.
dl1.EditItemIndex = e.Item.ItemIndex;
// get the textbox ID
TextBox myTB = (DropDownList) dl1.Item.FindControl("myTB");
// populate it
myTB.Text = "Hello World!"

I am now trying to do the same from a normal function not an event
handler. but I am struggling. can anyone tell me how to find and
update my TextBox when not in dataList event handler please.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,607
Members
45,240
Latest member
pashute

Latest Threads

Top