<P>在博客园搜索了。很多园友都是把按钮设置为不可用的状态。如何实现?特别是刚编译过后以后的程序运行起来比较慢。测试的时候如果多点几次就往数据库多写登陆日志。 像下面的表单如何防止用户多次提交。</P>
<P> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"><BR> <ContentTemplate><BR> <asp:TextBox ID="UserName" runat="server" CssClass="input"></asp:TextBox><BR> <asp:TextBox ID="Password" runat="server" TextMode="Password" CssClass="input"></asp:TextBox><BR> <asp:ImageButton ID="ibtnSave" runat="server" ImageUrl="~/Html/Images/btnlogon_new.gif" OnClick="ibtnSave_Click" /><BR> </ContentTemplate><BR> </asp:UpdatePanel></P>
问题补充:
我写的这个好像不能实现:
StringBuilder sb = new StringBuilder();
sb.Append(@"Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest); ");
sb.Append(@" function beginRequest(sender, args) ");
sb.Append(" { ");
if (this.ibtnEdit.Visible)
{
sb.AppendFormat(@"document.getElementById('{0}').style.disabled = true;", this.ibtnEdit.ClientID);
}
if (this.ibtnSubmit.Visible)
{
sb.AppendFormat(@"document.getElementById('{0}').style.disabled = true;", this.ibtnSubmit.ClientID);
}
if (this.ibtnReturn.Visible)
{
sb.AppendFormat(@"document.getElementById('{0}').style.disabled = true;", this.ibtnReturn.ClientID);
}
if (this.ibtnSubmitCheck.Visible)
{
sb.AppendFormat(@"document.getElementById('{0}').style.disabled = true;", this.ibtnSubmitCheck.ClientID);
}
sb.Append(" }");
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ImageButton", sb.ToString(), true);
迭_戈
|
初学一级
|
园豆:
147
提问于:2008-04-15 14:17