Click to See Complete Forum and Search --> : Passing values to ASP


sub
10-04-2004, 09:31 AM
Hi,
I have a webpage asp1 which has input fields. This screen is an asp page. When the data is entered in the asp1, the data is passed to asp2 which is an asp page. i am using POST method in asp1. asp2 does some validations & connects with the database to check if the data is correct. if the data is correct i display the values got from database.
if the data is wrong, i need to throw an error message to the asp1. asp1 should also have to retain the values entered on the input fields. can someone tell me how to throw an error message in the asp1 screen & also retain the entered values.

Thanks
Sub

buntine
10-04-2004, 09:58 AM
There is no practical, in-built exceiption throwing capability in ASP. But, you can simply use an If Statement to check whether the data is correct or not.

If [your-data-check-here] Then
'| Display the data which was grabbed from the database.
Else
Response.Write("Error: Some error message") '| Display an error message.
Response.End '| Discontinue executing the page and send it to the client.
End If

Regards.

sub
10-04-2004, 10:09 AM
how do I go back to asp1 from asp2 when there is an error?
I used Response.Redirect. But this removes all the existing values in the entry fields.

Thanks
Sub