Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > asp .net form...

Thread Tools

asp .net form...

Posts: n/a
Hello everyone,

I have a server side asp .net form that has two peices of
information that can be updated by one of two submit
buttons. one submit button updates one database table
with the top half of the form. On the bottom half of the
form I have other infomation that can be instered or
updated to another table in the database by a second
submit button. Every thing was working fine until I added
feild validators to both peices of information. So now my
problem is that when I try to submit the top half of the
information, it wants to validate the bottom half of the
information at the same time. Is there any way to tell
either a submit button to disregard some field validators
or be able to tell the field validators not to fire when
a particular submit button is fired?

I thought about putting the bottom information in its own
server side form, but apparently you can only have one
server side form per page.

Any help or suggestions would be greatly appreciated.


Reply With Quote
Posts: n/a
Field Validation occurs on the client, as you know. When you set the
Submit button's CausesValidation to TRUE in server side code, ASP will
the write the following client onclick event in your submit button

onclick="if (typeof(Page_ClientValidate) == 'function')
Page_ClientValidate(); ".

Page_ClientValidate is a function that is located in the
WebUiValidation.js file (do a file search on this page).

Get acquainted with the valiation code. You can step through it by
debuggin your app on the client and open the "running documents"
window...when your page loads it will display all the included
documents on your page. Then, you can step through the validation
process when you click "onsubmit".

You will probably see that there are probably a number of ways you
could manipulate this. Of course, don't change the webuivalidation.js
file..that could be trouble

You could do lots of things here...Maybe set CauseValidation to false
on the Submit button and then MANUALLY add the onclick event code in
your server side code (I haven't tried this, so I am not sure what
sort of little problems could crop up - HOWEVER it can be done). You
could, in your HTML, add some kind of property or divider in order to
determine which controls to validation when. I don't know your code,
so I can't advise how to do could require a bit of work...


You could possibly
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
global filter to redirect asp (old asp!) pages on site Daves ASP .Net 2 05-31-2006 08:33 AM
2.0: asp:Menu, asp:XmlDataSource, asp:PlaceHolder R.A.M. ASP .Net 1 03-29-2006 07:55 AM
[ASP.NET1.1]Should I kill the ASP.NET worker process after recompilingmy ASP.NET webservice? Andrea Raimondi ASP .Net 1 02-06-2006 08:10 AM
ASP.Net cookie -> ASP -> ASP.Net Ben ASP .Net 3 05-28-2004 03:35 PM
LOOP through an ASP form's pages (not ASP.NET - ASP classic) David A. Beck ASP General 10 04-13-2004 05:38 PM