aspx ページ:
<asp:ListView ID="ListViewPosts" ItemType="Post"
SelectMethod="ListViewPosts_GetData" runat="server"
OnItemDataBound="ListViewPosts_ItemDataBound">
...
...
</asp:ListView>
コードビハインド:
protected void ListViewPosts_ItemDataBound(object sender, ListViewItemEventArgs e)
{
...
Post p = Item; //where Item stands for the current Post record in ListView.
...
}
私がこれListView
をどこに持っていればItemType="Post"
; Post
データベーステーブルです。コード ビハインド メソッドでItem
(テーブルの現在のレコードを表す)の現在の値にアクセスする方法Post
ListViewPosts_ItemDataBound