This is the code that is having the problem, not much to go wrong really.
//If response is OK, set the innerhtml of the div.
if(nvc.Get("response") == "OK")
{
setInnerHtml();
}
public void setInnerHtml()
{
session KeyPad = (session)Session["keyPad"];
session SelectedButtons = (session)Session["selecteditems"];
string InnerHtml = "";
string p = "<;div style=\"text-align:center; width: 15px; height: 15px; float: left; margin-right: 5px; background-color: [Color];\">;</div>";
string s=p;
for(int i=0; i < SelectedButtons.selecteditems.Count; ++)
{
s = p;
for(int j = 0; j< KeyPad.keypad.ColorCollection.Count; j++)
{
if(KeyPad.keypad.ColorCollection[j].selected == SelectedButtons.selecteditems[i].selected)
s = s.Replace("[Color]", KeyPad.keypad.ColorCollection[j].selected.ToKnownColor().ToString());
}
InnerHtml += s;
}
selColors.InnerHtml = InnerHtml;
}
And yes it is a PITA...
regards