title: ASP.NET C# How to hide/show text when you click a button
body: <p>Id like to show label(make visible a hidden) and change the text of a Button when clicked, and be able to click the button again to show its original text and hide the label .`</p>
  
  <pre><code>    public partial class TestClick : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          if (!Page.IsPostBack) 
          {
  
              btnShowButtonText.Text = "Button";
              lblShowText.Visible = false;
  
          }
      }
      protected void btnShowButtonText_Click(object sender, EventArgs e)
      {
          if (!Session.IsNewSession)
          {
              btnShowButtonText.Text = "Hide gift voucher details";
              lblShowText.Visible = true;
          }
      }      
  </code></pre>