validation, is it better to have client side or use server side validator controls

 Hi All.

 I want to do validation on text boxes etc. Is it better to do client side validation or just use the server side validation controls?

 


 

0
aspd
4/16/2008 2:46:40 PM
asp.net.web-forms 93655 articles. 5 followers. Follow

2 Replies
1176 Views

Similar Articles

[PageSpeed] 32

Hi! 

If for server side controls you mean RequiredFieldValidator, CompareValidator, RegularExpressionValidator, etc.. i can tell you that they use client and server validation.

For instance if you use a RequiredFieldValidator, on the client will be a validation, but on the server this condition will be evaluated again. Probably one of the objetives of this is deal with client with javascript disabled.

Of course I recommend you to use these controls if you can achive with them what are you looking for.

 


Regards,
Claudio

Simplicity: "the art of maximizing the amount of work not done."
0
crfenix
4/16/2008 2:56:18 PM

The only reason for client side validation is to give the user an immediate response with out doing a postback. As the above poster said, the validation controls are reevaluated on the server to ensure they are correct. You should always validate on the server, becuase if the browser has javascript disable, all your validation logic will not work and the server will process your page as if it were valid.


-wili
0
awilinsk
4/16/2008 3:00:27 PM
Reply:

Similar Artilces:

Validation Controls in .NET ( Client side or server side?)
 i have a very basic question. We have all these validation controls in asp.net ( required field, range validator and others)..my question is the required field validator is a server side control. So does that mean that it does a post back?..is it client side or server side control  The only controls that post back are buttons and other inputs where you set AutoPostback="True", such as a dropdownlist or a textbox.  Another way of posting back is using an UpdatePanel and placing a trigger in it for a specified control and/or event. All controls are considered clien...

Server Side Validation vs Client Side Validation
If your page is using client side validation for required fields, expressions, etc.     What are the benefits or disadvantages of using 'extra' server side validation for max lengths, parsing, etc? Both have their Advantages and Disadvantages... so give this a read http://www.dotnetexpertsforum.com/viewtopic.php?t=172 Regards,Vinz"Code, Beer and Music" that's my way of being a programmer!How to get your Forum Question Answered | Blog | CodeASP.NET hi there, advantage: because you are using javascript some browsers for any reason may not sup...

Server side validation affecting client side validation
Hi there I have some client side validation that is working fine and enables/disables buttons based on user selections. This works great. However, when I perform server side validation using custom validators (like checking if the user has entered < HTML > tags or decimals in the integer boxes) and the server side validation returns isValid = false then all of the JavaScript validation that I've already done when the user clicked each control is lost. I don't understand why the enabled/disabled state of the control is not maintained.  What is calling the JavaScr...

client side validation vs server side validation
hello  i see a web form that consists of three controls :textbox,requiredfieldvalidator that weired to the textbox and a button within the click event of the button there is the following: if page.isvalid then response.redirect("Page is valid") else response.redirect("Page is not valid") end if according to my understandings: when the user does not fill anything in the textbox and then clicks the button the the page will not be submitted (i.e no request to the page will be happened or no postback will be happened) then no server event will be happened so it is sure when the us...

