473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Page.IsPostback & Validation

What is the best way to perform a 2 stage user input, for example in the
scenario where the user has forgotten their password:

Stage 1:
Request and validate the user's email address

Lookup the email and retrieve the secret question

Stage 2
Request and validate the user's answer to the secret question

Reset the password

As stage 2 cannot be performed until stage 1 has been submitted we can
perform this using 2 aspx pages although I'd prefer to use one page if
possible and use program logic to determine what stage we are up to and
display the appropriate user prompts.

Any comments on performing this task ?

Thanks

Murphy
Nov 18 '05 #1
2 1521
Murphy wrote:
What is the best way to perform a 2 stage user input, for example in the
scenario where the user has forgotten their password:

Stage 1:
Request and validate the user's email address

Lookup the email and retrieve the secret question

Stage 2
Request and validate the user's answer to the secret question

Reset the password

As stage 2 cannot be performed until stage 1 has been submitted we can
perform this using 2 aspx pages although I'd prefer to use one page if
possible and use program logic to determine what stage we are up to and
display the appropriate user prompts.

Any comments on performing this task ?

Thanks

Murphy


Since this is quite simple, I would use panel controls to control the
visibility of each stage.
In Page_Load you can check which stage has been completed and set the
Visible property of the Panel controls as necessary.

--
Philip Q
Microsoft MVP [ASP.NET]
Nov 18 '05 #2
Thanks Philip, this is the path I have taken, actually used a table with 4
rows and set the visible of the second two to false if it's the initial load
of the page. Interestingly the fourth row has a validation control yet this
does not appear to activate if the row is not visible !

When validation is done on the client all is well however if the client does
not support validation and the form is posted then validated by the server
and rejected is this considered a postback when it is redisplayed after
being rejected ?

Thanks

Murphy

"Philip Q [MVP]" <wi******@mvps.org> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Murphy wrote:
What is the best way to perform a 2 stage user input, for example in the
scenario where the user has forgotten their password:

Stage 1:
Request and validate the user's email address

Lookup the email and retrieve the secret question

Stage 2
Request and validate the user's answer to the secret question

Reset the password

As stage 2 cannot be performed until stage 1 has been submitted we can
perform this using 2 aspx pages although I'd prefer to use one page if
possible and use program logic to determine what stage we are up to and
display the appropriate user prompts.

Any comments on performing this task ?

Thanks

Murphy


Since this is quite simple, I would use panel controls to control the
visibility of each stage.
In Page_Load you can check which stage has been completed and set the
Visible property of the Panel controls as necessary.

--
Philip Q
Microsoft MVP [ASP.NET]

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Matthias Lohrer | last post by:
Hi, I'm playing around with the possibilities of Page.ParseControl. Thanks to Kirk Allen Evans I got my example running (Posting Juli, 17, "Re: Generating ASP.NET-Controls with XSLT...
0
by: Nazir | last post by:
I am trying to do something pretty simple - but can't see how it can be done in ASP.NET. I have an aspx web page with a form which opens up a new window. The web page uses code behind to build...
3
by: Arun K | last post by:
Hi, I am creating a simple .aspx page to add some fields with validation. I have used different .NET validations like REquiredFieldValidator, RegularExpressionValidator and showed the summary...
7
by: ani | last post by:
I have two submit buttons in my form which need to validate two different controls on the page . How do I validate portions of the asp.net page. The two submit buttons should validate their...
5
by: Jim Heavey | last post by:
When should you use the Page.Validate() method? I thought you would use this method if you have some Server side validation (CustomControl's) you wanted to use and this would cause them to be...
3
by: ACaunter | last post by:
Hi all, I needed to have a validation to prevent someone from leaving the page if they added anything to it. I have about 10 imagebuttons at the top of the page for menu selections, and i wanted...
4
by: COHENMARVIN | last post by:
I'm a asp programmer starting out with asp.net. I understand that an asp form can post to its own page and that this allows validation of form fields on the server. But suppose all the controls...
3
by: Nathan Sokalski | last post by:
I am recieving the following error on the second postback of a page I have written: The state information is invalid for this page and might be corrupted Stack Trace: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.