Access global page variable in helper

后端 未结 3 1873
执念已碎
执念已碎 2021-02-06 20:47
@{
    int i = 0;
}

@helper Text() {
    
}

i is not accessible in helper. How to acce

3条回答
  •  梦如初夏
    2021-02-06 21:30

    You can simply add it as member to you page by using @functions declaration:

    @functions
    {
        private int i;
    }
    

提交回复
热议问题