Thomas Freudenberg

Confessions of a caffeine addict

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 said:

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!!!
# May 28, 2004 12:50 AM

Anonymous said:


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;
}
# July 6, 2004 4:37 AM

Anonymous said:

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
# July 14, 2004 7:15 AM

Anonymous said:

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.
# September 6, 2004 11:48 PM

Anonymous said:

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.
# September 7, 2004 10:55 AM

Anonymous said:

Thank you so much for your solution, it really saved my bacon!!
# September 17, 2004 11:15 PM

Anonymous said:

Saved me in a crunch, thanks.
# October 4, 2004 6:37 PM

TrackBack said:

# October 9, 2004 5:02 PM

Anonymous said:

Thanks for sharing the info. This error was driving me insane!
# November 11, 2004 12:50 AM

Anonymous said:

Thanks for sharing. Problem solved.
# November 17, 2004 2:29 AM

Anonymous said:

Keep in mind the updater tool won't overwrite read-only files (that may be part of a vss deploy etc)
# November 27, 2004 8:41 PM

TrackBack said:

# January 8, 2005 10:33 AM

Anonymous said:

You guys rock!
# February 15, 2005 8:43 PM

Anonymous said:

thanks you very much REkkie
# February 17, 2005 2:53 AM

Anonymous said:

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
# February 21, 2005 12:38 PM

Anonymous said:

Problem solved. THX!!
# March 4, 2005 1:59 PM

Anonymous said:

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..
# April 21, 2005 9:55 AM

Anonymous said:

Use this as stated above to 'aspnet_regiis.exe -i' make the fix accross all sites on your web server.
# May 13, 2005 7:13 PM

TrackBack said:

# May 28, 2005 12:10 PM

TrackBack said:

# May 29, 2005 5:11 AM

Deepak said:

Thanks a ton, Thomas!
# June 17, 2006 5:41 AM

John Atkins said:

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.

# November 2, 2006 10:22 AM

Mert said:

thanks, good write

# February 1, 2008 5:24 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)