Modify Javascript with C#

Modify Javascript with C#

本文关键字:with Javascript Modify      更新时间:2023-09-26

我有一个带有javascript的网页,上面有一个计时器。

<script type="text/javascript">
            (function($){
                var count = 10;
                countdown = setInterval(function () {
                    if (count == 0) {
                        $("#countdown").remove();
                    }
                    count--
                }, 1000);
                $(document).on('submit', 'form.proform', function() {
                    if(count > 0)
                        return false;
                });
            })(jQuery);
            </script>

现在我想创建一个C#应用程序来拥有一个客户端。但我不想等到计时器,直到我能看到洞的位置。有没有办法修改C#中的var count以跳过计时器?感谢您的帮助!

试试这个。

Js:

var count = <%=CountValue%>;

在C#中:

public int CountValue{ get { return this._countValue; } set { _countValue = value; } } 

设置页面加载中的计数值,如

this._countValue=0;