Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <asp:DataList ID="Dlitems" runat="server" RepeatDirection="Horizontal" RepeatColumns="4"
- CellPadding="0" CellSpacing="15" OnItemCommand="Dlitems_ItemCommand">
- <HeaderTemplate>
- <asp:Label ID="lblcat" runat="server" Text="" />
- </HeaderTemplate>
- <asp:DataList ID="Dlitems" runat="server" RepeatDirection="Horizontal" RepeatColumns="4"
- CellPadding="0" CellSpacing="15" OnItemCommand="Dlitems_ItemCommand"
- OnItemDataBound="Dlitems_ItemDataBound">
- ...
- protected void Dlitems_ItemDataBound(Object sender, DataListItemEventArgs e)
- {
- if (e.Item.ItemType == ListItemType.Header)
- {
- Label lblCat = (Label)e.Item.FindControl("lblcat");
- lblCat.Text = "Changed!";
- }
- }
- protected void dlData_ItemDataBound(object sender, DataListItemEventArgs e)
- {
- try
- {
- if (Page.IsPostBack)
- {
- if (e.Item.ItemType == ListItemType.Header)
- {
- Label lblCat = (Label)e.Item.FindControl("lblcat");
- lblCat.Text = "Changed!";
- }
- }
- }
- catch (Exception ex)
- {
- throw;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement