How to access a JavaScript variable from code behind in asp.net

前端 未结 4 1599

i am using a JavaScript and it have the below code:



        
4条回答
  •  被撕碎了的回忆
    2020-12-01 23:24

    You will need to store the count variable on a server-side control in order to do this.

    Example:

    
    
    
    

    Then, in your code-behind simply use:

    int value;
    if (Int32.TryParse(example.Value, out value))
    {
         // Do something with your value here
    }
    

提交回复
热议问题