Comment Problem Solved
As I posted, no postbacks on my site were possible. Though I’m running the same application at home and on my site, the onsubmit
tag was rendered differently. At home I get
<form name="Form1" method="post" action="CommentsBroken.aspx"
language="javascript" onsubmit="ValidatorOnSubmit();" id="Form1">
while my public blog is rendered
<form name="Form1" method="post" action="CommentsBroken.aspx"
language="javascript"
onsubmit="if (DefaultButton_RequireOwnPostback(this) ) { return false; }; if (!ValidatorOnSubmit()) return false;"
id="Form1">
Notice that the result of ValidatorOnSubmit
is analysed.
Well, I’ve found some hints in the ASP.NET forum. This issue seems to be caused by an ASP.NET hotfix as described on KB 818803.
Ok, how did I solve this issue? I’ve just edited my WebUIValidation.js, more precisely, I added the line return true;
to ValidatorCommonOnSubmit
:
function ValidatorCommonOnSubmit() {
event.returnValue = !Page_BlockSubmit;
Page_BlockSubmit = false;
return true;
}
Now comments are possible again and I’m happy.
Comments
Anonymous
thanks you very much REkkie
Anonymous
Keep in mind the updater tool won’t overwrite read-only files (that may be part of a vss deploy etc)
Anonymous
You guys rock!
Anonymous
Thanks for sharing. Problem solved.
Ian Suttle
Thanks for sharing the info. This error was driving me insane!
Anonymous
My problem is similar, I need to call another javascript function regardless of whether or not ValidatorOnSubmit() is true or false. My WebUIValidation.js has
function ValidatorCommonOnSubmit() {
var result = !Page_BlockSubmit;
Page_BlockSubmit = false;
event.returnValue = result;
return result;
}
But still my form has onsubmit = “if (!ValidatorOnSubmit()) return false; MyFunction()”
Hence MyFunction() is not being called when the validation fails. I want it to be called everytime.. how can I change this so that my function is also called??
Any help will be appreciated..
wayne albry
Just wanted to say thanks mate, much appreciated. As you’re now in google for this particular problem I anticipate you’re now going to get a lot of hits!!!
Anonymous
I’m having quite the same problem as described above, except that it’s not a problem with the validaton. All my submits work just fine, only when an insert or an update has to be done they fail on one machine, while the work perfectly on my own.
Found this threat a bit late perhaps, but this is the first bit of info I find that comes even close to my problem
Anonymous
Thanks a ton, Thomas!
Anonymous
Use this as stated above to ‘aspnet_regiis.exe -i’ make the fix accross all sites on your web server.
Pudong
Problem solved. THX!!
John Atkins
Whether tragic events touch your family personally or are brought into your home via newspapers and television, you can help children cope with the anxiety that violence, death, and disasters can cause.
Listening and talking to children about their concerns can reassure them that they will be safe. Start by encouraging them to discuss how they have been affected by what is happening around them. Even young children may have specific questions about tragedies. Children react to stress at their own developmental level.
The Caring for Every Child’s Mental Health Campaign offers these pointers for parents and other caregivers:
If you are concerned about your child’s reaction to stress or trauma, call your physician or a community mental health center.
Manoj M
Returning always true might cause to always submit the form even when there are errors on page.
following code should be better alternative
function ValidatorCommonOnSubmit()
{
event.returnValue = !Page_BlockSubmit;
ret_Val = !Page_BlockSubmit;
Page_BlockSubmit = false;
return ret_Val;
}
Anonymous
Saved me in a crunch, thanks.
Jason
Rekkie’s comment is accurate - you should use the latest versions of these javascript files on sites rather than editing the system files.
We at WDG came across this problem recently and realised that the aspnet registration was corrupt for these sites but discovered that running “aspnet_regiis.exe -i” wasn’t updating all sites on our server with the latest jvascript files.
We noticed however that the sites that it wasn’t updating had the aspnet_client directory as a virtual directory. Removing the virtual directories and re-running the regiis command fixed the problem.
Anonymous
I was experiencing exactly the same problem after installing the hotfix as described in KB 818803.
What I found is that the hotfix updates the ValidatorCommonOnSubmit() function in WINDOWS\Microsoft.NET\Framework\v1.1.4322\ASP.NETClientFiles\WebUIValidation.js, however our IIS was pointing to a copy of this file in \WRoot\wwwroot\aspnet_client\system_web\1_1_4322\WebUIValidation.js (pointing directly to the windows directory is not correct from a security point of view).
Copying the updated WebUIValidation.js file to the directory pointed to by IIS fixed the problem. The new ValidatorCommonOnSubmit() function has been changed as follows:
function ValidatorCommonOnSubmit() {
var result = !Page_BlockSubmit;
Page_BlockSubmit = false;
event.returnValue = result;
return result;
}
hope this helps
Rekkie
Thomas Freudenberg
Thanks, Rekkie and Jason.
Unfortunately, Jason, this site is hosted by webhost4life, so I cannot run aspnet_regiis on the server, but have to edit the files manually.
Terry Canning
Thank you so much for your solution, it really saved my bacon!!
Mert
thanks, good write
samar
I have getting a problem while trying to Get “Page_BlockSubmit” on page submit event then script throw an error of Page_BlockSubmit is undefined in asp.net page.
But when i used any ASP.net validator control then it works fine.
So could you explain the reason why it is happening ?
Thanks in advance.
Thomas Freudenberg
This post is more than 11 years old, and I haven’t done any ASP.NET development in the recent time. I suggest you try http://stackoverflow.com.
Leave a Comment
Your email address will not be published. Required fields are marked *