<asp:LinkButton ID="payStateLinkButton" runat="server" onclick="payStateLinkButton_Click" Text="已付款"></asp:LinkButton>
如果想在后台
protected void payStateLinkButton_Click(object sender, EventArgs e)
{ }
中获取LinkButton的Text的值,怎样获取啊啊啊??

解决方案 »

  1.   

      string value= this.payStateLinkButton.Text;
      

  2.   


     protected void payStateLinkButton_Click(object sender, EventArgs e)
            {
               string text =  payStateLinkButton.Text;
              
            }
      

  3.   


    如果想在后台
    protected void payStateLinkButton_Click(object sender, EventArgs e)
    {  
      string text = payStateLinkButton.Text.Trim();
    }
      

  4.   


     //不想通过ID得用这个也可以
     protected void payStateLinkButton_Click(object sender, EventArgs e)
            {
                LinkButton btn = sender as LinkButton;
                string text = btn.Text;
               
               
            }
      

  5.   

    protected void payStateLinkButton_Click(object sender, EventArgs e)
    {  
      string text = payStateLinkButton.Text.Trim();
    }通过ID就取了
      

  6.   

    如果按较常规的设计,应该不是去取这个LinkButton的Text值。
    在你的数据库中,存存这个字段[Payment]应该是一个BIT数据类别。
    应该传值给它为1或0。