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

Keep in mind the updater tool won’t overwrite read-only files (that may be part of a vss deploy etc)

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

Use this as stated above to ‘aspnet_regiis.exe -i’ make the fix accross all sites on your web server.

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:

  • Encourage children to ask questions. Listen to what they say. Provide comfort and assurance that address their specific fears. It’s okay to admit you can’t answer all of their questions.
  • Talk on their level. Communicate with your children in a way they can understand. Don’t get too technical or complicated.
  • Find out what frightens them. Encourage your children to talk about fears they may have. They may worry that someone will harm them at school or that someone will try to hurt you.
  • Focus on the positive. Reinforce the fact that most people are kind and caring. Remind your child of the heroic actions taken by ordinary people to help victims of tragedy.
  • Pay attention. Your children’s play and drawings may give you a glimpse into their questions or concerns. Ask them to tell you what is going on in the game or the picture. It’s an opportunity to clarify any misconceptions, answer questions, and give reassurance.
  • Develop a plan. Establish a family emergency plan for the future, such as a meeting place where everyone should gather if something unexpected happens in your family or neighborhood. It can help you and your children feel safer.

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;

}

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

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.

Leave a Comment

Your email address will not be published. Required fields are marked *

Loading...