How can I set in my button_Click event, visibility of button in gridView to false? All the time it give me an error:Compilation Error
Compiler Error Message: CS0103: The name 'btnTest' does not exist in the current context
<asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView2_RowDataBound"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Button ID="Button189" OnClick="Button189_Click" runat="server" Text="odzemi svez vrganj" /> <asp:Button ID="btnTest" runat="server" CommandName="odzemi" CssClass="button2" OnClick="btnTest_Click" Text="-" Width="100px" Font-Bold="True" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> Following is my button event from where i want to hide button inside gridview.
protected void Button10_Click(object sender, EventArgs e) { btnTest.Visible = true; Button189.Visible = false; }