2006-09-17 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mcs / class / System.Web / System.Web.UI / CssStyleCollection.cs
index bf0084e561c89e7815dcffda218529ad1e40ec85..5ed434ec6ef8445ceba84bcb4473fe5007e2f4cf 100644 (file)
@@ -86,8 +86,12 @@ namespace System.Web.UI {
                                return last_string;
 
                        StringBuilder sb = new StringBuilder ();
-                       foreach (string key in Keys)
-                               sb.AppendFormat ("{0}: {1};", key, style [key]);
+                       foreach (string key in Keys) {
+                               if (key == "background-image")
+                                       sb.AppendFormat ("{0}:url({1});", key, HttpUtility.UrlPathEncode ((string) style [key]));
+                               else
+                                       sb.AppendFormat ("{0}:{1};", key, style [key]);
+                       }
 
                        last_string = sb.ToString ();
                        return last_string;