Accessing controls within a datalist footer template

  • Thread starter Thread starter Paul Maidment
  • Start date Start date
P

Paul Maidment

Hi,

I am a bit green when it comes to .net development so
please excuse me if this question is obvious or has been
asked before...

I am trying to programmatically access a label control
within a datalist footer template using asp/vb.net. I have
been searching
through the documentation but can only find reference to
creating a footer template programatically, rather than
accessing the controls within one.

If anyone has done this, or can point me in the direction
of some sample code, that would be fantastic!

Cheers!
 
try this paul.

dataList_ItemDataBound (object sender, DataItemEventArgs e) {
if (e.Item.ItemType == ItemType.Footer) {
Label l = (Label)e.Cells[0].Controls("labelname");
l.Text = "New Text";
}
}

I don't have access to a program that I have done this in where you pull
out the cells and find a control with in them. But I think you will get
the basic understanding of what has to be done.

Nick
 
Back
Top