Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Accessing controls within a datalist footer template

Reply
Thread Tools

Accessing controls within a datalist footer template

 
 
Paul Maidment
Guest
Posts: n/a
 
      08-07-2003
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!

 
Reply With Quote
 
 
 
 
Nick Berardi
Guest
Posts: n/a
 
      08-07-2003
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

Paul Maidment wrote:

> 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!
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with DataList within DataList Will ASP .Net Web Controls 4 10-18-2007 03:19 AM
Accessing the DataList footer in ASP.NET amiga500@gmail.com ASP .Net 3 10-16-2007 04:31 PM
Any way to reorder how a datagrid is drawn (header/footer/items vs.header/items/footer)? Henrik ASP .Net Datagrid Control 1 07-06-2006 12:23 AM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM
Access to controls in footer template George ASP .Net Datagrid Control 5 05-12-2004 07:56 PM



Advertisments