0

I want to change the visible state and enable state of a link button inside a data list when another button in the same data list is clicked.How can I do that?

Here is the code:

if (e.CommandName == "Save")
{
    DataListItem item = (DataListItem)(((LinkButton)(e.CommandSource)).NamingContainer);
    LinkButton lnk=(LinkButton)item.FindControl("LinkButton2");
    lnk.Visible=false;
}

This code is not working

Arulkumar
  • 12,966
  • 14
  • 47
  • 68
nithya
  • 1
  • 3

1 Answers1

0

Hello I am a bit late in answering this but for Linkbutton to change its visible state by using display:none

 lnk.Attributes.Add("style", "display:none");
Krsna Kishore
  • 8,233
  • 4
  • 32
  • 48