Can we access div tags of user control in Master page? I am trying to change the background color for each one of the div tags on some event.
A:
The best way is to make a public property in the user control that you can then set directly from the masterpage.
Mitchel Sellers
2008-12-05 20:20:38
I am trying to set the property from master page but nothing is happening to back ground color of div tag
alice7
2008-12-05 20:48:12
A:
Something like this should work (in C#):
Control myControl = this.Page.Master.FindControl("[Your name here]");
then you can do whatever you would like to the control. If it's a Panel control (for the div) you can cast it that way, or if you are using an HTML server side control, you can cast it that way.
Jared
2008-12-05 21:23:58