首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

Page_Load里为什么无法更改label.text的值?解决办法

2012-01-08 
Page_Load里为什么无法更改label.text的值????protectedvoidPage_Load(objectsender,EventArgse){if(!this

Page_Load里为什么无法更改label.text的值????
     
        protected   void   Page_Load(object   sender,   EventArgs   e)
        {
       
                if   (!this.Page.IsPostBack)
                {
                        this.lblCurrent.Text= "1 ";
             
                        this.contentlist();  
                }

        }
lblcurrent的text值无法更改,不知是为什么,无论把this.lblCurrent.Text= "1 ";
放在Page_Load的什么地方都不能改变TEXT的值。请高手帮忙!

[解决办法]
先把 this.contentlist(); 这句注释看看
[解决办法]
把this.lblCurrent.Text= "1 ";放在if (!this.Page.IsPostBack)外也不行?
把它跟this.contentlist(); 换个位置呢?

放在Page_Load的什么地方都不能改变TEXT的值?那就放外面,想改变的时候再调用

[解决办法]
!this.Page.IsPostBack
应该是!this.IsPostBack吧

热点排行