+
+ this._form.__disabledControlArray = new Array();
+ for (var i = 0; i < __enabledControlArray.length; i++) {
+ var c = this.WebForm_GetElementById (__enabledControlArray[i]);
+ if ((typeof(c) != "undefined") && (c != null) && (c.disabled == true)) {
+ c.disabled = false;
+ this._form.__disabledControlArray[this._form.__disabledControlArray.length] = c;
+ }
+ }
+ setTimeout((this._instanceVariableName ? this._instanceVariableName + "." : "") + "WebForm_ReDisableControls ()", 0);
+ return true;
+}
+
+webForm.WebForm_ReDisableControls = function ()
+{
+ for (var i = 0; i < this._form.__disabledControlArray.length; i++) {
+ this._form.__disabledControlArray[i].disabled = true;
+ }
+}
+
+webForm.WebForm_DoPostback = function (eventTarget, eventArgument, actionUrl, autoPostBack, validation, trackFocus, clientSubmit, validationGroup)
+{
+ webForm.WebForm_DoPostBackWithOptions({
+ "eventTarget" : eventTarget,
+ "eventArgument" : eventArgument,
+ "validation" : validation,
+ "validationGroup" : validationGroup,
+ "actionUrl" : actionUrl,
+ "trackFocus" : trackFocus,
+ "clientSubmit" : clientSubmit,
+ "autoPostBack" : autoPostBack
+ });
+}
+
+webForm.WebForm_DoPostBackWithOptions = function (options) {
+ var validationResult = true;
+ if (options.validation && typeof(webForm.Page_ClientValidate) == "function")
+ validationResult = webForm.Page_ClientValidate(options.validationGroup);
+
+ if (validationResult) {
+ if ((typeof(options.actionUrl) != "undefined") && (options.actionUrl != null) && (options.actionUrl.length > 0))
+ webForm._form.action = options.actionUrl;
+ if (options.trackFocus) {
+ var lastFocus = webForm._form.elements["__LASTFOCUS"];
+ if ((typeof(lastFocus) != "undefined") && (lastFocus != null))
+ lastFocus.value = options.eventTarget;
+ }
+ }
+ if (options.clientSubmit)
+ webForm.__doPostBack (options.eventTarget, options.eventArgument);
+}
+
+webForm.WebForm_DoCallback = function (id, arg, callback, ctx, errorCallback, useAsync)
+{
+ var qs = webForm.WebForm_getFormData () + "__CALLBACKTARGET=" + id + "&__CALLBACKARGUMENT=" + encodeURIComponent(arg);
+
+ if (webForm._form["__EVENTVALIDATION"])
+ qs += "&__EVENTVALIDATION=" + encodeURIComponent(webForm._form["__EVENTVALIDATION"].value);
+
+ webForm.WebForm_httpPost (webForm._form.serverURL || document.URL, qs, function (httpPost) { webForm.WebForm_ClientCallback (httpPost, ctx, callback, errorCallback); });
+}
+
+webForm.WebForm_ClientCallback = function (httpPost, ctx, callback, errorCallback)
+{
+ var doc = httpPost.responseText;
+ if (doc.charAt(0) == "e") {
+ if ((typeof(errorCallback) != "undefined") && (errorCallback != null))
+ errorCallback(doc.substring(1), ctx);
+ } else {
+ var separatorIndex = doc.indexOf("|");
+ if (separatorIndex != -1) {
+ var validationFieldLength = parseInt(doc.substring(0, separatorIndex));
+ if (!isNaN(validationFieldLength)) {
+ var validationField = doc.substring(separatorIndex + 1, separatorIndex + validationFieldLength + 1);
+ if (validationField != "") {
+ var validationFieldElement = this._form["__EVENTVALIDATION"];
+ if (!validationFieldElement) {
+ validationFieldElement = document.createElement("INPUT");
+ validationFieldElement.type = "hidden";
+ validationFieldElement.name = "__EVENTVALIDATION";
+ validationFieldElement.id = validationFieldElement.name;
+ this._form.appendChild(validationFieldElement);
+ }
+ validationFieldElement.value = validationField;
+ }
+ if ((typeof(callback) != "undefined") && (callback != null))
+ callback (doc.substring(separatorIndex + validationFieldLength + 1), ctx);
+ }
+ } else {
+ if ((typeof(callback) != "undefined") && (callback != null))
+ callback (doc, ctx);
+ }
+ }
+}
+
+webForm.WebForm_getFormData = function ()
+{
+ var qs = "";
+ var len = this._form.elements.length;
+ for (n=0; n<len; n++) {
+ var elem = this._form.elements [n];
+ var tagName = elem.tagName.toLowerCase();
+ if (tagName == "input") {
+ var type = elem.type;
+ if ((type == "text" || type == "hidden" || type == "password" ||
+ ((type == "checkbox" || type == "radio") && elem.checked)) &&
+ (elem.id != "__EVENTVALIDATION")) {
+ qs += elem.name + "=" + encodeURIComponent (elem.value) + "&";
+ }
+ } else if (tagName == "select") {
+ var selectCount = elem.options.length;
+ for (var j = 0; j < selectCount; j++) {
+ var selectChild = elem.options[j];
+ if (selectChild.selected == true) {
+ qs += elem.name + "=" + encodeURIComponent (elem.value) + "&";
+ }
+ }
+ }
+ else if (tagName == "textarea") {
+ qs += elem.name + "=" + encodeURIComponent (elem.value) + "&";
+ }
+ }
+ return qs;
+}