【发布时间】:2011-08-17 09:12:32
【问题描述】:
我在 iFrame 中有一个简单的 ASP.NET 按钮,出于奇怪的原因,我必须单击它两次才能触发事件。
<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 中才能单击该按钮。
-
类似问题,提供信息丰富的答案 [这里][1] [1]:stackoverflow.com/questions/297217/…
-
@AndroidHustle:仅供参考:在 cmets 中,您需要对超链接使用内联语法。您的示例代码应为:
[HERE](http://stackoverflow.com/questions/297217/asp-net-c-need-to-press-a-button-twice-to-make-something-happen),如下所示:HERE -
@awe 啊,太棒了!你的版本让它看起来好多了! =)
-
@AndroidHustle:很高兴为您提供帮助 :-)