- foreach (string key in Keys)
- sb.AppendFormat ("{0}: {1};", key, style [key]);
+ foreach (string key in style.Keys) {
+ if (key == "background-image" && 0 != String.Compare ("url", ((string) style [key]).Substring (0, 3), true, CultureInfo.InvariantCulture))
+ sb.AppendFormat ("{0}:url({1});", key, HttpUtility.UrlPathEncode ((string) style [key]));
+ else
+ sb.AppendFormat ("{0}:{1};", key, style [key]);
+ }