private void SetStyle(JbstContainerControl target, string name, string value)
{
if (String.IsNullOrEmpty(name) && String.IsNullOrEmpty(value))
{
return;
}
if (target == null)
{
throw new NullReferenceException("target is null");
}
string style =
target.Attributes.ContainsKey("style") ?
target.Attributes["style"] as String :
null;
if (style != null && !style.EndsWith(";"))
{
style += ";";
}
if (String.IsNullOrEmpty(name))
{
style += value;
}
else
{
style += name+':'+value;
}
target.Attributes["style"] = style;
}