button1.attributes.add("onclick","alert('xxxx');")

解决方案 »

  1.   

    sub btn_click() handle....
        '执行一些操作
        btn.enable=false
    end sub
      

  2.   

    处理完后执行重定向
    Response.redirect("本页.aspx")
      

  3.   

    OR 
       Button1.Attributes.Add("onclick", "alert('xxx');return false;")
      

  4.   

    提交处理完代码时,把:
    btn.enable=false
      

  5.   

    button1.attributes.add("onclick","alert('xxxx');")能不能说清楚一点
    ++++++++++++++++++++++++++++
    sub btn_click() handle....
        '执行一些操作
        btn.enable=false
    end sub
    +++++++++++++++++++++++++数据传送也是写在sub onclick事件啊
     Button1.Attributes.Add("onclick", "alert('xxx');return false;")我看不懂,
    能不能帮我做个例子或详细说明一下,,谢谢各位的帮助++++++++++++++++++++++++++++++++++++
    提交处理完代码时,把:
    btn.enable=false
    ++++++++++++++++++++++我是想设置用户在提交数据的时候重复提交,
    这个论坛就是这样呀,按下“发出回复”之后,按钮再变灰,再执行数据传送。。
      

  6.   

    Sub UploadFile(sender As Object, e As EventArgs)
    ID.enabled=false 
    程序
    END.SUB
    因为这样要执行完END.SUB后,刷新网页才能显示里同的效果。
    没有没点下 UploadFile 按钮后,在网页没刷新的情况下让按钮变灰,就像这个论坛的按钮一样。
      

  7.   

    我使用ID.enabled=false 和Response.redirect("本页.aspx")都不行,如果连续点击按钮几次,还是会插入两条记录的
      

  8.   

    <input type="button" value="abc" onclick="this.disabled=true">
      

  9.   

    <asp:button id="btnOK" Runat="server" Width="60px" CssClass="button" Text="写   完" OnClick =" this.disabled=true "></asp:button>这样也不可以
    编译器错误信息: CS1041: 应输入标识符,“this”是关键字<asp:button id="btnOK" Runat="server" Width="60px" CssClass="button" Text="写   完" OnClick =" this.disabled=true "></asp:button>这样依然不可以
    编译器错误信息: CS0122: 不可访问“System.Web.UI.WebControls.WebControl.disabled”,因为它受保护级别限制