Validation client javascript error

G

Gary Varga

In the file WebUIValidation.js, when a postback that
doesn't fail the validation has a javascript error saying
summary is undefined in the ValidationSummaryOnSubmit
function. Page_ValidationSummaries has a length of 1 but
there are no array entries.

This is the line that fails:

summary.style.display = "none";

TIA,
Gary Varga
 
M

Mike Moore [MSFT]

Hi Gary,

In order to help you, I need to recreate this problem on my own machine.
What are the steps for setting up a page that will generate this error?

Thank you, Mike Moore
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.


--------------------
 
G

Gary Varga

Thanks for the reply, Mike.

I have a control derived from ValidationSummary in a dll.
I used this in a user control and included it in a page.
This page is derived from a class which itself derives
from System.Web.UI.Page.

I can send you the dll and the updated WebUIValidation.js
document - yes I have added to this in one place, I added
a new display type - if you want.

Regards,
Gary
 
M

Mike Moore [MSFT]

Hi Gary,

Here's my understanding of your problem statement.
You have a custom validation control and you have customized your
WebUIValidation.js file. After posting your page, the new page fails with a
client script error related to a modified portion of WebUIValidation.js.
This portion of your code expects an array with one entry, but the array
has no entries.

---
I recommend that you use view source to examine what the browser is
receiving after the postback. Find the part that adds an entry to your
Page_ValidationSummaries array. Somewhere within this you should see how it
fails to add an entry to the array. This can then help you find what to
change in your code so that the javascript code is correct.

As part of this, I think you may want to create a new test page which is
simplified. Remove as much complexity as possible while still reproducing
the error.

I realize this isn't an answer, but I hop it helps.

Thank you, Mike Moore
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.


--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top