Where to use ASP and where not to use ASP

There are many jobs to be performed and we will try to understand what type of job we should do at server end and what we will delegate to client end JavaScript or HTML. Let us start with some tasks we want our web page to do. Here are some of the common jobs we will discuss to get an idea on what to use for different tasks a web page perform.

Displaying Alert message in a small window

Small windows are client side property. So we need Client Side JavaScript to display the alert message. But the content of the alert message we can manage by using ASP. We can conditionally ( display or not ) show the alert box and manage the content ( text part ) based on ASP code we write. So let us conclude that showing an alert message is client side task and we have to use JavaScript for this.

Authenticating user before entering to members only area

This task we can't handle at client end. Once the user enters userid and password, we will verify that using a membership table and then we can say the user is allowed or not. This job is to be handled by ASP script running at server end. Now displaying the welcome message or asking the member to try again is decided by ASP script and the display is shown at browser by using html tags.

Validating data entered by user in a text box ( or form )

This we have seen at many web sites. If we are suppose to enter price in figure and if we enter any character in the text box then we get an error message. Here validation of the data entered by the user is done and accordingly error message is displayed. This task can be done at server side and client side also. Depending on the requirements we can develop the code. There is a risk if we do it at client end only. If script execution is off at client end then the validation code written using client side JavaScript is not going to check and display any error message. This will allow un-validated data to enter into system. However we can check the browser setting of the client computer and display a message or redirect to a page asking them to enable the script execution first before using the form. Depending on server side validation is full proof but for bigger forms large amount of data has to return again from server if data validation fails. This is going to take more time particularly for the visitors with slow connection. So validation is used based on requirements of the page.

We have discussed three common applications here and we will able to understand more on this as we develop scripts for different applications.


Be the first to post comment on this article :

plus2net.com




Post your comments , suggestion , error , requirements etc here .




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer