Author: igorz
Date: 2007-08-30 09:45:21 -0400 (Thu, 30 Aug 2007)
New Revision: 85047

Modified:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/CustomValidator.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs
   
trunk/mcs/class/System.Web/System.Web.UI.WebControls/RegularExpressionValidator.cs
   
trunk/mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs
   trunk/mcs/class/System.Web/resources/ChangeLog
   trunk/mcs/class/System.Web/resources/WebUIValidation_2.0.js
Log:
2007-08-30 Igor Zelmanovich <[EMAIL PROTECTED]>

        * BaseCompareValidator.cs:
        * BaseValidator.cs:
        * CompareValidator.cs:
        * CustomValidator.cs:
        * RangeValidator.cs:
        * RegularExpressionValidator.cs:
        * RequiredFieldValidator.cs:
        all Validators use RegisterExpandoAttribute for 
        not XHTML compliant attributes.

2007-08-30 Igor Zelmanovich <[EMAIL PROTECTED]>

        * WebUIValidation_2.0.js:
        all Validators use RegisterExpandoAttribute for 
        not XHTML compliant attributes.



Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs    
    2007-08-30 13:27:07 UTC (rev 85046)
+++ 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs    
    2007-08-30 13:45:21 UTC (rev 85047)
@@ -51,10 +51,10 @@
                protected override void AddAttributesToRender (HtmlTextWriter w)
                {
                        if (RenderUplevel) {
-                               w.AddAttribute ("datatype", Type.ToString());
-
 #if NET_2_0
                                if (Page!=null){
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "type", Type.ToString ());
+
                                        switch (Type) {
                                        case ValidationDataType.Date:
                                                DateTimeFormatInfo 
dateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat;
@@ -72,6 +72,8 @@
                                                break;
                                        }
                                }
+#else
+                               w.AddAttribute ("datatype", Type.ToString());
 #endif
                        }
 

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs       
2007-08-30 13:27:07 UTC (rev 85046)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs       
2007-08-30 13:45:21 UTC (rev 85047)
@@ -133,8 +133,8 @@
                }
 
                public override bool Enabled {
-                       get { return ViewState.GetBool ("Enabled", true); }
-                       set { ViewState ["Enabled"] = value; }
+                       get { return ViewState.GetBool ("BaseValidatorEnabled", 
true); }
+                       set { ViewState ["BaseValidatorEnabled"] = value; }
                }
 
 #if NET_2_0
@@ -202,9 +202,6 @@
                        return render_uplevel;
                }
 
-               [MonoTODO()]
-               // for 2.0: not XHTML attributes must be registered with 
RegisterExpandoAttribute 
-               // when it will be implemented, in this case 
WebUIValidation_2.0.js muist be refactored
                protected override void AddAttributesToRender (HtmlTextWriter 
writer)
                {
                        /* if we're rendering uplevel, add our attributes */
@@ -214,28 +211,43 @@
                                        
writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
 
                                if (ControlToValidate != String.Empty)
+#if NET_2_0
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "controltovalidate", 
GetControlRenderID (ControlToValidate));
+#else
                                        writer.AddAttribute 
("controltovalidate", GetControlRenderID (ControlToValidate));
+#endif
 
                                if (ErrorMessage != String.Empty)
+#if NET_2_0
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "errormessage", 
ErrorMessage);
+#else
                                        writer.AddAttribute ("errormessage", 
ErrorMessage);
+
                                if (Text != String.Empty)
                                        writer.AddAttribute ("text", Text);
+#endif
+
 #if NET_2_0
                                if (ValidationGroup != String.Empty)
-                                       writer.AddAttribute ("validationgroup", 
ValidationGroup);
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "validationGroup", 
ValidationGroup);
 
                                if (SetFocusOnError)
                                        
Page.ClientScript.RegisterExpandoAttribute (ClientID, "focusOnError", "t");
 #endif
                                if (!Enabled)
+#if NET_2_0
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "enabled", "False");
+#else
                                        writer.AddAttribute ("enabled", 
"false", false);
+#endif
 
 #if NET_2_0
                                if (Enabled && !IsValid) {
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "isvalid", "False");
 #else
                                if (!IsValid) {
+                                       writer.AddAttribute ("isvalid", 
"false", false);
 #endif
-                                       writer.AddAttribute ("isvalid", 
"false", false);
                                }
                                else {
                                        if (Display == ValidatorDisplay.Static)
@@ -245,7 +257,11 @@
                                }
 
                                if (Display != ValidatorDisplay.Static)
+#if NET_2_0
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "display", 
Display.ToString ());
+#else
                                        writer.AddAttribute ("display", 
Display.ToString());
+#endif
                        }
 
                        base.AddAttributesToRender (writer);

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2007-08-30 13:27:07 UTC (rev 85046)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2007-08-30 13:45:21 UTC (rev 85047)
@@ -1,3 +1,15 @@
+2007-08-30 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * BaseCompareValidator.cs:
+       * BaseValidator.cs:
+       * CompareValidator.cs:
+       * CustomValidator.cs:
+       * RangeValidator.cs:
+       * RegularExpressionValidator.cs:
+       * RequiredFieldValidator.cs:
+       all Validators use RegisterExpandoAttribute for 
+       not XHTML compliant attributes.
+
 2007-08-29  Marek Habersack  <[EMAIL PROTECTED]>
 
        * ListControl.cs: do not perform data binding twice if

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs    
2007-08-30 13:27:07 UTC (rev 85046)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs    
2007-08-30 13:45:21 UTC (rev 85047)
@@ -49,12 +49,21 @@
                protected override void AddAttributesToRender (HtmlTextWriter w)
                {
                        if (RenderUplevel) {
+#if NET_2_0
+                               Page.ClientScript.RegisterExpandoAttribute 
(ClientID, "evaluationfunction", "CompareValidatorEvaluateIsValid");
+                               if (ControlToCompare.Length > 0)
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "controltocompare", 
GetControlRenderID (ControlToCompare));
+                               if (ValueToCompare.Length > 0)
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "valuetocompare", 
ValueToCompare);
+                               Page.ClientScript.RegisterExpandoAttribute 
(ClientID, "operator", Operator.ToString ());
+#else
                                if (ControlToCompare != "")
                                        w.AddAttribute ("controltocompare", 
GetControlRenderID(ControlToCompare));
                                if (ValueToCompare != "")
                                        w.AddAttribute ("valuetocompare", 
ValueToCompare);
                                w.AddAttribute ("operator", 
Operator.ToString());
                                w.AddAttribute ("evaluationfunction", 
"CompareValidatorEvaluateIsValid", false);
+#endif
                        }
 
                        base.AddAttributesToRender (w);

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/CustomValidator.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/CustomValidator.cs     
2007-08-30 13:27:07 UTC (rev 85046)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/CustomValidator.cs     
2007-08-30 13:45:21 UTC (rev 85047)
@@ -72,17 +72,19 @@
 
                        if (base.RenderUplevel) {
                                string s;
-
+#if NET_2_0
+                               Page.ClientScript.RegisterExpandoAttribute 
(ClientID, "evaluationfunction", "CustomValidatorEvaluateIsValid");
+                               if (ValidateEmptyText)
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "validateemptytext", 
"true");
+                               if (ClientValidationFunction.Length > 0)
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, 
"clientvalidationfunction", ClientValidationFunction);
+#else
                                writer.AddAttribute ("evaluationfunction", 
"CustomValidatorEvaluateIsValid", false);
 
                                s = ClientValidationFunction;
                                if (s != string.Empty) {
                                        
writer.AddAttribute("clientvalidationfunction", s);
                                }
-
-#if NET_2_0
-                               if (ValidateEmptyText)
-                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "validateemptytext", 
"true");
 #endif
                        }
                }

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs      
2007-08-30 13:27:07 UTC (rev 85046)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs      
2007-08-30 13:45:21 UTC (rev 85047)
@@ -90,9 +90,15 @@
                        base.AddAttributesToRender (writer);
 
                        if (RenderUplevel) {
+#if NET_2_0
+                               Page.ClientScript.RegisterExpandoAttribute 
(ClientID, "evaluationfunction", "RangeValidatorEvaluateIsValid");
+                               Page.ClientScript.RegisterExpandoAttribute 
(ClientID, "minimumvalue", MinimumValue);
+                               Page.ClientScript.RegisterExpandoAttribute 
(ClientID, "maximumvalue", MaximumValue);
+#else
                                writer.AddAttribute("evaluationfunction", 
"RangeValidatorEvaluateIsValid", false); // FIXME - we need to define this in 
client code
                                writer.AddAttribute("minimumValue", 
MinimumValue.ToString(CultureInfo.InvariantCulture));
                                writer.AddAttribute("maximumValue", 
MaximumValue.ToString(CultureInfo.InvariantCulture));
+#endif
                        }
                }
 

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/RegularExpressionValidator.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/RegularExpressionValidator.cs
  2007-08-30 13:27:07 UTC (rev 85046)
+++ 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/RegularExpressionValidator.cs
  2007-08-30 13:45:21 UTC (rev 85047)
@@ -53,9 +53,15 @@
                protected override void AddAttributesToRender (HtmlTextWriter w)
                {
                        if (RenderUplevel) {
+#if NET_2_0
+                               Page.ClientScript.RegisterExpandoAttribute 
(ClientID, "evaluationfunction", "RegularExpressionValidatorEvaluateIsValid");
+                               if (ValidationExpression.Length > 0)
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "validationexpression", 
ValidationExpression);
+#else
                                w.AddAttribute ("evaluationfunction", 
"RegularExpressionValidatorEvaluateIsValid", false);
                                if (ValidationExpression != "")
                                        w.AddAttribute ("validationexpression", 
ValidationExpression);
+#endif
                        }
 
                        base.AddAttributesToRender (w);

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs  
    2007-08-30 13:27:07 UTC (rev 85046)
+++ 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs  
    2007-08-30 13:45:21 UTC (rev 85047)
@@ -43,8 +43,13 @@
                protected override void AddAttributesToRender (HtmlTextWriter w)
                {
                        if (RenderUplevel) {
+#if NET_2_0
+                               Page.ClientScript.RegisterExpandoAttribute 
(ClientID, "evaluationfunction", "RequiredFieldValidatorEvaluateIsValid");
+                               Page.ClientScript.RegisterExpandoAttribute 
(ClientID, "initialvalue", InitialValue);
+#else
                                w.AddAttribute ("evaluationfunction", 
"RequiredFieldValidatorEvaluateIsValid", false);
                                w.AddAttribute ("initialvalue", InitialValue);
+#endif
                        }
 
                        base.AddAttributesToRender (w);

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs   
2007-08-30 13:27:07 UTC (rev 85046)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs   
2007-08-30 13:45:21 UTC (rev 85047)
@@ -179,8 +179,20 @@
                                        
writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
 #if NET_2_0
                                if (ValidationGroup != String.Empty)
-                                       writer.AddAttribute ("validationgroup", 
ValidationGroup);
-#endif
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "validationGroup", 
ValidationGroup);
+
+                               if (HeaderText.Length > 0)
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "headertext", HeaderText);
+
+                               if (ShowMessageBox)
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "showmessagebox", "True");
+
+                               if (!ShowSummary)
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "showsummary", "False");
+
+                               if (DisplayMode != 
ValidationSummaryDisplayMode.BulletList)
+                                       
Page.ClientScript.RegisterExpandoAttribute (ClientID, "displaymode", 
DisplayMode.ToString ());
+#else
                                if (HeaderText != "")
                                        writer.AddAttribute ("headertext", 
HeaderText);
 
@@ -192,6 +204,7 @@
 
                                if (DisplayMode != 
ValidationSummaryDisplayMode.BulletList)
                                        writer.AddAttribute ("displaymode", 
DisplayMode.ToString());
+#endif
 
                                if (!has_errors)
                                        writer.AddStyleAttribute ("display", 
"none");

