2016-05-13 68 views
1

我有一個帶有JavaScript的網頁,上面有一個計時器。用C#修改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來跳過定時器? 感謝您的幫助!

回答

0

試試這個。

在JS:

var count = <%=CountValue%>; 

在C#:

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

設置數量的值在頁面加載像這樣

this._countValue=0;