链接按钮在第一次单击时不起作用

时间:2015-12-28 09:31:17

标签: asp.net vb.net

我有这个链接按钮:

<asp:ButtonColumn Text="Return to Clinic" ItemStyle-CssClass="btnLinkBtn" ButtonType="LinkButton" CommandName="Return" HeaderText="Action">
      <ItemStyle HorizontalAlign="Center" Width="30px"/>
      <HeaderStyle HorizontalAlign="Center" Width="30px"/>
</asp:ButtonColumn>

背后的代码是:

Protected Sub dgRequests_ItemCommand(source As Object, e As DataGridCommandEventArgs) Handles dgRequests.ItemCommand
    Try
        If e.CommandName = "Return" Then

            divReturnToClinicPanel.Visible = True
            divContent.Visible = False

            ' More code here

        End If
    Catch ex As Exception
        ' ... 
    Finally
        ' ... 
End Sub

问题是第一次点击不会触发任何内容,只会触发第二次点击。可能是什么问题?

0 个答案:

没有答案