0
我有一個模態對話框:OnClick事件不是射擊ModalDialog
function ShowPopup()
{
window.showModalDialog('dialog.aspx', null, 'status:no;dialogWidth:950px;dialogHeight:150 px');
}
那麼它叫後面的代碼
Page.ClientScript.RegisterStartupScript(this.GetType(), "popUpScript", "ShowPopup();", true);
的dialog.aspx有兩個按鈕:
<asp:Button id="btn1" runat="server" Text="Button 1" OnClick="btn1_Click"></asp:Button>
<asp:Button id="btn2" runat="server" Text="Button 2" OnClick="btn2_Click"></asp:Button>
但是,後面的代碼中的Click事件永遠不會被解僱。
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btn1_Click(object sender, System.EventArgs e)
{
Response.Redirect(url)
}
protected void btn2_Click(object sender, System.EventArgs e)
{
Response.Redirect(url);
}
}
沒有運氣。仍然沒有擊中按鈕點擊事件。 – user234702 2010-07-16 17:13:20
它甚至打到page_load?像rick建議的一樣,確保沒有js錯誤。確保頁面元素的aspx具有AutoEventWireup =「true」。同時仔細檢查並確保你沒有dialog.aspx的多個副本,並加載了錯誤的文件 – 2010-07-17 03:09:29
.aspx上的AutoEventWireup設置爲true - 據我所知,沒有js錯誤。我確實快速查看了是否有一箇舊版本的dialog.aspx被加載,但我沒有。 – user234702 2010-07-19 12:32:45