client-side scripting or server-side scripting

I want to perform data validation in my page using javascript before
the data is sent to my server, but I am very confuse that I don't know
which way to perform, client-side validation or server-side validation?
My javascript bible told me that javascript is a client-side scripting
for data validation in client pc, but when I look in my bible,
the validation part is done at server side.

The worst is that, I find no way to use javascript in .asp or .aspx environment.

I am really confuse with all these, could any one help me on this? Thanks.

7/26/2005 5:40:37 PM 24353 articles. 2 followers. Follow

5 Replies

Similar Articles

[PageSpeed] 2
Get it on Google Play
Get it on Apple App Store

Use .NET validator controls to do your validation.

Eric | Twitter epascarello | LinkedIn
7/26/2005 5:51:40 PM

I agree with alien51 ...
validation is usually performed client side. even when you use the validation controls of .net the validation is performed on the client. unless you have to compare a value with a database value... always use client side script...
see my blog at and check the future of open mobile widget solutions at
7/27/2005 11:13:59 AM
In general we have to prefer client side validation because it will reduce the number of trips to server.
But some browsers may not support java script(or the user may desable java script on browser)
So even if you done client side validation you need to write server side validation also.

Inster of these problems you can user the validation controls provided with .Net
The main advantage of these controls is they will check the brower whether it allow client side script or not
if yes they will do client side validation. Else they perform server side validation which is a automatic

Finally your validation include any database related value comparison you need to implement this with
server side validation only.


Krishna Kishore.  View My Blog
7/27/2005 11:41:41 AM
In fact, I used to develop web page in .aspx and I use C# as
server-side scripting. Also, I did used the validator provided by the
..NET framework, but I don't like the validation control because it is not that
impressive (may be there is some other good validation control that is
out of my knowledge, but the validation control that I used before was not that good). Instead of
having the validation control's error message shown in the manner
much similar to a label, I would like the error message to be shown
using alert box, or any other boxes as for different purposes. By using
the pop-up box, it looks cool, don't you all feel that?

I agree with csharppointer, where I prefer to have client side validation to free the server from out of resources. This is why I want to use client side scripting for validation, especially javascript. The only thing is that I don't know when to perform server side validation and when to perform client side validation.

Finally your validation include any database related value comparison you need to implement this with
server side validation only.

csharppointer, is it possible for me to validate my page data using javascript then only pass it to other .aspx page for data processing (e.g. compare with DB data)? For example, first I validate the data in purchase.html at client side, and once it is validated, the data validated then is to be passed to process.aspx page for further data processing (e.g. insert into database table).
7/27/2005 2:19:08 PM
Since you are unaware of other validation solutions, let me point out the one I've written: Professional Validation And More. It handles more browsers and have many ways to get the users attention, including alerts, changing the color of the field with the error or the label for that field, and even blinking the error message.

No matter what, you must always write code to validate on the server side everything that you validated on the client-side. This point has been made in this thread but its essential. You see, hackers and people who turn off javascript on their browser will bypass your client-side validation leaving your server side code vulnerable to invalid (and inappropriate) data.

In both Microsoft's and my Validation systems, the submit buttons automatically fire the server side validation on every validator for you. You have only one task: before saving your data, test that the page is valid:
If Page.IsValid Then
  ' save
You do this inside the Click post back event handler.

If you want to submit one page and then move to another, understand that ASP.NET always posts back to the original page. That way, the web control objects can process the data. You can move to another page after all of the processing is done using either Responce.Redirect or Server.Transfer. (Both are documented in the .net documentation.) Server.Transfer is better for passing along the values from one page to the next.
--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
7/27/2005 4:10:40 PM

Similar Artilces:

client side script Vs Server side Script
Which is better ? Using Client Side validations with Java Script or Using Server Side validation controls provided in You should use both... Client-side for a rich user experience and server-side to support browsers without javascript support or with javascript turned off....

