<asp:DataList ID="DataList_projects" runat="server" RepeatColumns="1" DataKeyNames="ID"
RepeatDirection="Horizontal" onitemcommand="DataList_projects_ItemCommand" >
<HeaderStyle ForeColor="Red" />
<ItemTemplate>
<hr style="color:" />
<asp:Label ID="ltlproject" ForeColor="#cc0000" runat="server" text="PROJECT:"></asp:Label> <b><u><asp:Label ID="lblProject" runat="server" Text='<%# Eval("TITLE")%>' ></asp:Label></u></b> <asp:LinkButton ID="lnkEdit" ForeColor="Red" CommandName="Edit" runat="server">Edit</asp:LinkButton><br />
</ItemTemplate>
</asp:DataList>
コードビハインドで
protected void DataList_projects_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
string strId = DataList_projects.DataKeys[e.Item.ItemIndex].ToString();
}
}
私はこれがあなたを助けると思う....