Bladeren bron

2007-04-06 Marek Habersack <[email protected]>

	* ClientScriptManager.cs: render the 'type' attribute in
	WriteScript and do not render the 'language' attribute when in
	NET_2_0+ mode.

2007-04-06  Marek Habersack  <[email protected]>

	* HttpUtility.cs: added a constant that contains the default query
	parameter character.
	ParseQueryString supports queries with both '&' and ';' parameter
	separators.

2007-04-06  Marek Habersack  <[email protected]>

	* HtmlForm.cs: render the 'name' attribute only when in non-xhtml
	compliant mode.

2007-04-06  Marek Habersack  <[email protected]>

	* AssemblyResourceLoader.cs: use the correct query parameter
	separator char for the current platform version. Fixes bug
	#80633.

svn path=/trunk/mcs/; revision=75480
Marek Habersack 19 jaren geleden
bovenliggende
commit
2cdf3d39be

+ 6 - 6
mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs

@@ -38,19 +38,19 @@ namespace System.Web.Handlers {
 	#else
 	internal // since this is in the .config file, we need to support it, since we dont have versoned support.
 	#endif
-		class AssemblyResourceLoader : IHttpHandler {
-		
+	class AssemblyResourceLoader : IHttpHandler {		
 		internal static string GetResourceUrl (Type type, string resourceName)
 		{
 			string aname = type.Assembly == typeof(AssemblyResourceLoader).Assembly ? "s" : HttpUtility.UrlEncode (type.Assembly.GetName ().FullName);
 			string apath = type.Assembly.Location;
 			string atime = String.Empty;
 
-			if (apath != String.Empty) {
-				atime = "&t=" + File.GetLastWriteTimeUtc (apath).Ticks;
-			}
+			if (apath != String.Empty)
+				atime = String.Format ("{0}t={1}", HttpUtility.QueryParamSeparator, File.GetLastWriteTimeUtc (apath).Ticks);
 
-			string href = "WebResource.axd?a=" + aname + "&r=" + HttpUtility.UrlEncode (resourceName) + atime;
+			string href = String.Format ("WebResource.axd?a={1}{0}r={2}{3}",
+						     HttpUtility.QueryParamSeparator, aname,
+						     HttpUtility.UrlEncode (resourceName), atime);
 			
 			if (HttpContext.Current != null && HttpContext.Current.Request != null) {
 				string appPath = HttpContext.Current.Request.ApplicationPath;

+ 6 - 0
mcs/class/System.Web/System.Web.Handlers/ChangeLog

@@ -1,3 +1,9 @@
+2007-04-06  Marek Habersack  <[email protected]>
+
+	* AssemblyResourceLoader.cs: use the correct query parameter
+	separator char for the current platform version. Fixes bug
+	#80633.
+
 2006-01-30 Gonzalo Paniagua Javier <[email protected]>
 
 	* TraceHandler.cs: class status fixes.

+ 5 - 0
mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog

@@ -1,3 +1,8 @@
+2007-04-06  Marek Habersack  <[email protected]>
+
+	* HtmlForm.cs: render the 'name' attribute only when in non-xhtml
+	compliant mode.
+
 2007-02-19  Igor Zelmanovich  <[email protected]>
 
 	* HtmlInputCheckBox.cs:

+ 14 - 4
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs

@@ -31,6 +31,7 @@ using System.Collections.Specialized;
 using System.Security.Permissions;
 using System.Web.Util;
 using System.Web.UI.WebControls;
+using System.Web.Configuration;
 
 namespace System.Web.UI.HtmlControls 
 {
@@ -231,10 +232,13 @@ namespace System.Web.UI.HtmlControls
 
 		protected override void RenderAttributes (HtmlTextWriter w)
 		{
-			/* Need to always render: name, method, action
-			 * and id
+			/* Need to always render: method, action and id
 			 */
-
+			/* The name attribute is rendered _only_ if we're not in
+			   2.0 mode or if the xhtml conformance mode is set to
+			   Legacy for 2.0 according to http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlform.name.aspx
+			*/
+			
 			string action;
 			string file_path = Page.Request.FilePath;
 			string current_path = Page.Request.CurrentExecutionFilePath;
@@ -256,7 +260,13 @@ namespace System.Web.UI.HtmlControls
 				action = Page.RenderResponse.createActionURL(action);
 #endif
 
-			w.WriteAttribute ("name", Name);
+#if NET_2_0
+			XhtmlConformanceSection xhtml = WebConfigurationManager.GetSection ("system.web/xhtmlConformance") as
+				XhtmlConformanceSection;
+			
+			if (xhtml != null && xhtml.Mode == XhtmlConformanceMode.Legacy)
+#endif
+				w.WriteAttribute ("name", Name);
 
 			w.WriteAttribute ("method", Method);
 			w.WriteAttribute ("action", action);

+ 4 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,5 +1,9 @@
 2007-04-06  Marek Habersack  <[email protected]>
 
+	* ClientScriptManager.cs: render the 'type' attribute in
+	WriteScript and do not render the 'language' attribute when in
+	NET_2_0+ mode.
+
 	* Page.cs: defaults for ViewStateEncrptionMode and AsyncTimeout
 	are read from the pages section, if found.
 

+ 7 - 2
mcs/class/System.Web/System.Web.UI/ClientScriptManager.cs

@@ -304,8 +304,13 @@ namespace System.Web.UI
 				entry = entry.Next;
 			}
 			
-			if (addScriptTags)
-				script = "<script language=javascript>\n<!--\n" + script + "\n// -->\n</script>";
+			if (addScriptTags) {
+				script = "<script type=\"text/javascript\"" +
+#if !NET_2_0
+					"language=\"javascript\"" +
+#endif
+					">\n<!--\n" + script + "\n// -->\n</script>";
+			}
 
 			entry = new ScriptEntry (type, key, script);
 			

+ 7 - 0
mcs/class/System.Web/System.Web/ChangeLog

@@ -1,3 +1,10 @@
+2007-04-06  Marek Habersack  <[email protected]>
+
+	* HttpUtility.cs: added a constant that contains the default query
+	parameter character.
+	ParseQueryString supports queries with both '&' and ';' parameter
+	separators.
+
 2007-04-05  Marek Habersack  <[email protected]>
 
 	* CapabilitiesLoader.cs: Make sure that the capability names

+ 6 - 2
mcs/class/System.Web/System.Web/HttpUtility.cs

@@ -42,7 +42,11 @@ namespace System.Web {
 	// CAS - no InheritanceDemand here as the class is sealed
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public sealed class HttpUtility {
-
+#if NET_2_0
+		internal const char QueryParamSeparator = ';';
+#else
+		internal const char QueryParamSeparator = '&';
+#endif
 		#region Fields
 	
 		static Hashtable entities;
@@ -1015,7 +1019,7 @@ namespace System.Web {
 				for (int q = namePos; q < query.Length; q++) {
 					if (valuePos == -1 && query[q] == '=') {
 						valuePos = q + 1;
-					} else if (query[q] == '&') {
+					} else if (query[q] == ';' || query[q] == '&') {
 						valueEnd = q;
 						break;
 					}