Where to use ASP and where not to use ASP

A useful way to decide between Classic ASP and browser-side code is to ask where the information and authority live. ASP runs on the server during a request; JavaScript runs in the browser after the response reaches the user.

Displaying an alert or reacting instantly to a click

That is a browser-side task, so use JavaScript. ASP can decide what HTML or JavaScript to send, but it cannot react to a later browser event unless the browser makes another request (for example through a form submission or AJAX).

Authenticating a user

Authentication and authorization decisions belong on the server. The browser can collect a user ID and password, but the server must verify the credentials and decide whether the user may access protected data. Client-side code must never be treated as the security boundary.

Validating form data

Use client-side validation to improve usability, but always validate important data again on the server. A visitor can disable or bypass browser JavaScript and can send requests directly to the server. See the client-side validation tutorial and the server-side regular-expression examples.

This server/client distinction becomes especially important in the database, login, session, and form-processing tutorials later in this section.


ASP Home






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