title: -C# Label & Literal not displaying value
body: <p>I have a profile that allows users to display, edit, save. </p>
  
  <p>The save and edit works ok.</p>
  
  <p>However, the display is not working properly. </p>
  
  <p>I tried changing labels to literals but they don't either.</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              this.BindGenderDropDownList();
              //this.BindTimeZonesDropDownList();
              //this.BindCulturesDropDownList();
  
              if (!string.IsNullOrEmpty(Membership.GetUser().UserName))
              {
                  Profile = MyProfile.GetProfile(Membership.GetUser().UserName);
                  this.DisplayProfile();
              }
          }
  
  
      }
  
      protected void btnGo_Click(object sender, EventArgs e)
      {
          this.DisplayProfile();
      }
  
      protected void btnEdit_Click(object sender, EventArgs e)
      {
          this.EditProfile();
      }
  
      protected void btnCancelDisplay_Click(object sender, EventArgs e)
      {
          this.ResetElements();
      }
  
      protected void btnSave_Click(object sender, EventArgs e)
      {
          this.SaveProfile();
      }
  
      protected void btnCancelEdit_Click(object sender, EventArgs e)
      {
          this.ResetElements();
      }
  
      private void DisplayProfile()
      {
  
  
  
  
              this.SetElementsForDisplaying();
              litfullname.Text = this.Profile.ProfileDetail.FullName;
  
  
      }
  
      private void EditProfile()
      {
          this.SetElementsForEditing();
  
  
  
          if (Profile.ProfileDetail == null)
          {
              txtfname.Text = this.Profile.ProfileDetail.FullName;
              txtcardno.Text = this.Profile.ProfileDetail.IdentityCardNo;
              ddlcardcolor.SelectedValue = this.Profile.ProfileDetail.IdentityCardColour;
              txtcardexp.Text = this.Profile.ProfileDetail.IdentityCardExpiryDate.ToString("dd MMMM yyyy");
              ddlrace.Text = this.Profile.ProfileDetail.Race;
              ddlreligion.SelectedValue = this.Profile.ProfileDetail.Religion;
              txtaddress1.Text = this.Profile.ProfileDetail.ContactInformation.Address1;
              txtaddress2.Text = this.Profile.ProfileDetail.ContactInformation.Address2;
              txtaddress3.Text = this.Profile.ProfileDetail.ContactInformation.Address3;
              txtpostcode.Text = this.Profile.ProfileDetail.ContactInformation.Postcode;
              ddldistrict.SelectedValue = this.Profile.ProfileDetail.ContactInformation.District;
              txtphoneoffice.Text = this.Profile.ProfileDetail.ContactInformation.OfficePhone;
              txtphonehome.Text = this.Profile.ProfileDetail.ContactInformation.HomePhone;
              txtphonecell.Text = this.Profile.ProfileDetail.ContactInformation.MobilePhone;
              txtemail.Text = this.Profile.ProfileDetail.ContactInformation.Email;
          }
  
  
  
      }
  </code></pre>
  
  <p>Save profile. This is working properly.</p>
  
  <pre><code>    private void SaveProfile()
      {
  
          if (Profile.ProfileDetail == null)
          {
  
              this.Profile.ProfileDetail.FullName = txtfname.Text;
              this.Profile.ProfileDetail.IdentityCardNo = txtcardno.Text;
              this.Profile.ProfileDetail.IdentityCardColour = ddlcardcolor.SelectedValue;
              this.Profile.ProfileDetail.IdentityCardExpiryDate = DateTime.ParseExact(txtcardexp.Text, "dd MMMM yyyy", null);
              this.Profile.ProfileDetail.Race = ddlrace.SelectedValue;
              this.Profile.ProfileDetail.Religion = ddlreligion.SelectedValue;
              this.Profile.ProfileDetail.ContactInformation.Address1 = txtaddress1.Text;
              this.Profile.ProfileDetail.ContactInformation.Address2 = txtaddress2.Text;
              this.Profile.ProfileDetail.ContactInformation.Address3 = txtaddress3.Text;
              this.Profile.ProfileDetail.ContactInformation.Postcode = txtpostcode.Text;
              this.Profile.ProfileDetail.ContactInformation.District = ddldistrict.SelectedValue;
              this.Profile.ProfileDetail.ContactInformation.OfficePhone = txtphoneoffice.Text;
              this.Profile.ProfileDetail.ContactInformation.HomePhone = txtphonehome.Text;
              this.Profile.ProfileDetail.ContactInformation.MobilePhone = txtphonecell.Text;
              this.Profile.ProfileDetail.ContactInformation.Email = txtemail.Text;
  
          }
  
  
  
          this.Profile.Save();
  
         this.ResetElements();
  
      }
  </code></pre>
  
  <p>To display, which doesn't work properly </p>
  
  <pre><code>    private void SetElementsForDisplaying()
      {
  
  
          pnlDisplayValues.Visible = true;
          pnlSetValues.Visible = false; 
          litUserTitle.Visible = false;
          litUserTitle.Text = string.Format("Display profile for {0}", this.Profile.UserName);
  
      }
  </code></pre>
  
  <p>Edit profile. Working properly
          private void SetElementsForEditing()
          {</p>
  
  <pre><code>        pnlDisplayValues.Visible = false;
          pnlSetValues.Visible = true;
          litUserTitle.Visible = true;
          litUserTitle.Text = string.Format("Edit profile for {0}", this.Profile.UserName);
      }
  
      private void ResetElements()
      {
  
          pnlSetValues.Visible = false;
          pnlDisplayValues.Visible = true;
          litUserTitle.Visible = true;
  
      }
  </code></pre>