Modified: trunk/mcs/class/System.Web/resources/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/resources/ChangeLog      2007-08-30 13:27:07 UTC 
(rev 85046)
+++ trunk/mcs/class/System.Web/resources/ChangeLog      2007-08-30 13:45:21 UTC 
(rev 85047)
@@ -1,5 +1,11 @@
 2007-08-30 Igor Zelmanovich <[EMAIL PROTECTED]>
 
+       * WebUIValidation_2.0.js:
+       all Validators use RegisterExpandoAttribute for 
+       not XHTML compliant attributes.
+
+2007-08-30 Igor Zelmanovich <[EMAIL PROTECTED]>
+
        * WebUIValidation_2.0.js: refactoring.
        initialize evaluationfunction property for validator on client.
        makes it compatible with AjaxControlToolkit.    

Modified: trunk/mcs/class/System.Web/resources/WebUIValidation_2.0.js
===================================================================
--- trunk/mcs/class/System.Web/resources/WebUIValidation_2.0.js 2007-08-30 
13:27:07 UTC (rev 85046)
+++ trunk/mcs/class/System.Web/resources/WebUIValidation_2.0.js 2007-08-30 
13:45:21 UTC (rev 85047)
@@ -41,26 +41,22 @@
 {
        if (typeof (this.Page_ValidationSummaries) != 'undefined' && 
this.Page_ValidationSummaries != null) {
                this.have_validation_summaries = true;
-                 for (var v = 0; v < this.Page_ValidationSummaries.length; 
v++) {
-                   var vs = this.Page_ValidationSummaries [v];
-                   if (vs.getAttribute ("validationgroup") == null)
-                           vs.setAttribute ("validationgroup", "");
-           }
        }
 
        for (var v = 0; v < this.Page_Validators.length; v++) {
                var vo = this.Page_Validators [v];
 
-               if (vo.getAttribute ("isvalid") == null)
-                       vo.setAttribute ("isvalid", "true");
+               if (typeof(vo.isvalid) == "string" && vo.isvalid == "False")
+                       vo.isvalid = false;
+               else
+                       vo.isvalid = true;
 
-               if (vo.getAttribute ("enabled") == null)
-                       vo.setAttribute ("enabled", "true");
-
-               if (vo.getAttribute ("validationgroup") == null)
-                       vo.setAttribute ("validationgroup", "");
+               if (typeof(vo.enabled) == "string" && vo.enabled == "False")
+                       vo.enabled = false;
+               else
+                       vo.enabled = true;
                        
-               vo.evaluationfunction = this [vo.getAttribute 
("evaluationfunction")];
+               vo.evaluationfunction = this [vo.evaluationfunction];
        }
 
        this.Page_ValidationActive = true;
@@ -78,24 +74,23 @@
                    
                    if(this.IsValidationGroupMatch(vs, group)) {
 
-                           var header = vs.getAttribute ("headertext");
-                           if (header == null)
-                                   header = "";
+                           var header = "";
+                           if(typeof(vs.headertext)=="string")
+                                   header = vs.headertext;
 
-                           attr = vs.getAttribute ("showsummary");
-                           if (attr == null || attr.toLowerCase() == "true") {
-                                   var displaymode = vs.getAttribute 
("displaymode");
-                                   if (displaymode == null) displaymode = 
"Bulleted";
+                           if (vs.showsummary != "False") {
+                                       if (typeof(vs.displaymode) != "string")
+                                               vs.displaymode = "BulletList";
 
                                    var html = "";
 
-                                   if (displaymode == "List") {
+                                   if (vs.displaymode == "List") {
                                            list_pre = "";
                                            list_post = "";
                                            item_pre = "";
                                            item_post = "<br>";
                                    }
-                                   else if (displaymode == "SingleParagraph") {
+                                   else if (vs.displaymode == 
"SingleParagraph") {
                                            list_pre = "";
                                            list_post = "<br>";
                                            item_pre = "";
@@ -113,8 +108,8 @@
                                                for (var v = 0; v < 
this.Page_Validators.length; v++) {
                                      var vo = this.Page_Validators [v];
 
-                                           if (vo.getAttribute 
("isvalid").toLowerCase() == "false") {
-                                                   var text = 
this.ValidatorGetErrorMessage (vo);
+                                           if (!vo.isvalid) {
+                                                   var text = vo.errormessage;
                                                    if (text != null && text != 
"") {
                                                            html += item_pre + 
text + item_post;
                                                    }
@@ -126,15 +121,14 @@
                                    vs.style.display = "block";
                            }
 
-                           attr = vs.getAttribute ("showmessagebox");
-                           if (attr != null && attr.toLowerCase() == "true") {
+                           if (vs.showmessagebox == "True") {
                                    var v_contents = "";
 
                                                for (var v = 0; v < 
this.Page_Validators.length; v++) {
                                      var vo = this.Page_Validators [v];
 
-                                           if (vo.getAttribute 
("isvalid").toLowerCase() == "false") {
-                                                   var text = 
this.ValidatorGetErrorMessage (vo);
+                                           if (!vo.isvalid) {
+                                                   var text = vo.errormessage;
                                                    if (text != null && text != 
"") {
                                                            v_contents += "-" + 
text + "\n";
                                                    }
@@ -216,7 +210,7 @@
                var evalfunc = vo.evaluationfunction;
                var result = false;
 
-               if (vo.getAttribute ("enabled").toLowerCase() == "false" || 
!this.IsValidationGroupMatch(vo, group)) {
+               if (!vo.enabled || !this.IsValidationGroupMatch(vo, group)) {
                        result = true;
                        this.ValidatorSucceeded (vo);
                }
@@ -231,14 +225,16 @@
                        }
                }
                
-               vo.setAttribute("isvalid", result ? "true" : "false");
+               vo.isvalid = result;
        }
     this.ValidationSummaryOnSubmit(group);
        return this.validation_result;
 }
 
 webForm.IsValidationGroupMatch = function (vo, group) {
-    var valGroup = vo.getAttribute ("validationgroup");
+    var valGroup = "";
+    if (typeof(vo.validationGroup) == "string")
+               valGroup = vo.validationGroup;
     if ((typeof(group) == "undefined") || (group == null)) {
         return (valGroup == "");
     }
@@ -246,7 +242,7 @@
 }
 
 webForm.ValidatorSetFocus = function (val) {
-    var ctrl = this.GetElement(val.getAttribute ("controltovalidate"));
+    var ctrl = this.GetElement(val.controltovalidate);
        if ((typeof(ctrl) != "undefined") && (ctrl != null) &&
                ((ctrl.tagName.toLowerCase() != "input") || 
(ctrl.type.toLowerCase() != "hidden")) &&
                (typeof(ctrl.disabled) == "undefined" || ctrl.disabled == null 
|| ctrl.disabled == false) &&
@@ -375,18 +371,20 @@
 
 webForm.CompareValidatorEvaluateIsValid = function (validator)
 {
-       var ControlToCompare = validator.getAttribute ("controltocompare");
-       var ValueToCompare = validator.getAttribute ("valuetocompare");
-       var Operator = validator.getAttribute ("operator").toLowerCase();
-       var ControlToValidate = validator.getAttribute ("controltovalidate");
-       var DataType = validator.getAttribute ("datatype");
+       var Operator = validator.operator.toLowerCase();
+       var ControlToValidate = validator.controltovalidate;
+       var DataType = validator.type;
 
        var ctrl_value = this.ValidatorTrim (this.ValidatorGetValue 
(ControlToValidate));
        if (ctrl_value == "") {
                this.ValidatorSucceeded (validator);
                return true;
        }
-       var compare = (ControlToCompare != null && ControlToCompare != "") ? 
this.ValidatorTrim (this.ValidatorGetValue (ControlToCompare)) : ValueToCompare;
+       var compare = "";
+       if (typeof(validator.controltocompare) == "string" && 
document.getElementById(validator.controltocompare))
+               compare = 
this.ValidatorTrim(this.ValidatorGetValue(val.controltocompare));
+       else if (typeof(validator.valuetocompare) == "string")
+               compare = validator.valuetocompare;
 
        var left = this.Convert (ctrl_value, DataType, validator);
        if (left == null) {
@@ -433,8 +431,8 @@
 
 webForm.RangeValidatorEvaluateIsValid = function (validator)
 {
-       var ControlToValidate = validator.getAttribute ("controltovalidate");
-       var DataType = validator.getAttribute ("datatype");
+       var ControlToValidate = validator.controltovalidate;
+       var DataType = validator.type;
 
        var ctrl_value = this.ValidatorTrim (this.ValidatorGetValue 
(ControlToValidate));
 
@@ -443,8 +441,8 @@
                return true;
        }
 
-       var MinimumValue = this.Convert (validator.getAttribute 
("minimumvalue"), DataType, validator);
-       var MaximumValue = this.Convert (validator.getAttribute 
("maximumvalue"), DataType, validator);
+       var MinimumValue = this.Convert (validator.minimumvalue, DataType, 
validator);
+       var MaximumValue = this.Convert (validator.maximumvalue, DataType, 
validator);
        var val = this.Convert (ctrl_value, DataType, validator);
        if (val == null || val < MinimumValue || val > MaximumValue) {
                this.ValidatorFailed (validator);
@@ -458,8 +456,8 @@
 
 webForm.RegularExpressionValidatorEvaluateIsValid = function (validator)
 {
-       var ValidationExpression = validator.getAttribute 
("validationexpression");
-       var ControlToValidate = validator.getAttribute ("controltovalidate");
+       var ValidationExpression = validator.validationexpression;
+       var ControlToValidate = validator.controltovalidate;
 
        var ctrl_value = this.ValidatorTrim (this.ValidatorGetValue 
(ControlToValidate));
 
@@ -485,8 +483,8 @@
 
 webForm.RequiredFieldValidatorEvaluateIsValid = function (validator)
 {
-       var InitialValue = validator.getAttribute ("initialvalue");
-       var ControlToValidate = validator.getAttribute ("controltovalidate");
+       var InitialValue = validator.initialvalue;
+       var ControlToValidate = validator.controltovalidate;
 
        var ctrl_value = this.ValidatorTrim (this.ValidatorGetValue 
(ControlToValidate));
 
@@ -502,15 +500,14 @@
 
 webForm.CustomValidatorEvaluateIsValid = function (validator)
 {
-       var InitialValue = validator.getAttribute ("initialvalue");
-       var ControlToValidate = validator.getAttribute ("controltovalidate");
+       var ControlToValidate = validator.controltovalidate;
 
        if (!ControlToValidate) {
                this.ValidatorSucceeded (validator);
                return true;
        }
 
-       var evaluationfunc = validator.getAttribute 
("clientvalidationfunction");
+       var evaluationfunc = validator.clientvalidationfunction;
 
        var ctrl_value = this.ValidatorTrim (this.ValidatorGetValue 
(ControlToValidate));
        
@@ -551,7 +548,7 @@
 
 webForm.ValidatorUpdateDisplay = function (v, valid)
 {
-       var display = v.getAttribute ("display");
+       var display = v.display;
 
        /* for validators that aren't displayed, do nothing */
        if (display == "None") {
@@ -564,26 +561,6 @@
        }
 }
 
-webForm.ValidatorGetErrorMessage = function  (v)
-{
-       var text = v.getAttribute ("errormessage");
-       if (text == null || text == "")
-               text = v.getAttribute ("text"); 
-       if (text == null)
-               text = "";
-       return text;
-}
-
-webForm.ValidatorGetText = function  (v)
-{
-       var text = v.getAttribute ("text");     
-       if (text == null || text == "")
-               text = v.getAttribute ("errormessage");
-       if (text == null)
-               text = "";
-       return text;
-}
-
 webForm.ValidatorFailed = function  (v)
 {
        this.ValidatorUpdateDisplay (v, false);

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

Reply via email to