I have got a gridview. Each row has a Alternate Names (TextBox) and a hidden button, this button has to get clicked by JQuery on the textbox "onblur" automatically. 

[![enter image description here](https://i.stack.imgur.com/jI8GD.png)](https://i.stack.imgur.com/jI8GD.png)

```
 <asp:GridView ID="GridView1" CssClass="GridView1" runat="server" AutoGenerateColumns="False" EnableViewState="True">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="checkbox1" runat="server" OnClick="checkboxing(this)" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="City Name Id">
                <ItemTemplate>
                    <asp:Label ID="NameId" runat="server" Text='<%# Eval("Name_Id") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Alternate Names">
                <ItemTemplate>

                    <asp:TextBox runat="server" ClientIDMode="Static" ID="altTxtNames" Style="display: none" onblur="buttonupdate(this)"></asp:TextBox>
                    <asp:Button runat="server" ID="TxtButton" ClientIDMode="Static"  Style="visibility: hidden; display: none" OnClick="TxtButton_Click" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

```

Whenever "onblur" event occurs in the Alternate Names (textbox) 

```
 onblur="buttonupdate(this)"

```

the following JQuery is executed:

```
 function buttonupdate(alternateTxtNames) {
            $('#TxtButton').click();
        }

```

This buttonclick prompts execution of aspx.cs method where the values of edited "Alternate Names" and "City Name Id" from the clicked button grid view row are selected using following code:

```
 protected void TxtButton_Click(object sender, EventArgs e)
            {
                Button btn = (Button)sender;
                GridViewRow gvr = (GridViewRow)btn.NamingContainer;
                string updatedSNo = (gvr.FindControl("NameId") as Label).Text;
                int SNo = Convert.ToInt32(updatedSNo);
                string updatedText = (gvr.FindControl("altTxtNames") as TextBox).Text;
           }

```

But everytime the click comes from another row only the *first gridview row values* are selected which I think is the causality of using **ClientIDMode** because of which it is not able to distinguish the button click from other rows.

How should I overcome this issue. Can someone kindly guide.