0

我的页面上有这个

<asp:TextBox Text="" ID="txtEmailOApodo" MaxLength="70" runat="server" Width="250px"
            Style="height: 25px"></asp:TextBox>
<asp:TextBox Text="" ID="txtContrasena" MaxLength="50" TextMode="Password" runat="server"
            CssClass="textoLightbox"></asp:TextBox>

 <div style="margin-top: 20px">
    <asp:UpdatePanel runat="server" ID="updPanelLoginIncorrecto">
        <ContentTemplate>
            <asp:CustomValidator ForeColor="Red" OnServerValidate="usuarioExistente_Validation"
                Display="Static" Font-Size="Small" runat="server" ID="vldLogin" Text="<%$ Resources:LocalizedText, MsjError_LoginIncorrecto%>">
            </asp:CustomValidator>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnLoginLightbox" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</div>
<div class="tableContent" style="float: right;">
    <asp:Button CssClass="button" ID="btnLoginLightbox" Text="Login" runat="server" OnClick="btnLoginUserControl_Click" />
</div>

<script type="text/javascript" language="javascript">
$(document).ready(function () {
    $("#<%=txtContrasena.ClientID%>").keyup(function (event) {
        if (event.keyCode == 13) {               
            $("#<%=btnLoginLightbox.ClientID%>").click();
        }
    });

    $("#<%=txtEmailOApodo.ClientID%>").keyup(function (event) {
        if (event.keyCode == 13) {
            $("#<%=btnLoginLightbox.ClientID%>").click();
        }
    });
});
</script>

在我后面的代码中

 protected void btnLoginUserControl_Click(object sender, EventArgs e)
 {
     //Some code....      
 }

我不知道为什么当我专注于 txtContrasena 或 txtEmailOApodo 并按回车键时 btnLoginUserControl_Click 会执行两次。

4

1 回答 1

0

src当您在页面上有一个带有空白属性的图像时,我已经看到了类似于您所描述的双重发布行为。例如:<img src="" />

于 2012-10-17T14:50:58.827 回答