New test.
[mono.git] / mcs / class / System.Web / System.Web.UI.HtmlControls / HtmlForm.cs
index e183a0de143363b904e704df7fc133a3678bc568..7d6c753ccffe4b23e4e3987c70f98f75a13942d2 100644 (file)
@@ -100,7 +100,7 @@ namespace System.Web.UI.HtmlControls
                        get {
                                string method = Attributes["method"];
 
-                               if (method == null) {
+                               if ((method == null) || (method.Length == 0)) {
                                        return ("post");
                                }
                                
@@ -117,12 +117,7 @@ namespace System.Web.UI.HtmlControls
 
                [DefaultValue ("")]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-#if NET_2_0
-               public virtual
-#else          
-               public
-#endif         
-               string Name 
+               public virtual string Name 
                {
                        get {
                                return UniqueID;
@@ -168,14 +163,7 @@ namespace System.Web.UI.HtmlControls
                        }
                }
 
-#if NET_2_0
-               public override
-#else          
-               // New in NET1.1 sp1
-               public new
-#endif         
-               string UniqueID
-               {
+               public override string UniqueID {
                        get {
                                return base.UniqueID;
                        }
@@ -237,55 +225,7 @@ namespace System.Web.UI.HtmlControls
 
                protected internal override void OnPreRender (EventArgs e)
                {
-                       string focus_id = null;
-                       bool need_script_block = false;
-                       bool render_uplevel;
-
                        base.OnPreRender(e);
-
-                       render_uplevel = DetermineRenderUplevel ();
-
-                       /* figure out if we have some control we're going to focus */
-                       if (DefaultFocus != null && DefaultFocus != "")
-                               focus_id = DefaultFocus;
-                       else if (DefaultButton != null && DefaultButton != "")
-                               focus_id = DefaultButton;
-
-                       /* decide if we need to include the script block */
-                       need_script_block = (focus_id != null || submitdisabledcontrols);
-
-                       if (render_uplevel) {
-                               Page.RequiresPostBackScript();
-
-                               if (need_script_block && !Page.ClientScript.IsClientScriptBlockRegistered ("Mono-System.Web-HtmlScriptBlock")) {
-                                       Page.ClientScript.RegisterClientScriptBlock ("Mono-System.Web-HtmlScriptBlock",
-                                                                                    String.Format ("<script language=\"JavaScript\" src=\"{0}\"></script>",
-                                                                                                   Page.ClientScript.GetWebResourceUrl (GetType(),
-                                                                                                                                        "webform.js")));
-                               }
-
-
-                               if (focus_id != null) {
-                                       Page.ClientScript.RegisterStartupScript ("HtmlForm-DefaultButton-StartupScript",
-                                                                                String.Format ("<script language=\"JavaScript\">\n" + 
-                                                                                               "<!--\n" + 
-                                                                                               "WebForm_AutoFocus('{0}');// -->\n" + 
-                                                                                               "</script>\n", focus_id));
-                               }
-
-                               if (submitdisabledcontrols) {
-                                       Page.ClientScript.RegisterOnSubmitStatement ("HtmlForm-SubmitDisabledControls-SubmitStatement",
-                                                                                    "javascript: return WebForm_OnSubmit();");
-                                       Page.ClientScript.RegisterStartupScript ("HtmlForm-SubmitDisabledControls-StartupScript",
-@"<script language=""JavaScript"">
-<!--
-function WebForm_OnSubmit() {
-WebForm_ReEnableControls();
-return true;
-} // -->
-</script>");
-                               }
-                       }
                }
 #endif         
 
@@ -309,10 +249,7 @@ return true;
                                action = fp_uri.MakeRelative (current_uri);
                        }
 
-                       string query = Page.Request.QueryStringRaw;
-                       if (query != null && query.Length > 0) {
-                               action += "?" + query;
-                       }
+                       action += Page.Request.QueryStringRaw;
 
                        w.WriteAttribute ("name", Name);