avoiding redundant server-side validation after client-side validation
I see an inaccurate validation behavior on my asp.net (2.0) form. The EnableClientScript property of my validation control is set to True by default, so it performs the validation on clientside. But as soon as this occurs, it also performs the server-side validation, so the page refreshes. When the validation error occurs on clientside, it should not do the validation on serverside (I'm not calling Page.Validate() or doing Page.IsValid). In my past experience, asp.net handled this automatically, but I guess it's not always the ca...

Using Validation COntrols, client-side validation ignored
Hi, I have a simple ASP.NET 1.1 app with some text boxes. I have used RequiredFieldValidator controls and they work fine on localhost. That is, there is no posting to the server if a field is empty. However, if I upload the app to my hosting service (WebHost4Life), the client-side behavior does not take place and the page is posted to the web server (were the expected server-side validation takes place). Any idea why this might be happening (the hosting service does have the appropriate js that should be being used client-side for the validation.) bill b Bill, does your Web.config fi...

Client side validation using validation controls
I have a form which comprises of several form inputs, which are being validated using standard requiredfield & regular expression validators. A summary control is placed to display all server side error messages and is also set to showMessage = true for client side prompting. My requirement is to display all error messages on sumbit within the pop-up (summary) in addition to being displayed on the page (showSummary = true), when JavaScript is disabled the summary control will display all errors server side, which is fine... Now I get to the tricky bit, I include a custom validatio...

form double validation- server side and client side
Hi! I would like to make a server side validation after calling a js function that makes the client-side validation. I do not understand couple of things: 1. Do i need a server side button or  a simple HTML submit button in order to call both of the tests? 2. How do i call a server side function which is written in csharp  after i finish my JS validation (the submit  button is calling the JS function for validation first.)- is it possible to call it directly from a js function? 3. I know that my toolbox on asp.net  contains validation controls who probably are b...

Validations client side or server side ???
Where should the validations (Required field, range, etc.) be done in an web page client side or server side?  As per my knowledge most of the validations are on client side using javascript, unfortunately it won't work if someone has disabled their browsers javascript option. what do we do in this case? Any suggestion please. Both... Client-side for rich client experience. Server-side for data validation and for clients who have disabled javascript. *Always* validate on the server side. You will still get the benefits of client-side validation on browsers setup to handle th...

validation controls
Hi all,I have a web form with a few controls and reqdfield, compare & regex validation controls. On all validation controls i have enabled the client script property. Yet when I submit the form it does a postback to do the validation. Any ideas? I am running vs2005 beta 2.TIA! Hello.how do these validators perform the validation of the other controlos? whar browser are you using?-- Regards,Luis Abreuemail: labreu_at_gmail.comEN blog:http://msmvps.com/blogs/luisabreu Well they are regular requiredfield, regex & compare validators. Browser is latest version of Firefox. I had to use...

Validation control not doing server side validation?
I think the subject covers what I'm asking.  I want to run some checks on the data that was entered after the page was submitted, but I don't know how to handle it if there's a problem the user has to go back and fix.  So I thought I'd try to work around the validation control to see how .NET handles it.  I have a text field that is required.  When the submit button is clicked, I assume some client side validation is run.  I get the validation message I want and the form won't submit.   But then I made a change in the on click event of the submit butto...

Client Side validation of Calendar control prior to server side selectionchanged event code
Hello, Any thoughts or suggestions regarding this will be greatly appreciated. I have a Calendar control with the validation constraint(can't enter appointments on Holidays or on Thursdays). To create a smoother experience, I'd like for this to be done client side. The dillema is how can I intercept or precede the <asp:calendar> controls selectionchanged event from firing and run my client javascript; passing it to the server if validation succeeds for more intensive processing and database activity. The clientside javascript will need the selected date to deter...

Client side or server side validation???
I have multiple usercontrols each displayed by pressing a button and then change the apperance to a new user control and so on. I have to check that almost every field in this user controls have a value entered, and then indicate (e.g. with a red star) those textboxes that does'nt have a value entered. How should I do this in the best way, client side or server side with some validator? I have in mind that when using a server side validator, it may dissapear when making a postback. But I'm not sure, and I assume there is a way to come around this problem?What do you all say? Client side or s...

client side and server side validation
http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/validate/validator8.src&file=CS\validator8.aspx&font=3 i am trying to do custom validation something similar to the above. I hv done the Severvalidate method in the code behind. What about the client validation? do i do it in code behind or in javascript as shown? The goal is to add text like this to the page:<script language='javascript'>function MyFunction(src, args){  // your logic to set args.IsValid here}</script>ASP.NET doesn't care if you typed it directly in...

Web resources about - validation, is it better to have client side or use server side validator controls - asp.net.web-forms

Cross-validation (statistics) - Wikipedia, the free encyclopedia
is a model validation technique for assessing how the results of a statistical analysis will generalize to an independent data set. It is mainly ...

Serena Williams eyes history, Caroline Wozniacki craves validation in women's US Open final
As Serena Williams eyes another slice of tennis history, Caroline Wozniacki is craving validation with a watershed US Open final triumph on Sunday ...

Travers Duncan asks High Court to strike down ICAC validation laws
ICAC could be sent back to the High Court as a challenge to new laws validating corruption findings looms.

Adam Scott proclaims Texas win as validation of No.1 ranking
... No.1 golfer, beating American Jason Dufner in the third hole of a play-off at the Colonial event. "It's a good feeling and maybe some validation ...

Hollande to sign gay marriage bill after Constitutional Council's validation
Hollande to sign gay marriage bill after Constitutional Council's validation People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, ...

Marketers, Get Ready for the 'Validation Era'
The public brands included has been engaging in a "friends" arms race. But there are signs that we know we overdid it.

Validation and Uncertainty
What an extraordinary conversation I had recently on Twitter. It started with Neil Killick’s statement that we should not consider our stories ...

Nvidia Icera 410 LTE Modem Passes AT&T Network Validation
... Today's news is a small step and logical precursor toward both goals, Nvidia's Icera 410 LTE and HSPA+ baseband has passed AT&T's network validation ...

Ting’s Q1 Subscriber Growth Suffers from Sprint’s New Unlocking Validation Process
Back in February, Sprint updated the process it uses to validate unlocked devices that customers want to utilize on other carriers or one of ...

[Android M Feature Spotlight] Stricter APK Validation Now Actually Checks If All Of An APK's Files Are ...
While you might file this one under "really? We weren't doing this already?" if you're a security expert, Google has added stricter validation ...

Resources last updated: 12/25/2015 5:55:34 PM