tags:

views:

735

answers:

3

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
I am trying to set the property from master page but nothing is happening to back ground color of div tag
alice7
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
A: 

this totally looks like yet another job for jQuery

Scott Evernden