在asp.net中,按钮应每5秒钟自动单击一次 [英] Button should automatically clicked for every 5 seconds in asp.net

查看:52
本文介绍了在asp.net中,按钮应每5秒钟自动单击一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是asp.net的初学者.谁能给我确切的自动按钮单击代码,并告诉我我应该如何执行它.谢谢!

Hi i am beginner in asp.net. Can any one give me the exact code for automatic button click and say me how i shoud execute it.Thanks!

推荐答案



可以执行您想要的操作后检查此

Hi ,

check this once it can do what you want

    <script language ="javascript" >
        var tmp;
        function f1() {
            tmp = setTimeout("callitrept()", 2000);
        }
        function callitrept() {
            document.getElementById("Button1").click();
        }
    </script>
</head>
<body onload="f1()">



在上面的代码中,Button1是您要执行点击操作的按钮的ID

最好的



In the above code Button1 is id of button which you want to perform click operation

All the Best


setInterval(click, 5000);

function click()
{


("#button id").click(); }
("#button id").click(); }



http://www.w3schools.com/jsref/met_win_setinterval.asp [ http://api.jquery.com/click/ [



http://www.w3schools.com/jsref/met_win_setinterval.asp[^]

http://api.jquery.com/click/[^]


这篇关于在asp.net中,按钮应每5秒钟自动单击一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