Author: igorz
Date: 2007-10-18 05:47:07 -0400 (Thu, 18 Oct 2007)
New Revision: 87741

Modified:
   trunk/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs
Log:
for #TARGET_J2EE
not all servers such portal supports partial rendering 

Modified: trunk/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs
===================================================================
--- trunk/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs        
2007-10-18 09:19:03 UTC (rev 87740)
+++ trunk/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs        
2007-10-18 09:47:07 UTC (rev 87741)
@@ -359,6 +359,10 @@
                                        throw new InvalidOperationException ();
                                if (!EnablePartialRendering && value)
                                        throw new InvalidOperationException 
("The SupportsPartialRendering property cannot be set when 
EnablePartialRendering is false.");
+#if TARGET_J2EE
+                               if (!ServerSoftwareSupportsPartialRendering && 
value)
+                                       throw new InvalidOperationException 
("The server software does not supports partial rendering.");
+#endif
 
                                _supportsPartialRendering = value;
                        }
@@ -367,10 +371,39 @@
                bool CheckSupportsPartialRendering () {
                        if (!EnablePartialRendering)
                                return false;
+#if TARGET_J2EE
+                       if (!ServerSoftwareSupportsPartialRendering)
+                               return false;
+#endif
                        // TODO: consider browser capabilities
                        return true;
                }
 
+#if TARGET_J2EE
+               bool? _serverSoftwareSupportsPartialRendering;
+
+               bool ServerSoftwareSupportsPartialRendering {
+                       get {
+                               if 
(!_serverSoftwareSupportsPartialRendering.HasValue)
+                                       _serverSoftwareSupportsPartialRendering 
= CheckServerSoftwareSupportsPartialRendering ();
+                               return 
_serverSoftwareSupportsPartialRendering.Value;
+                       }
+               }
+
+               bool CheckServerSoftwareSupportsPartialRendering () {
+                       string serverSoftware = Context.Request.ServerVariables 
["SERVER_SOFTWARE"];
+                       if (!String.IsNullOrEmpty (serverSoftware)) {
+
+                               if (serverSoftware.IndexOf ("WebSphere", 
StringComparison.OrdinalIgnoreCase) >= 0)
+                                       return false;
+
+                               if (serverSoftware.IndexOf ("Jetspeed", 
StringComparison.OrdinalIgnoreCase) >= 0)
+                                       return false;
+                       }
+                       return true;
+               }
+#endif
+
                [EditorBrowsable (EditorBrowsableState.Never)]
                [Browsable (false)]
                [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to