2014-09-12 18 views
0

在下面的代碼中我有js中的window.open方法打開一個頁面,並且有另一個click事件。Click事件沒有被解僱。當它是window.showmodal對話框的click事件觸發。我刪除了window.showmodal對話框,因爲chrome不支持它.Pls幫我解決了這個問題。在Asp.net中的ServerClick事件不起作用

ScriptManager.RegisterStartupScript(this, GetType(), "ShowPopUp", "ShowPopUp()", true); 

    function ShowPopUp() { 

      var sFeatures = "dialogHeight: 400px;";   
       var myWindow = window.open("/Transaction/QuoteFromVendor.aspx", "QuoteFromVendor", "width=900,height=200",sFeatures); 

        window.document.getElementById("<%= btnHiddenForUpdate.ClientID%>").click(); 
      } 

<input type="button" id="btnHiddenForUpdate" runat="server" style="display:none" onserverclick="btnHiddenForUpdate_ServerClick" /> 
+0

嘗試火災click事件'.trigger()'函數。例如'$(「<%= btnHiddenForUpdate.ClientID%>」)。trigger(「click」);' – prog1011 2014-09-12 10:49:27

回答

0

您是否確定爲aspx頁面啓用了AutoEventWireup?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind=" " Inherits=" " %> 
+0

是的,它是真的,但它不起作用 – user3930037 2014-09-12 13:02:31

0

變化:

ScriptManager.RegisterStartupScript... 

要:

ClientScript.RegisterStartupScript... 
+0

它是打開彈出窗口,但點擊事件沒有觸發 – user3930037 2014-09-12 13:03:14

相關問題