protected void Page_Load(object sender, EventArgs e)
    {
        TextBox1.Text = "a";
    }    protected void Button1_Click1(object sender, EventArgs e)
    {
        Label1.Text = TextBox1.Text.Trim();
    }无论俺在TextBox1中输入什么东东,只要俺一点button,Label1只显示"a"出鬼了,请兄弟们明示

解决方案 »

  1.   

    protected void Page_Load(object sender, EventArgs e)
        {
    if(!this.isposeback)
            TextBox1.Text = "a";
        }
    这个问题吗
      

  2.   

    protected void Page_Load(object sender, EventArgs e)
        {
            TextBox1.Text = "a";
        }
    ----------------------------------------
    问题所在,button的click会刷新叶面
    改为
    protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack){
              TextBox1.Text = "a";
              }
        }
      

  3.   

    没见鬼,是代码不对page_load,每次都执行,并且在button1_click1的前面执行,所以每次都是"a"在page_load里面用isPostBack判断一下
      

  4.   

    protected void Page_Load(object sender, EventArgs e)
        {
    if(!IsPostBack)
    {
            TextBox1.Text = "a";
    }
        }
      

  5.   

    那当然只显示a咯
    你在Page_Load里面写了TextBox1.Text="a"就只能是这个样子了.
    你要在该语句里加个判断就行了:
    if(!this.IsPostBack)
    TextBox1.Text="a";
      

  6.   

    if(!this.IsPostBack)
    TextBox1.Text="a";
    要不然每次加载都使结果为a了