A
Andrew Jocelyn
Hi
I'm getting a Javascript error when I move my development application to a
production server. I have an page with an UpdatePanel and a RadioButton
which switches between a TextBox or a FileUpload control both with
validators. On the development server the validators work correctly but when
I move the app to a production server the validators don't behave correctly.
The button click event incorrectly fires the validator for the TextBox
control when the UpdatePanel has switched to the FileUpload control.
The script error is
'null' is null or not an object.
which is raised here (>>>):
function ValidatorGetValue(id) {
var control;
control = document.getElementById(id);return control.value;
}
return ValidatorGetValueRecursive(control);
}
I notice that the production web page has missing Javascript. The
development version renders a script block with
Sys.Application.initialize(); and additional script like this:
document.getElementById('ctl00_ContentPlaceHolder1_TitleRequiredFieldValidator1').dispose
= function() {
Array.remove(Page_Validators,
document.getElementById('ctl00_ContentPlaceHolder1_TitleRequiredFieldValidator1'));
}
These 'document.getElementById...' lines for the page validators are missing
from the production version.
I have carefully checked that the web.config file contains the same config
sections and httpmodules etc.
It seems that the production server must have something missing or
incorrectly configured but I'm not sure what this can be. Please let me know
what I can do to fix it.
Many thanks
Andrew
I'm getting a Javascript error when I move my development application to a
production server. I have an page with an UpdatePanel and a RadioButton
which switches between a TextBox or a FileUpload control both with
validators. On the development server the validators work correctly but when
I move the app to a production server the validators don't behave correctly.
The button click event incorrectly fires the validator for the TextBox
control when the UpdatePanel has switched to the FileUpload control.
The script error is
'null' is null or not an object.
which is raised here (>>>):
function ValidatorGetValue(id) {
var control;
control = document.getElementById(id);return control.value;
}
return ValidatorGetValueRecursive(control);
}
I notice that the production web page has missing Javascript. The
development version renders a script block with
Sys.Application.initialize(); and additional script like this:
document.getElementById('ctl00_ContentPlaceHolder1_TitleRequiredFieldValidator1').dispose
= function() {
Array.remove(Page_Validators,
document.getElementById('ctl00_ContentPlaceHolder1_TitleRequiredFieldValidator1'));
}
These 'document.getElementById...' lines for the page validators are missing
from the production version.
I have carefully checked that the web.config file contains the same config
sections and httpmodules etc.
It seems that the production server must have something missing or
incorrectly configured but I'm not sure what this can be. Please let me know
what I can do to fix it.
Many thanks
Andrew