0

I have a Gridview based on a Acces DB in .aspx

I added +1 column to the grid, which is:

<asp:TemplateField HeaderText="view">
 <ItemTemplate>
      <asp:LinkButton runat="server" Text="Select" CommandName="Select" CausesValidation="False" id="Button1"></asp:LinkButton>
 </ItemTemplate>
</asp:TemplateField>    

I have a button outside of the grid: Button2

Could I add a command to Button1, to simulate to click on Button2 as well? Thank you, regards.

1 Answer 1

1

Did I get you correctly:

void ContactsGridView_RowCommand(Object sender, GridViewCommandEventArgs e)
{

   if(e.CommandName=="Select")
   {
       MyFunction();
   }
}

void Button2_Click(Object sender, EventArgs e)
{
    MyFunction();
}

void MyFunction(){
   //your code
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.