Groups | Blog | Home
all groups > asp.net webcontrols > october 2004 >

asp.net webcontrols : Add RequiredFieldValidator -- Post doesn't work.


Michael Reinhart
10/6/2004 6:27:15 PM
Hi all.

I've got a form with lots of stuff on it, but nothing really unusual... some
text boxes, listboxes, dropdownlists, and a couple of Peter's Calendar Text
Boxes.

I've got a button that some does some oledbstuff, inserting data into a
database--- this all works fine, until I put a RequiredFieldValidator on the
form... then, the button click doesn't even seem to fire. I've added a
debug.writeline (and tried a breakpoint) as the first line of the
btnSave_Click procedure, but when I click the button, it doesn't even hit
it...

Does anyone have any idea what might be wrong?

Thanks,
Michael Reinhart

Michael Reinhart
10/7/2004 12:58:01 PM
Hey Peter... figured I'd see you in here somewhere...

Actually, I just got off the phone with MS PSS--- seems there's a bug in SP1
of the Framework. Essentially the client side scripts (in
C:\Inetpub\wwwroot\aspnet_client\system_web\1_1_4322) can get out of sync
with the ISAPI filter under certain conditions. to fix this, you need to
manually run C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe
.... if this fails, you can move your client side script files (in the
earlier path) out of that folder, and then try running aspnet_regiis.exe
again... worked for me.

They say there's a KB Article under development but it might not be ready
for a couple of weeks.

PS... I have no doubt that your validators are better, but I only really
need are a few required fields in this project.

Cheers,

Michael Reinhart

[quoted text, click to view]

Peter Blum
10/7/2004 1:45:26 PM
Hi Michael,

Is it even posting back? There are often problems setting up the client-side
javascript so that the <form onsubmit=> code executes, it prevents
submitting. (The onsubmit code merely needs to return false to do this.)

First, make sure client-side scripts are installed. Run this command:
[windows]\microsoft.net\framework\[version]\aspnet_regiis.exe -c
It will install ASP.NET version specific scripts into each domain's
\aspnet_client folder.

Next, take a look at this thread:
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=639862

Don't forget that I have a far better validation system, see my
"Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx. If you need its features (and there
are so many more than what you have with MS validators), its easier to start
with it than to convert to it later.

--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

[quoted text, click to view]

AddThis Social Bookmark Button