

Overall Structure
The overall stucture of our webpage will look like this:
We will first attempt to detect if the page has been resubmitted. If the page is not being reloaded
(ie being loaded for the first time, or has been tampered with) then we will display the form. We will also load the default values for the
form into local ASP variables (these might be extracted from a database, or might be blank). We will also write out the required
client side javascript.
If the form is being resubmitted then we validate all the input on the serverside. If the input is all valid, then we insert it into the
database (or email it, or whatever) and redirect to the next page. If the input is not valid, then we again load the form element
values into local variables (eg using the Request.Form collection). We also accumulate a list of error messages. Once again
we display the form, with the form element values populated by local variables, but we include the list of error message.
Our actual page structure is going to look a bit like the following, and on each subsequent page, I'll be indicating where in the page
we are currently dealing with.
|
<%
If isPostBack() then
Else
End If
%>
|
|
|
|
Back to Contents | Onto Client-Side validation
Back to Code Listing
|