we need to use OnItemCommand in the inner datalist
Check the below code for implememtaion:
Asp.net Page:
<asp:DataList ID="dlItems" runat="server" OnItemCommand="dlItems_ItemCommand">
Implement OnItemCommand in serverside as below
protected void dlItems_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandName == "Update") { TextBox txtname = e.Item.FindControl("txtName") as TextBox; lblName.Text = txtname.Text; } }
No comments:
Post a Comment