Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to know if there is a way to save not submit the data to a save part of the database and still fire all the validators when saving? I want to do this because I want to show the user where the errors are and they can still save there data to come back and correct it later. I changed the CauesValidation to Flase on the save button and it saves but the validations don't fire. How can I get the result I need?
Posted
Comments
Kornfeld Eliyahu Peter 22-Oct-14 14:49pm    
Maybe using server side validtors?
Computer Wiz99 22-Oct-14 14:54pm    
How do you mean?
Kornfeld Eliyahu Peter 22-Oct-14 14:57pm    
Let user post the values, validate them on the server side, save, post back the errors to the user...
(Use Google to find samples for that...)
Computer Wiz99 22-Oct-14 15:01pm    
I tried to Google it but I guess I am not asking it right.
Computer Wiz99 22-Oct-14 15:03pm    
I still want the user to see the errors when they are going through the web form. Just that the errors will fire to show the user all of the errors before they save. The submit button still works normal.

As mentioned in the comment - you should use server side validation...
Start with this: http://msdn.microsoft.com/en-us/library/0ke7bxeh(v=vs.110).aspx[^]
---
An other option is using AJAX callback (like jQuery ajax method or variants), that will send user data to the client (via page method probably) even when validation blocks normal post-back...
 
Share this answer
 
v2
Server Side validation Using Validator..

C#
Page.Validate("ValidationGroup");
if (!Page.IsValid)
 {
  return;
 }
else 
 {
 //Your Code Goes Here
 }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900