How to access a control in the masterpage ?

Suppose you have a label control name lblMessage in your masterpage and you want to access the label control from one of your pages, you can do so using the following code


Ctype( Page.Master.FindControl("lblMessage"),Label).Text = "Hello"

Related posts:

  1. Enable or disable the delete link in the GridView according to the role of the logged in user In some scenarios you may only want users of a...

Related posts brought to you by Yet Another Related Posts Plugin.

One Response to “How to access a control in the masterpage ?”

  1. hey thanks for the brilliant post! The resource will hlp me that for sure. Will there be any update on this post BTW? I have added you and have subscribed.

Leave a Reply