JQuery不会在IE中进行回发

时间:2012-09-13 11:04:28

标签: jquery asp.net postback

我正在使用以下JQuery函数进行回发:

$("#btnSubmit").click();

btnSubmit是一个ASP.NET服务器端按钮,它定义了一个点击功能,在Firefox和chrome中执行了回发,我的服务器端代码被执行,但IE中什么都没发生,出了什么问题?

<script src="jquery-1.4.min.js" type="text/javascript"></script>

   <script type="text/javascript" >

       function uploadTimer() {
           var t = setTimeout("uploadTimer()", 100);
           var value = $("#FileUpload1").val();
           if (value != '') {
               $("#btnSubmit").click();
           }
       }

...

    <script language="javascript" type="text/javascript">
    function OpenFileUpload() {
        $("#FileUpload1").click();
        uploadTimer();
    }
</script>
<asp:FileUpload ID="FileUpload1" runat="server" ClientIDMode="Static" style="display:none;" />
<asp:Button ID="btnSubmit" ClientIDMode="Static" runat="server" Text="Submit" OnClick="UploadFileToServer" style="display:none;" />
        <a href="javascript:void(0)" title="upload file" style="color:Black;" onclick="OpenFileUpload()">upload file</a> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" Visible="false"/>

0 个答案:

没有答案