Call server-side script from client-side script
Hi to all, I would like to ask you How can i call from client-side script a server-side script and to have the result from the server-side script in the client-side script. For example, i wand to call a function writing in server-side (DynaScript) script from a client-side script (JAVASCRIPT) and to have an answer from the function. Thanks in advance. Nick, One way that you could get round this is to write your client script code as you would server script eg. <SCRIPT language=javascript> function getValue()... would be written as: <% psDocument.WriteLn(&...

Client-Side scripting vs Server-Side scripting
hello I need an article that spaeks about Client-Side scripting vs Server-Side scripting,and when i need to use one of them thank you for the help and for the time here are some good links to a bunch of articles on that subject...

Difference between client side scripting and server side scripting
Hi,      Can u  plz, explain why the server side scripting is necessary, inorder to write the client side scripting. What is the main difference between the client side scripting and server side scripting. Client-side scripting is code that is executed on the client side, such as JavaScript. Server-side scripting is code that is executed on the server, such as VB, VB.NET, C#, or J#. For a better definition of server-side scripting and when it's necessary, please visit OlshanASPInsider | Microsoft MVP...

How to call a client side script from a server side script?
Hi guys, I have a Button1_Click function which gets executed on the server side as soon as Button1 is clicked. I have a client side function, test, which is  written in vbscript. I need to call this test function from the Button1_Click function. Can anyone of you please tell me how to do this? The test function is inside an asp:content tag (Please excuse my terminology if I am wrong, I am new to all this).  Thanks and Regards, RJ Have you tried to use the below code Button1.Attributes.Add("onclick","test()"); HCHaissam Abdul MalakMCAD.NET| Blog | Yes, ...

Acessing variables, declared in the server side script, from the client side script
I'd like to know how can I use variables declared in the server side script from the client side script. P.S.: I'm using JavaScript in the server side script and in the client side script. I don't like to use ASP. Thanks! One example that come to mind: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=windows-1252" http-equiv="Content-Type"> <META name=GENERATOR content="MSHTML 5.00.2919.6307"> <SCRIPT language=JavaScript> ...

Acessing Variable, declared in the client side script, from the server side script
I'd like to know how can I use variables declared in the client side script from the server side script. Thanks! You cannot. The only way is to pass them as arguments to the server-side script. -- Larry Cermak [Team Sybase] Corporate Technology Partners EAServer Training & Consulting Coming Soon: Web DataWindow Book Web DataWindow Articles: "Jeong-Su, Hwang" <> wrote in message > I'd like to know how can I use variables declared in the cl...

Client-Side and Server Side Scripting
Hi, im currenty in the process of trying to get an page to work with both <script> and <script runat="server" tags... idea being, i have a <script> tag which holds all the client side scripting for my webpage, at the moment this is just some slider controls which i have created (the scripting behind this is actually from someone on a different forum, which i have modified to do what i want..) - but i also want a <script runat="server"> tag to hold all the code for the buttons pressed etc in my web-page. im trying my hardest not to use a ...

communication between client side(java script) and server side in .net project
I have a question which is, when building a .net project, we are able to use server side code and client side code(java script). How do they communicate? Thanks Client Side coding works with the WebBrowser. So when ever you write client side code you have to keep browser compatability in your mind and you have to code. Server Side code works with Web Server (IIS) and it's ASPNET ISAPI's. The won't directly communicate with each other. But using AJAX you can all server side code from Client Side! Example article on Ajax@

Calling server side scripts from client side
Hello, Can Anyone help out from the following : It is regarding calling server side scripts from client side events. I am able to instantiate a jaguar component in the server side script written in the body of the HTML page as follows : <% var mycomp = java.CreateComponent ("pkg_dispatch/n_jaguar", "iiop://jaguar:9000", "Jagadmin", "" ); if (mycomp == null) { document.writeln("ERROR: failed to instantiate !"); return; } %> I want to use the instance of the jaguar component else wher...

Server side Variable in client side script
Hello, I want to access the variable defined in the server side script from the client side. Can anyone help out with an example ??? TIA, Rakesh Babaria I think what you do is write is as a java script variable, so something like this: <!--SCRIPT var ls_serverVar ls_serverVar = "whatever"; document.writeln("<SCRIPT language=JavaScript>"); document.writeln("var xyz = " + ls_serverVar); document.writeln("</SCRIPT>"); --> Then in your client script, you'll be able to get XYZ. ...

without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible?
without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible? avdp211:without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible? I don't think it is possible.You use the the HTML input file control and when you post the request, on the web server you need to read the data and save it to a file, so there has to be some interaction with the server to handle the post request.  Not possible vi...

Client side script calling Server side functions
Hi, I'm currently developing an enabled aspx page that contains a usercontrol (which is based on the listbox but extends it to include icons to represent invalid data). I want the onClick event of the selected TR to call an server function which then populates the controls to the right hand side in the page. Obviously because the row is just rendered HTML overriden from the base class I can only assign a javascript function to the onClick event. So I need a way of calling a server side function that will populate th...

calling server side function from client side script
i have a web form that includes a function named "koko()" in its server side class i want to write a script code in in its HTML script that will be run at the client side, and this client side script will call the function "koko()" from the server side. in brief : i want to call a server side function from a client side script... can you help me in this You can't call server-side code directly from client-side code. You can, however, trigger a postback that your server-side code watches for and triggers the server-side code appropriately. You can do some ...

Web resources about - client-side scripting or server-side scripting -

Client-side scripting - Wikipedia, the free encyclopedia
... different and changing content depending on user input, environmental conditions (such as the time of day), or other variables. Client-side ...

Senior Search Manager - Client Side!!
... strategy insight for senior IT management - resources to understand and leverage information technology. Senior Search Manager - Client Side ...

Account Manager - Client Side - Previous Agency Experience Welcome!!
Computerworld Australia is the leading source of technology news, analysis and tools for IT decision makers, managers and professionals.

Media Sales Executive - Client Side!!
Technology news and reviews for business and home.

PPC Paid Search Manager - CLIENT SIDE
Defining Technology for Australia's IT Leaders. PPC Paid Search Manager - SEM - **CLIENT SIDE** Sydney CBD Location Client side!! SEM/PPC/Paid ...

How Basecamp Next got to be so damn fast without using much client-side UI
When we started working on Basecamp Next last year, we had much internal debate about whether we should evolve the existing code base or rewrite ...

Seven Tips for Pitching From the Client's Side of the Table
I had a chance to sit on the other side of the pitch table. Here is what I learned.

Client-side coding: How to prevent malicious use?
Applications that run on a user-controlled device cannot be perfectly protected.

The client side
... regarding the professionals you seek to assist. Even better if you possess that understanding yourself, having worked on the client side. I'm ...

Ecommerce traffic being hijacked by client side malware
According to new research 15 to 30 percent of eCommerce site visitors are infected with Client Side Injected Malware (CSIM) that causes them ...

Resources last updated: 12/30/2015 7:01:53 PM