<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button id="btnCheck" runat="server" Text="按我" OnClientClick="OneCheck(); return false;"></asp:Button>
        <asp:Label ID="lblMessage" runat="server" ForeColor="Blue"></asp:Label>
    </div>
    </form>
    
    <script type="text/javascript">
    var flag = true;
    function OneCheck()
     {
        if(flag)
        {
            flag = false;
            document.getElementById('<%=lblMessage.ClientID %>').innerHTML = "執行第一次,請耐心等候動作完成...";
            return true;
        }
        else
        {
            document.getElementById('<%=lblMessage.ClientID %>').innerHTML = "執行第二次,請勿執行相同動作。";
            document.getElementById('<%=btnCheck.ClientID %>').disabled = true;
        }
     }
</script>
</body>

goodlucky 發表在 痞客邦 PIXNET 留言(0) 人氣()