ListView: OnItemDataBound

by Pieter Brinkman 23. July 2008 22:57

Get dataItem onItemDataBound (don't forget to replace the bold parts with your objectname):

protected void MainPostListView_ItemDataBound(object sender, ListViewItemEventArgs e)

{

YourObject item = (YourObject)((ListViewDataItem)e.Item).DataItem;

}

 

Findcontrol within the itemtemplate:

HyperLink hplTitle = (HyperLink)e.Item.FindControl("hyperLink");

 

 

Tags: , , , ,

ASP.Net | Controls

Comments

11/30/2009 10:17:20 AM #

roger

Probably the greatest thing I ever read, this post is what the internet was invented for

roger United Kingdom

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About Me

My name is Pieter Brinkman I am Solution Architect for Sitecore in The Netherlands. My interests are mainly ASP.NET, MSSQL and Content Management Systems.

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

RecentComments

Comment RSS

Most comments