Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 26th, 2010, 01:23 PM
Authorized User
 
Join Date: Jun 2008
Location: , , .
Posts: 75
Thanks: 15
Thanked 0 Times in 0 Posts
Default Questionaire Web Application

I know there is probably at least a dozen ways of doing this. But I am working on an application that will ask the user random questions as they navigate mutiple forms. So I will need to be able to save their answers to the questions on one form as they navigate to the next form with more questions. Also the users answer to a question will determine the next set of questions I will ask them. So there will need to be some sort of decision structure. My question is whether vb.net provides a way of handling the questions or data without me having to have a lot of if statements. Also how does vb.net handle storing data across mutiple forms? Thanks for any suggestions.
 
Old March 27th, 2010, 06:32 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

Here you're working with storing items in the page, so you could use something like viewstate to preserve the information across postbacks, or you could also save the data as name / value pairs in hidden fields (<input type="hidden" ...etc... />) Simply set the value property of the hidden form field to the variable with the data you want to retrieve on the next page.

On your other item, application logic has to be programmed. There's no two ways around it. Programming has come a long way, but if you want a computer to make decisions, you have to tell it how. What you'll want to do is maintain good abstractions. For example have a high level decision structure that determines if you need to send the user an email, ask a user more questions, get the user's mailing address, etc. (ie high level activities that have nothing to do with coding specifics, these are tasks you could execute in any programming language and in many ways) For each activity, call a new function that handles just that task.

Then start boring down into the specifics. So the function that emails someone might check to see if you have their email address; if you do, call a function that sends a form email. If not, call a function that displays a form requesting their email address (once you capture the email, you can call the function that sends the form email). The low level function to send the email will then handle all of the low level implementation involved in actually shooting that form mail out. You may have even lower level helper functions that encapsulate important functions you need to do over and over again and don't want to have write a hundred times.
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old April 12th, 2010, 01:27 PM
Authorized User
 
Join Date: Jun 2008
Location: , , .
Posts: 75
Thanks: 15
Thanked 0 Times in 0 Posts
Default Question

On your post you mentioned
save the data as name / value pairs in hidden fields (<input type="hidden" ...etc... />) Simply set the value property of the hidden form field to the variable with the data you want to retrieve on the next page.

As I move on to the next page(s) will this value still be retained in the hidden field. If so how do I access a hidden field value on a form?




Similar Threads
Thread Thread Starter Forum Replies Last Post
Questionaire Web Application dotnetDeveloper BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 March 26th, 2010 04:06 AM
Difference between web application and web site manojm39 ASP.NET 2.0 Basics 2 August 10th, 2007 09:06 AM
Web Application OR Windows Application adesilva .NET Framework 2.0 2 May 4th, 2007 07:12 AM
Developing a web site not a web application mkerchenski ASP.NET 1.0 and 1.1 Basics 8 May 25th, 2004 09:03 AM
Web application Vs Windows Application Ned .NET Web Services 2 January 20th, 2004 01:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.