我有一个简单的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