I am trying to change the visibility of a button which is inside a table in a formview. But I am unable to find the control.
UserControl Page
<asp:FormView ID="FormView1" runat="server" DataSourceID="ds1" DefaultMode="Edit" OnItemCommand="FormView1_ItemCommand">
<EditItemTemplate>
<table id="t1">
<tr>
<td >
<asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
</td>
</tr>
</table>
</EditItemTemplate>
</asp:formview>
I want to change the visibility of "InsertButton" to false.
Button btInsert = (Button)FormView1.FindControl("InsertButton");
if (btInsert!=null)
{
btInsert.Visible = false;
}
COuld Anyone, explain me how can i find the button control, I get the null value only I am able to find FormView, but not the Buton control