1. 如何用javascript实现以下功能,点击按钮(最好是服务器的Button)后出现"5秒后跳转至首页",其中5这个数字是逐渐变化的,到0秒自动跳转。
请不要仅仅说setTimeout,不要AJAX的实现,谢谢2. Wizard控件左边的SideBar里的链接我不想让用户点击,我只想让用户点击右边的下一步,
我现在已经将其转换为SideBarTemplate
            <SideBarTemplate>
                <asp:DataList ID="SideBarList" runat="server">
                    <SelectedItemStyle Font-Bold="True" />
                    <ItemTemplate>
                        <asp:LinkButton ID="SideBarButton" runat="server" CausesValidation="False"></asp:LinkButton>
                    </ItemTemplate>
                </asp:DataList>
            </SideBarTemplate>在后台我也写了
        protected void WizardAccount_SideBarButtonClick(object sender, WizardNavigationEventArgs e)
        {      
            e.Cancel = true;
        }
可以让用户只能按照我的步骤来选择但我现在希望的是
1. 能否找到这个LinkButton,用户点击了以后不要用服务器端的WizardAccount_SideBarButtonClick来处理其事件,直接在javascript里就return false了。
2. 或者能否就不显示连接按钮,只是显示普通的文字,用户就不会去点击,可以用Enable = false 但太难看了如有其他方案能满足条件者也请赐教

解决方案 »

  1.   

    1.  把Button的ClientID取出来给JS,然后再用setTimeout改变Button的Value值,试试看
      

  2.   

    1.先弄一个div 用于写字 id='x'
    function click_button(){
       var t=5;
       var tim= setInterval(funtion(){
        document.getElementById('x').innerHTML='还有'+(t--)+'秒跳转到xx';
        if(t<1) {clearInterval(tim);top.location.href='xxx';}
       },1000);
    }
      

  3.   

    2 你试试
    asp中添加
    AddAttribute('onclick','return false')
      

  4.   

    You have finished the registration, The screen will jump to homepage automatically after&nbsp;<b><span id="spnsec"></span></b>&nbsp;seconds.<br /><br />
    <a href="../default.aspx" >OR you can click here to homepage.</a><script language="javascript" type="text/javascript">
    var iSecond = 5;
    document.getElementById("spnsec").innerHTML = iSecond;
        
    function changeSecond()
    {
    if (iSecond == 0)   //  跳转页面
    {
     window.location.href ="../Default.aspx"; 
    }
    else
    {
    iSecond = iSecond -1;
    document.getElementById("spnsec").innerHTML = iSecond;
     window.setTimeout(changeSecond,1000);

     }

    </script>服务器端代码:protected void Button1_Click(object sender, EventArgs e)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "key", "<script>Page.window.setTimeout(changeSecond,1000);</script>");
            }
      

  5.   

    var tim= setInterval(funtion(){
    ====================================
     var tim= setInterval(function(){
      

  6.   

    楼主貌似在做注册,这个东东用Wizard控件未必很好,因为每一个下一步都要和服务器交互,而事实上用几个隐藏的display="none"的div就可以解决