How to access Master Page Controls in Content Page?

Add Page Detective

<%@ MasterType VirtualPath="~/MasterPage.master" %>

now content page has reference of the Master Page as Properties.
If one lable in the Master Page with id lblLoginStatus

This can be find like this way

Label lbl= this.Master.FindControl("lblLoginStatus");
if(lbl!=null)
 lbl.Text="Success";

More Details : http://msdn.microsoft.com/en-us/library/xxwa0ff0(VS.80).aspx

0 comments:

Post a Comment