Computer Learning Zone CLZ Access Excel Word Windows

One is free to imagine and effect changes on the world. And if enough people do it, there are big changes.

-Neil Peart
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
Home > Forums > ASP
Active Server Pages Forum

Back to Active Server Pages Forum

Form Data Upload Images   Link  
Kevin Robertson 
15 months ago
I have a form on a page with validation that the required data has been entered. If all the data has been entered it gets written to my database otherwise I display a message in the form which data is missing.

The problem is when I return to the page using response.redirect all the fields in the form have been reset. How do I prevent this from happening?
Kevin Robertson
15 months ago
Sorry, I should have mentioned I'm using ASP.NET.
Richard Rost
15 months ago
Well, I'm not an ASP.NET expert (yet). I still use Classic ASP. The way I would handle that is with session variables. When the data is submitted, gather it up into a session variable.

Session("FirstName") = Request("FirstName")

Now if you have to redirect them back to the form because of bad data, make those session variables the VALUEs in the fields.
Alex Hedley
15 months ago
Could use the ViewBag.

Theres also inbuilt Validation.
You could have it checked via js before you submit the page and also after with the Required attributes
Kevin Robertson
15 months ago
Thank you Richard. Got it working perfectly. :)

This thread is now closed. If you wish to comment, start a NEW discussion, below.

Back to Active Server Pages Forum

Start a NEW Conversation
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.

Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
My Account
My Courses
Lost Password
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Customer Support
Web Site Tour
Consulting Services
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Contact Info
Support Policy
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn