Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何在更新面板中的Gridview中找到按钮id?_Asp.net_Vb.net_Gridview - Fatal编程技术网

Asp.net 如何在更新面板中的Gridview中找到按钮id?

Asp.net 如何在更新面板中的Gridview中找到按钮id?,asp.net,vb.net,gridview,Asp.net,Vb.net,Gridview,我找不到“更新”按钮的id,是否可以 查找gridview中的更新按钮id,该网格为 在更新面板内。 脚本寄存器在页面加载时写入。我写这封信是为了 当前更新按钮在第二次单击时启动 ASPX代码 <asp:UpdatePanel ID="UpdatePanelSubMeter" runat="server"> <ContentTemplate> <EditItemTemplate> <asp:Button ID="btn_Upd

我找不到“更新”按钮的id,是否可以 查找gridview中的更新按钮id,该网格为 在更新面板内。 脚本寄存器在页面加载时写入。我写这封信是为了 当前更新按钮在第二次单击时启动

ASPX代码

 <asp:UpdatePanel ID="UpdatePanelSubMeter" runat="server">
     <ContentTemplate>
    <EditItemTemplate>
    <asp:Button ID="btn_Update" Style="background-color: #B2DE94; width: 40px" CausesValidation="false" runat="server" OnClientClick="return fnCheck(this);" Text="Update" CommandName="Update" />
    </EditItemTemplate>
      </asp:UpdatePanel>
尝试删除

For Each gvr As GridViewRow In GridSubMeter.Rows
            If gvr.RowType = DataControlRowType.DataRow Then
            Dim button As Button = CType(gvr.FindControl("btn_Update"), Button)
            If Not (button Is Nothing) Then
                                  ScriptManager.GetCurrent(Me).RegisterPostBackControl(button)
从页面加载并将其粘贴到末尾的
BindGridSubMeter

试试这个

For Each gr As GridViewRow In Grid_Records.Rows
Dim bt As Button = DirectCast(gr.Cells(0).FindControl("btn_Update"), Button)
Dim here As bt.properties

下一步

有错误吗??????以及您试图对ScriptManager执行的操作。GetCurrent(Me)。RegisterPostBackControl(按钮)更新按钮在单击调用代码的事件时第二次启动?按钮在pageload@Imad上不显示任何内容
For Each gr As GridViewRow In Grid_Records.Rows
Dim bt As Button = DirectCast(gr.Cells(0).FindControl("btn_Update"), Button)
Dim here As bt.properties