Click here to Skip to main content
15,915,094 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have tried different codes but they haven't work please suggest me how can i do it using c#
Posted

for example i have TextBox in master form which id is am1 and i want to disabled it so write code in your cs page as bwelow in content form.

C#
TextBox txt = (TextBox)Master.FindControl("am1");
                txt.Enabled = false;
 
Share this answer
 
v2
C#
// Gets a reference to a Label control that not in a ContentPlaceHolder
    Label mpLabel = (Label) Master.FindControl("masterPageLabel");
    if(mpLabel != null)
    {
        Label1.Text = "Master page label = " + mpLabel.Text;
      Label1.Enable=false
    }
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900