Cyrille Rey

Cyrille Rey

  • NA
  • 25
  • 38.8k

Label not appearing on web page

Jun 20 2012 11:38 AM

Hello,
 
I have a c# form that enables the user to make changes to their details. When the user clicks the save button, a label should appear saying that the details have been saved.
 
Here is the label code from the aspx page:
 
<asp:Label runat="server" id="lblMessage" CssClass="StatusNote" visible="false">
 
When the user clicks the Save Changes button, a function in the code file is called. The function is as follows:
 
protected void btnSaveChanges_Click(object sender, EventArgs e)
 {
         int userId=Convert.ToInt32(CSessionHandler.UserId);
         lblMessage.Visible=true;
         lblMessage.Text="Changes saved";
}
 

The problem is that the label message never appears. Whatever I do, I can never see the text. It is as if the visible attribute is always set to false.
 
Does anyone know what could be causing the problem?
 
Thank you.
 


Answers (2)