• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 294
  • Last Modified:

asp.net vb.net keep a label in a masterpage ever

I need keep a message label in a master page ever. But when pass to a new page the masterpage lose  the label content. How can keep the message label on every pages and only change when i modify.
  • 2
1 Solution
Where do  you set the label text from? If you are setting the label text from the  codebehind of masterpage you should not loose the label text. Can you provide more details on the issue, because it is kinda strange that you are not seeing the controls residing in the master page.
rflorencioAuthor Commented:
For ex. i am in the default.aspx page and write a message in a label control in masterpage. Then when i move to another page like products.aspx the message i had write in master page disappears.
yep It will disappear because you did it from default.aspx. Master page is just like a user control.
What you can do is use session to store the label text . And then In the page_load event of master page write the text from the session to the label.  You need to save text into the session variable when you write message from the page.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now