title: C# get background color of element from code behind that is changed using jQuery on runtime
body: <p>I am using a infragistics component called webdatagrid, inside which row I have got a user control with 48 divs inside, I am making a day scheduler for a company, now after I find the component, I want to check the background color of which of the 48 divs...if white its normal, if gray it means that person is working.
  so the user control called segments I have this code:</p>
  <pre><code>&lt;style type=&quot;text/css&quot;&gt;
  .divttt
  {
  background-color:#fff;
  width:30px;height:32px;
  float:left;
  border-bottom:solid 1px #C0C0C0 ;
  border-top:solid 1px #C0C0C0 ;
  border-left:solid 1px #C0C0C0
  -moz-border-radius: 5px; /* Firefox */
  -webkit-border-radius: 5px; /* Safari, Chrome */
   border-radius: 5px; /* universal */
   }
  .divtoleft
  {
   
  width:30px;
  height:32px;
  float:left;
  }
  &lt;/style&gt;
   &lt;div runat=&quot;server&quot; class=&quot;divtoleft&quot;&gt; &lt;/div&gt;
   &lt;div  id=&quot;div1&quot; runat=&quot;server&quot; class=&quot;divttt&quot;&gt;
   &lt;/div&gt;
   &lt;div  id=&quot;div2&quot; runat=&quot;server&quot; class=&quot;divttt&quot;&gt;
   &lt;/div&gt;
   &lt;div  id=&quot;div3&quot; runat=&quot;server&quot; class=&quot;divttt&quot;&gt;
   &lt;/div&gt;
   &lt;div  id=&quot;div4&quot; runat=&quot;server&quot; class=&quot;divttt&quot;&gt;
   &lt;/div&gt;
   &lt;div  id=&quot;div5&quot; runat=&quot;server&quot; class=&quot;divttt&quot;&gt;
  </code></pre>
  <p>...and continues up to the div48...
  when the page load all divs are white, then user select which person is working and how many hours, by changing the color to gray.
  when the user press save I want to see what is the color of the div...</p>
  <pre><code>String[] _arrHoras = new String[] { &quot;00:00&quot;, &quot;00:30&quot;, &quot;01:00&quot;, &quot;01:30&quot;, &quot;02:00&quot;, 
                                      &quot;02:30&quot;, &quot;03:00&quot;, &quot;03:30&quot;, &quot;04:00&quot;, &quot;04:30&quot;, 
                                      &quot;05:00&quot;, &quot;05:30&quot;, &quot;06:00&quot;, &quot;06:30&quot;, &quot;07:00&quot;, 
                                      &quot;07:30&quot;, &quot;08:00&quot;, &quot;08:30&quot;, &quot;09:00&quot;, &quot;09:30&quot;, 
                                      &quot;10:00&quot;, &quot;10:30&quot;, &quot;11:00&quot;, &quot;11:30&quot;, &quot;12:00&quot;, 
                                      &quot;12:30&quot;, &quot;13:00&quot;, &quot;13:30&quot;, &quot;14:00&quot;, &quot;14:30&quot;, 
                                      &quot;15:00&quot;, &quot;15:30&quot;, &quot;16:00&quot;, &quot;16:30&quot;, &quot;17:00&quot;, 
                                      &quot;17:30&quot;, &quot;18:00&quot;, &quot;18:30&quot;, &quot;19:00&quot;, &quot;19:30&quot;, 
                                      &quot;20:00&quot;, &quot;20:30&quot;, &quot;21:00&quot;, &quot;21:30&quot;, &quot;22:00&quot;, 
                                      &quot;22:30&quot;, &quot;23:00&quot;, &quot;23:30&quot;, &quot;24:00&quot; };
      
  public string[] getHorasIniciais()
  {
      int branco = 0;
      int preto = 0;
      int posarr = 0;
      string[] arrHi= new string[] {&quot;&quot;};
      for (int pos = 0; pos &lt; 48; pos++)
      {
  
          string sControlId = &quot;div&quot; + (pos + 1);
          Control cControlDiv = FindControl(sControlId);
          HtmlGenericControl dDiv = (HtmlGenericControl)cControlDiv;
          string t=&quot;&quot;;
          div1.Attributes[&quot;background-color&quot;] = t;&lt;--the problem is here...
          //if (color.Equals(&quot;#909090&quot;) == true || color.Equals(&quot;rgb(144, 144, 144)&quot;) == true)
          //{
          //    if (preto == 0)
          //    {
          //        arrHi.SetValue(_arrHoras[pos], posarr);
          //        posarr++;
          //        preto = 1;
          //    }
          //    if (pos &gt; 47)
          //    {
          //        preto = 0;
          //        arrHi.SetValue(_arrHoras[pos], posarr);
          //    }
          //}
          //else {
          //    if (preto == 1)
          //    {
          //        preto = 0;
          //    }
          //}
  
      }
  
      return arrHi;
  }
  </code></pre>
  <p>what this code does is to check all of the 48 divs and check the background color, if is white do nothing if is grey, it puts the correspondent time of that block on the array arrHi.
  The problem is that I can't get the value of background color and compare it...</p>