+2007-02-19 Igor Zelmanovich <igorz@mainsoft.com>
+
+ * HtmlInputCheckBox.cs:
+ * HtmlInputControl.cs:
+ * HtmlInputHidden.cs:
+ * HtmlInputRadioButton.cs:
+ * HtmlInputText.cs:
+ * HtmlSelect.cs:
+ * HtmlTextArea.cs:
+ fixed: Form.SubmitDisabledControls feature:
+ not all HtmlInputControl need to be reenabled on client.
+
2007-02-18 Eyal Alaluf <eyala@mainsoft.com>
* HtmlForm.cs: Under TARGET_J2EE use Page.RenderResponse instead of
private object [] _savedControlState;
private bool _doLoadPreviousPage;
string _focusedControlID;
+ bool _hasEnabledControlArray;
#endif
private bool _viewState = true;
private bool _viewStateMac;
#if NET_2_0
const string ScrollPositionXID = "__SCROLLPOSITIONX";
const string ScrollPositionYID = "__SCROLLPOSITIONY";
+ const string EnabledControlArrayID = "__enabledControlArray";
#endif
#if NET_2_0
_focusedControlID = Form.DefaultButton;
}
- if (!String.IsNullOrEmpty (_focusedControlID) || Form.SubmitDisabledControls) {
-
- ClientScript.RegisterWebFormClientScript ();
-
if (!String.IsNullOrEmpty (_focusedControlID)) {
+ ClientScript.RegisterWebFormClientScript ();
ClientScript.RegisterStartupScript ("HtmlForm-DefaultButton-StartupScript",
String.Format ("<script type=\"text/javascript\">\n" +
"<!--\n" +
"</script>\n", _focusedControlID));
}
- if (Form.SubmitDisabledControls) {
+ if (Form.SubmitDisabledControls && _hasEnabledControlArray) {
+ ClientScript.RegisterWebFormClientScript ();
ClientScript.RegisterOnSubmitStatement ("HtmlForm-SubmitDisabledControls-SubmitStatement",
"WebForm_ReEnableControls(this);");
}
- }
+ }
+
+ internal void RegisterEnabledControl (Control control)
+ {
+ if (Form == null || !Page.Form.SubmitDisabledControls || !Page.Form.DetermineRenderUplevel ())
+ return;
+ _hasEnabledControlArray = true;
+ Page.ClientScript.RegisterArrayDeclaration (EnabledControlArrayID, String.Format ("'{0}'", control.ClientID));
}
protected virtual void OnSaveStateComplete (EventArgs e)