我有一個簡單的ASP.NET按鈕,裏面的iFrame,奇怪的原因,我必須點擊它兩次才能觸發一個事件。按鈕需要點擊兩次以觸發事件
<asp:Button ID="btnSaveComment" runat="server" Text="Add Comment"
CssClass="button"
OnClick="btnSaveComment_Click"
ValidationGroup="add" />
protected void btnSaveComment_Click(object sender, EventArgs e)
{
AddComment();
}
是不是因爲您需要在正確的IFrame之前先點擊該按鈕。 – Jethro
用翔實的答案[這裏]類似的問題[1] [1]:http://stackoverflow.com/questions/297217/asp-net-c-need-to-press-a-button-兩次發生的事情 – AndroidHustle
@AndroidHustle:僅供參考:在評論中,您需要使用超鏈接的內聯語法。你的例子的代碼應該是:'[這裏](http://stackoverflow.com/questions/297217/asp-net-c-need-to-press-a-button-twice-to-make-something-happen )',它顯示如下:[這裏](http://stackoverflow.com/questions/297217/asp-net-c-need-to-press-a-button-twice-to-make-something-happen ) – awe